Closed Amanita-muscaria closed 4 years ago
Hi @Amanita-muscaria , this is because rua isolates your home directory where otherwise rustup cache (and default toolchain) would be stored: https://github.com/vn971/rua#safety
You can compromise isolation a bit and bind ~/.cargo
for it to be read-writeable (or just readable). It can be done by configuring "wrap_args", see example here: https://github.com/vn971/rua/blob/master/res/wrap_args.sh.example
(or in ~/.config/rua/.system/wrap_args.sh.example
locally)
If you want to build fully isolated without assuming anything from HOME directory (e.g. existence of the toolchain), you can modify PKGBUILD to use code like that:
RUSTUP_TOOLCHAIN=stable cargo build --release ....
This is actually the preferred way to write AUR packages, because there are potentially many users who are not yet very familiar with Rust. They will have rustup installed, but not the stable toolchain, and thus nothing in their HOME yet.
Does that explain it / make any sense?
Ya, that makes sense. Thanks!
If you want to build fully isolated without assuming anything from HOME directory (e.g. existence of the toolchain), you can modify PKGBUILD to use code like that:
RUSTUP_TOOLCHAIN=stable cargo build --release ....
This is actually the preferred way to write AUR packages, because there are potentially many users who are not yet very familiar with Rust. They will have rustup installed, but not the stable toolchain, and thus nothing in their HOME yet.
Is this problem occurs only in Rua or in other AUR helpers too?
If you want to build fully isolated without assuming anything from HOME directory (e.g. existence of the toolchain), you can modify PKGBUILD to use code like that:
RUSTUP_TOOLCHAIN=stable cargo build --release ....
This is actually the preferred way to write AUR packages, because there are potentially many users who are not yet very familiar with Rust. They will have rustup installed, but not the stable toolchain, and thus nothing in their HOME yet.
I don't like this. I use nightly and it forces me to download a stable branch.
@refaelsh the problem will appear in any AUR helper that does not use the fact that the user might have downloaded something to their HOME directory. Such a PKGBUILD will definitely have problems for users who didn't do anything special about their HOME yet and are starting from scratch (let's say, clean re-installation of the OS without any Rust commands run prior)
@Morganamilo I see your point. I would argue that a PKGBUILD should still say what it needs. E.g. whatever Rust version you need, it should be specified reproducibly in the build description, not relying that the user accidentally did what you wanted.
In the case that you're referring to that's really harder, because rustup
on Arch does not come with any toolchain at all, by default. I'm open to other solutions as well -- please share if you have any -- except recommending to write PKGBUILD's that only work if user also accidentally did something on their ~
.
I was attempting to update spotify-tui but this error popped up:
I've set the default toolchain to stable via rustup (
rustup default stable
) but the error persists. I'm assuming I need to give rua access to something?