Rust snap

Hello,

I’ve created initial snap packaging for core Rust tools (cargo and rustc, for now).

Snap’s confinement is set to strict at the moment, building and installing Rust crates is working, but:

  • it would be nice for user to have access to cargo’s temporary build directory located in /tmp,
    this is not possible without classic confinement AFAIK
  • binaries are now being installed to $HOME/snap/rust/current/.cargo/bin
    and I think that cargo should respect CARGO_HOME which defaults normally to $HOME/.cargo/bin

I’ve tried changing confinement to classic but then snapcraft layout seemed to not work, as rustc is looking for static libraries in /usr/lib/$SNAPCRAFT_ARCH_TRIPLET.

So, ideally, it would be great to somehow allow cargo to access host /tmp directory, so if build fails, user can easily debug what’s wrong. Currently it is not possible without root to access /tmp/snap.rust directory.

Do you think it would be better to stick with strict confinement and tinker a bit with issues listed above or switch to classic and address the only issue where rustc can’t find static libraries? Either way, I could use some help here.

https://snapcraft.io/rust
https://github.com/dawidd6/rust-snap

1 Like