I was half-heartedly fooling around with rust+webassembly a few nights ago, which quickly takes you outside the packaged-in-Fedora universe - in particular, you need a build of rustc that can target webassembly.
The advertised way to do this is rustup, which downloads and installs rust compilers in ~/.cargo/bin alongside things that you build and install with ‘cargo install’.
But the home-directory install rubbed me the wrong way - in addition to wanting to keep this isolated from my normal working toolboxes instead of mixed with them, some crates (called -sys) do have dependencies on native system libraries which could differ between different toolboxes.
What I really wanted to do was to have a rust-development toolbox with all the rustup installed stuff and the stuff I installed with cargo isolated there - and more generally, I wanted a solution where things that I install with cargo are toolbox-local not home-directory global.
Some desirable properties of a solution:
- Can easily start using ‘cargo install’ in an arbitrary existing toolbox container.
- Location of $CARGO_HOME is on a direct bind mount, not fuse-overlayfs
One possible solution (that has property 1 but not property 2.:
sudo mkdir /cargo
sudo chown $(id -u):$(id -g) /cargo
ln -s /cargo ~/.cargo
I’m sure some people here have already come up with solutions for this and validated them with use. How are you handling this?
Thanks!
Owen