dev-util/rustup: use system toolchain and ignore rust-toolchain.toml

Rustup reads rust-toolchain.toml if present in $(pwd) which may
cause undesired behavior.

Change to a temp dir bevor executing rustup to prevent this behavior.

[sam: Revbump to propagate the fix.]

Closes: https://bugs.gentoo.org/965147
Signed-off-by: Pepper Gray <hello@peppergray.xyz>
Part-of: https://github.com/gentoo/gentoo/pull/44341
Closes: https://github.com/gentoo/gentoo/pull/44341
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Pepper Gray
2025-10-26 10:05:15 +01:00
committed by Sam James
parent da62e037c2
commit 1f03ca6b4f
2 changed files with 3 additions and 0 deletions

View File

@@ -88,11 +88,14 @@ symlink_rustup() {
fi
done
# prevent reading rust-toolchain.toml from $(pwd)
pushd $(mktemp -d) > /dev/null
good "Setting gentoo ${gentoo_rust// /} as default toolchain"
[[ ${QUIET+set} != set ]] && "${CARGO_HOME}/bin/rustup" -V
"${CARGO_HOME}/bin/rustup" ${QUIET--v} toolchain link gentoo "/usr"
"${CARGO_HOME}/bin/rustup" ${QUIET--v} default gentoo
[[ ${QUIET+set} != set ]] && "${CARGO_HOME}/bin/rustup" show
popd > /dev/null
good "Prepend ${CARGO_HOME}/bin to your PATH to use rustup"
good "rustup selfupdate is disabled, it will be updated by portage"