rustup icon indicating copy to clipboard operation
rustup copied to clipboard

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

Open foresterre opened this issue 4 years ago • 1 comments

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 avatar May 04 '21 16:05 foresterre

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

rbtcollins avatar May 04 '21 18:05 rbtcollins