Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automatically provide a Rust toolchain using rustup #107

Open
atopia opened this issue Oct 15, 2024 · 0 comments
Open

automatically provide a Rust toolchain using rustup #107

atopia opened this issue Oct 15, 2024 · 0 comments
Assignees
Labels

Comments

@atopia
Copy link
Contributor

atopia commented Oct 15, 2024

A comment in issue #99 raised the question of automatically downloading a Rust toolchain if the required toolchain and components are not found on the host system.

A first exploration suggests this would be reasonably easy by using rustup and $RUSTUP_HOME / $CARGO_HOME. Goa should check if a matching toolchain is already installed on the host system by parsing rustup toolchain list and if it features the rust-src component by calling rustup compoent list +nightly-toolchain-name. Depending on the outcome, calls subsequent calls to cargo should add a +nightly-toolchain-name as a first argument, so that e.g. a nightly toolchain is selected even if the default toolchain is set to stable. If no suitable toolchain is found, goa should install the necessary components into a local $RUSTUP_HOME and export the environment variable on subsequent calls to cargo.

Alternatives exist e.g. by using toolchain files or directory overrides, but the former requires an extra file to be generated in the Rust source directory while the later would intransparently alter system-wide configuration.

@atopia atopia added the feature label Oct 15, 2024
@atopia atopia self-assigned this Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant