Skip to content

Add rustfmt when installing a new toolchain #913

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

Merged
merged 1 commit into from
Jul 27, 2020
Merged

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Jul 27, 2020

Example build:

2020/07/26 20:02:52 [INFO] rustwide::toolchain: adding component rustfmt for toolchain nightly
2020/07/26 20:02:52 [INFO] rustwide::cmd: running `Command { std: "/home/joshua/src/rust/docs.rs/.rustwide/cargo-home/bin/rustup" "component" "add" "--toolchain" "nightly" "rustfmt", kill_on_drop: false }`
2020/07/26 20:02:53 [INFO] rustwide::cmd: [stderr] info: downloading component 'rustfmt'
2020/07/26 20:02:54 [INFO] rustwide::cmd: [stderr] info: installing component 'rustfmt'

This was tested by building fermium 0.0.11 with the new changes. I made sure rustfmt was actually visible to the crate by looking at the generated source. Here is /fermium/0.0.11/src/fermium/opt/rustwide/target/debug/build/fermium-d794f31f687205c6/out/bindings.rs.html#714-726:

image

I have not tested the upgrade behavior, so possibly this shouldn't be
merged until I do that.

Closes #357.

r? @pietroalbini

Example build:

```
2020/07/26 20:02:52 [INFO] rustwide::toolchain: adding component rustfmt for toolchain nightly
2020/07/26 20:02:52 [INFO] rustwide::cmd: running `Command { std: "/home/joshua/src/rust/docs.rs/.rustwide/cargo-home/bin/rustup" "component" "add" "--toolchain" "nightly" "rustfmt", kill_on_drop: false }`
2020/07/26 20:02:53 [INFO] rustwide::cmd: [stderr] info: downloading component 'rustfmt'
2020/07/26 20:02:54 [INFO] rustwide::cmd: [stderr] info: installing component 'rustfmt'
```

This was tested by building `fermium 0.0.11` with the new changes.

I have not tested the upgrade behavior, so possibly this shouldn't be
merged until I do that.
@jyn514 jyn514 changed the title Add rustup when installing a new toolchain Add rustfmt when installing a new toolchain Jul 27, 2020
@@ -166,6 +166,9 @@ impl RustwideBuilder {
for target in &targets_to_install {
self.toolchain.add_target(&self.workspace, target)?;
}
// NOTE: rustup will automatically refuse to update the toolchain
// if `rustfmt` is not available in the newer version
Copy link
Member

Choose a reason for hiding this comment

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

Do we want this behavior, or should we not block the update on it and only have optional rustfmt support? This will currently result in occasionally having like a week without updating the nightly.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think going a week without updating is better than having rustfmt support you can only sometimes depend on. See #357 (comment).

@jyn514 jyn514 added A-builds Area: Building the documentation for a crate C-enhancement Category: This is a new feature S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels Jul 27, 2020
@jyn514 jyn514 merged commit 01016e6 into rust-lang:master Jul 27, 2020
@jyn514 jyn514 deleted the rustfmt branch July 31, 2020 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-builds Area: Building the documentation for a crate C-enhancement Category: This is a new feature S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Please install rustfmt to the docs.rs doc build environment
3 participants