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

Allow rustup-init to install the default toolchain from a toolchain file #2751

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

foresterre
Copy link
Contributor

This PR allows rustup-init to install a default toolchain from a specified toolchain file.

In the current draft PR:

  1. The toolchain file is only checked for the channel field, which to the best of my knowledge corresponds to the toolchain field. I could also add overrides for the other fields which can be specified in the toolchain file: the target (in rust-toolchain.toml)/host(in rustup), the components and the profile.

  2. I re-used the name suggested by @XAMPPRocky, --from-file.

  3. The toolchain specified by the toolchain file is only used if the --default-toolchain option is not given.

  4. The parse mode is determined based on the file extension, if it has a toml file extension, the TomlOnly mode is used, else, the legacy mode is available. When the toolchain file is used to override current toolchain, the toolchain file name is fixed. In the suggested option this is not necessarily the case, so I opted to take this middle ground for now.

  5. I will add extra test cases in a bit (I'm a bit figuring out how the testing setup works :))

closes #2749

@foresterre foresterre force-pushed the rustup-init-with-rust-toolchain branch 2 times, most recently from 9e20396 to 3056e66 Compare May 4, 2021 16:51
@foresterre foresterre force-pushed the rustup-init-with-rust-toolchain branch from 3056e66 to 8395087 Compare May 4, 2021 18:10
@rbtcollins
Copy link
Contributor

Please see #2686 : I'm glad you're putting effort into this, but the immediate effort needed is probably some design / hallway testing work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rustup-init with rust-toolchain
2 participants