vn971 / rua

Build tool for Arch Linux providing control, review and jailed build options
GNU General Public License v3.0
424 stars 42 forks source link

no override and no default toolchain set #133

Closed Amanita-muscaria closed 4 years ago

Amanita-muscaria commented 4 years ago

I was attempting to update spotify-tui but this error popped up:

error: no override and no default toolchain set
==> ERROR: A failure occurred in build().
    Aborting...
Build failed with exit code 4 in /home/redacted/.cache/rua/build/spotify-tui

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?

vn971 commented 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)

vn971 commented 4 years ago

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.

vn971 commented 4 years ago

Does that explain it / make any sense?

Amanita-muscaria commented 4 years ago

Ya, that makes sense. Thanks!

refaelsh commented 3 years ago

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?

Morganamilo commented 3 years ago

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.

vn971 commented 3 years ago

@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)

vn971 commented 3 years ago

@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 ~.