Skip to content

Add changes needed to use rustfmt as a subtree in rust-lang/rust - #4703

Merged
calebcartwright merged 4 commits into
rust-lang:rustfmt-1.4.38from
jyn514:subtree
Apr 22, 2021
Merged

calebcartwright merged 4 commits into
rust-lang:rustfmt-1.4.38from
jyn514:subtree

Conversation

@jyn514

@jyn514 jyn514 commented Feb 17, 2021

Copy link
Copy Markdown
Member

These changes can be replicated by checking out rust-lang/rust#82208 and then running git subtree push --prefix=src/tools/rustfmt <some remote here> subtree. That command took only a few seconds to run, I didn't run into any issues with repo size like Clippy has in the past.

This shouldn't be merged until there's some sort of decision on rust-lang/rust#82208.

@Manishearth

Copy link
Copy Markdown
Member

I don't think that PR is the right place for decisionmaking, I think we should file a separate issue and close that PR

@Manishearth

Copy link
Copy Markdown
Member

The repo size issues will occur on the subtree pull, pulling changes back in from Rust.

@Manishearth

Copy link
Copy Markdown
Member

What clippy typically does is pin a rust nightly via rust-toolchain, and update it when we do syncs. So clippy master always builds, and it jerks ahead every two weeks on our syncs.

@jyn514

jyn514 commented Feb 17, 2021

Copy link
Copy Markdown
Member Author

What clippy typically does is pin a rust nightly via rust-toolchain, and update it when we do syncs. So clippy master always builds, and it jerks ahead every two weeks on our syncs.

Yup, that was my plan :) if you look at rust-toolchain I changed it to add the rustc-dev component.

@jyn514
jyn514 force-pushed the subtree branch 3 times, most recently from 1de947a to 14b0b87 Compare February 17, 2021 20:36
@calebcartwright calebcartwright added the S-on-hold Status: PR/issue is on hold (due to bandwidth/prioritization/need discussions etc.). label Feb 18, 2021
@calebcartwright

Copy link
Copy Markdown
Member

Know the question about beta in CI has primarily been discussed elsewhere but posting here given context and this being the main PR left on this side of the equation.

I don't see any issues with dropping beta from our CI jobs that would warrant preventing moving forward with trying the subtree approach. The only active use cases are tests that verify the ability/inability to use certain formatting config options on nightly/non-nightly, and I can't think of nor find any motivations for CI on beta that predate my involvement with the project either.

@Manishearth

Copy link
Copy Markdown
Member

Makes sense, and I'll point out that rustc will be CIing beta rustfmt with beta rustc anyway

jyn514 added 4 commits April 20, 2021 15:52
This was being overriden by `lf=eof` in `.gitattributes` in the root
directory. Override it again to avoid warnings like this:

```
$ git diff src/tools/rustfmt/tests/target/issue-3494/crlf.rs
warning: CRLF will be replaced by LF in src/tools/rustfmt/tests/target/issue-3494/crlf.rs.
The file will have its original line endings in your working directory
```
- Update rust-toolchain to also install `rustc-dev` component
This also removes the (now unused) `RUSTC_RELEASE` and
`RUSTC_RELEASE_CHANNEL` variables.
@calebcartwright
calebcartwright changed the base branch from rustfmt-1.4.37 to rustfmt-1.4.38 April 21, 2021 03:10
@calebcartwright calebcartwright removed the S-on-hold Status: PR/issue is on hold (due to bandwidth/prioritization/need discussions etc.). label Apr 21, 2021

@calebcartwright calebcartwright left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thank you!

Comment thread Cargo.toml
Comment on lines -67 to -97
[dependencies.rustc_ast]
package = "rustc-ap-rustc_ast"
version = "712.0.0"

[dependencies.rustc_ast_pretty]
package = "rustc-ap-rustc_ast_pretty"
version = "712.0.0"

[dependencies.rustc_data_structures]
package = "rustc-ap-rustc_data_structures"
version = "712.0.0"

[dependencies.rustc_errors]
package = "rustc-ap-rustc_errors"
version = "712.0.0"

[dependencies.rustc_expand]
package = "rustc-ap-rustc_expand"
version = "712.0.0"

[dependencies.rustc_parse]
package = "rustc-ap-rustc_parse"
version = "712.0.0"

[dependencies.rustc_session]
package = "rustc-ap-rustc_session"
version = "712.0.0"

[dependencies.rustc_span]
package = "rustc-ap-rustc_span"
version = "712.0.0"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

my favorite diff of all time ❤️

@calebcartwright calebcartwright added the pr-ready-to-merge Status: PR is largely ready for merge, waiting for secondary review / last nits label Apr 21, 2021
@calebcartwright
calebcartwright merged commit 26fb3fa into rust-lang:rustfmt-1.4.38 Apr 22, 2021
@jyn514
jyn514 deleted the subtree branch April 22, 2021 02:35
@karyon karyon mentioned this pull request Oct 25, 2021
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Nov 3, 2026
The `matrix.channel` var is never set since
<rust-lang/rustfmt#4703> or commit
`26fb3fa737816532c17559552fb5ad0cbeeb610a` since 2021.
ettolrach pushed a commit to ettolrach/rustfmt that referenced this pull request Nov 4, 2026
The `matrix.channel` var is never set since
<rust-lang#4703> or commit
`26fb3fa737816532c17559552fb5ad0cbeeb610a` since 2021.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-ready-to-merge Status: PR is largely ready for merge, waiting for secondary review / last nits

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants