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

Accept TOML format in rust-toolchain #2438

Merged
merged 6 commits into from
Aug 8, 2020

Conversation

ebroto
Copy link
Member

@ebroto ebroto commented Jul 23, 2020

Closes #2350

@ebroto
Copy link
Member Author

ebroto commented Jul 23, 2020

Not sure about the macOS CI failure as I can't see the logs 🤔

@rbtcollins
Copy link
Contributor

rbtcollins commented Jul 23, 2020 via email

Copy link
Contributor

@kinnison kinnison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Over-all I'm very impressed. The single main concern I have is that I think it'd be beneficial to make channel optional so that people can use this new format to specify components/targets without constraining the channel of the toolchain. With that, a bit of refactoring would be appropriate since the result of finding an override configuration might be that there's no toolchain override (though that might come from elsewhere) but there might be components/targets to install.

In addition, the integration tests could be tweaked to be more correct, less prone to risk of silently becoming worthless in the future, and possibly quicker to run, with the tweaks I mention in comments.

This is an excellent first pass. What do you think about my 'optional channel' point?

README.md Outdated Show resolved Hide resolved
src/cli/common.rs Outdated Show resolved Hide resolved
src/cli/rustup_mode.rs Outdated Show resolved Hide resolved
src/cli/setup_mode.rs Outdated Show resolved Hide resolved
src/config.rs Outdated Show resolved Hide resolved
tests/cli-rustup.rs Show resolved Hide resolved
tests/cli-rustup.rs Outdated Show resolved Hide resolved
tests/cli-rustup.rs Outdated Show resolved Hide resolved
tests/cli-rustup.rs Outdated Show resolved Hide resolved
tests/cli-rustup.rs Outdated Show resolved Hide resolved
- Make channel optional in the TOML toolchain file.
- Avoid exposing OverrideCfg outside the `config` module.
- Rework tests to avoid installing multiple toolchains unnecessarily and
  improve test naming to express better the intent.
- Restore unrelated extra whitespace.
@ebroto
Copy link
Member Author

ebroto commented Jul 27, 2020

I think making the channel optional is a great idea, thanks for the suggestion!

I've also tweaked the integration tests with your insights. I'll leave some comments to clarify some decisions I made.

Copy link
Contributor

@kinnison kinnison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is looking pretty good now. @rbtcollins Do you have time to skim?

Copy link
Contributor

@rbtcollins rbtcollins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few thoughts

README.md Outdated Show resolved Hide resolved
src/config.rs Outdated Show resolved Hide resolved
src/config.rs Outdated Show resolved Hide resolved
When trying to detect the format of the toolchain override file,
let serde do all the work. If the file does not parse as TOML,
fallback to the legacy format, but keep the TOML error. If the first
line does not happen to be a valid toolchain, show also the TOML error
so that TOML syntax errors are reported.
src/config.rs Show resolved Hide resolved
src/config.rs Outdated Show resolved Hide resolved
@rbtcollins rbtcollins merged commit b5f98c8 into rust-lang:master Aug 8, 2020
@ebroto ebroto deleted the rust_toolchain_toml branch August 8, 2020 12:03
bors bot added a commit to hermit-os/hermit-rs that referenced this pull request Dec 18, 2020
66: Pin toolchain to specific nightly version r=stlankes a=jschwe

This allows us to specify a specific version and needed components in rust-toolchain that rustup can then automatically install when running e.g. `cargo build`.
This needs a release of rustup that contains rust-lang/rustup#2438. The current version does not contain this yet, so this is PR is currently blocked (and also not tested).

Benefits:
- Pinning a specific compiler version ensures that building "always works". New nightly toolchains often can't build older versions of the rusty-hermit project
- Required toolchain components are automatically installed by rustup. 

Co-authored-by: Jonathan Schwender <schwenderjonathan@gmail.com>
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.

specify required components in rust-toolchain file
3 participants