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

Breaking changes in rustfmt with 1.45.0 #74443

Closed
Daniel-B-Smith opened this issue Jul 17, 2020 · 19 comments
Closed

Breaking changes in rustfmt with 1.45.0 #74443

Daniel-B-Smith opened this issue Jul 17, 2020 · 19 comments
Labels
T-release Relevant to the release subteam, which will review and decide on the PR/issue.

Comments

@Daniel-B-Smith
Copy link
Contributor

This seems to be a re-occurrence of #73078. The rustfmt released with 1.45.0 no longer respects #![cfg_attr(rustfmt, rustfmt_skip)] which breaks our CI for some auto-generated files.

@Daniel-B-Smith Daniel-B-Smith changed the title Breaking changes in rustfmt with 1.44.0 Breaking changes in rustfmt with 1.45.0 Jul 17, 2020
Daniel-B-Smith pushed a commit to Daniel-B-Smith/protoc-grpcio that referenced this issue Jul 17, 2020
The biggest thing I'm looking for in the newer versions is moving off of the deprecated `cfg_attr` to disable rustfmt which has broken multiple times recently (rust-lang/rust#73078, rust-lang/rust#74443).
@calebcartwright
Copy link
Member

Looks like 1.45.0 shipped with an older version of rustfmt

  • rustc 1.45.0 --> rustfmt 1.4.15
  • rustc 1.44.1 --> rustfmt 1.4.16
  • rustc 1.44.0 --> rustfmt 1.4.14

Not sure how that happened, but rustfmt v1.4.16 is the version that had the fix and both 1.4.14 and 1.4.15 had the bug from #73078

@JohnTitor
Copy link
Member

I think we missed a beta backport, as mentioned in https://rust-lang.zulipchat.com/#narrow/stream/241545-t-release/topic/rustfmt.20in.201.2E45.2E0.

@Mark-Simulacrum Mark-Simulacrum added the T-release Relevant to the release subteam, which will review and decide on the PR/issue. label Jul 19, 2020
@Mark-Simulacrum
Copy link
Member

"Missed" sort of implies that someone had raised it for beta backport, which I think never happened -- it seems like we just didn't consider a beta backport at all. I would not be opposed to doing a 1.45.1 release personally with the backport, cc @rust-lang/release for opinions.

We should, regardless, make sure that at least rustfmt 1.4.16 is in beta and nightly today.

@jonas-schievink
Copy link
Contributor

👍 for backport + stable patch release

@calebcartwright
Copy link
Member

calebcartwright commented Jul 19, 2020

We should, regardless, make sure that at least rustfmt 1.4.16 is in beta and nightly today.

nightly is on rustfmt 1.4.18 (though broken/unavailable ATM) and I believe beta is as well. Let us know if anything is needed from the rustfmt side though.

@miketimofeev
Copy link

Is there any chance of a new release with rustfmt 1.4.16 or even 1.4.17 today or tomorrow?

@Mark-Simulacrum
Copy link
Member

It won't be that quick, for sure, but I am currently thinking Tuesday or Thursday next week. I'm hoping to prepare artifacts and such today or tomorrow.

@Mark-Simulacrum
Copy link
Member

Okay I looked at which rustfmt release to promote to 1.45.1 and wasn't able to find a good candidate. I think we'll want the rustc-ap crates to be at version 659 -- but no rustfmt release has that. @calebcartwright @topecongiro -- could one of you take a look? If you'd like, you can also post a PR against rust-lang/rust stable branch which bumps rustfmt to whatever commit you think is the right one to release.

@calebcartwright
Copy link
Member

IIRC rustfmt v1.4.17 has v659 of the rustc-ap crates, though may need to find the right pairing of rustfmt and rls that'll work there

@Mark-Simulacrum
Copy link
Member

Initial draft is up at #74574, still has a few things left but I'm hoping to get that landed in the next few days so we can have artifacts ready for testing.

@calebcartwright
Copy link
Member

@Mark-Simulacrum - the same thing appears to have happened with rls, as 1.45.0 has an older version of rls than 1.44.1

  • rustc 1.44.0 --> rls 1.41.0 (2659cbf 2020-04-14)
  • rustc 1.44.1 --> rls 1.41.0 (7d3aba2 2020-06-17)
  • rustc 1.45.0 --> rls 1.41.0 (085f24b 2020-05-28)

I'm thinking the same combination of rls/rustfmt from 1.44.1 should be fine together: rls 1.41.0 (7d3aba2 2020-06-17) and rustfmt v1.4.16.

rustfmt v1.4.16 was released specifically for the 1.44.1 patch, whereas rustfmt v1.4.17 was intended to to do the same for nightly but was never actually merged to master because there was a broken toolstate issue that occurred around the same time (refs #73113). The only difference between these two rustfmt versions is rustc-ap v654 for rustfmt v1.4.16 and rustc-ap v659 for rustfmt v1.4.17

There may be some other combinations of rls/rustfmt that could work but I'd think the same ones from 1.44.1 would be safest.

@Mark-Simulacrum
Copy link
Member

Okay, I'll try that tomorrow, cherry-picking exactly 1.44.1 RLS and rustfmt to the stable branch. FWIW 1.4.17 does seem to work fine on the current PR (at least toolstate is green for RLS and rustfmt).

@calebcartwright
Copy link
Member

1.4.17 does seem to work fine on the current PR (at least toolstate is green for RLS and rustfmt).

With which version of rls? From the rustfmt perspective 1.4.16 vs. 1.4.17 doesn't really matter (they're basically identical), so as long as the rustc-ap versions line up with rls then IMO which of those two versions of rustfmt to use would just be a be a matter of whatever's easiest.

@Mark-Simulacrum
Copy link
Member

Ah okay then I'll probably leave things as is, since the current PR leaves RLS as-is (which seems good) and only bumps rustfmt, without duplicating any of the autopublished crates.

@Mark-Simulacrum
Copy link
Member

Although, wait, no, you're saying we bumped RLS in 1.44.1 too... gah. Okay, I'll need to think about this some more tomorrow, I'm so confused how we're seemingly bumping things in both directions here :/

@calebcartwright
Copy link
Member

Yeah the rustc-ap shuffle can be a real pain sometimes. In fairness, the version of rls that shipped with v1.44.1 seems to be chronologically newer, though I'm not sure what the actual expected/desired version for rls in 1.45.0 would be.

@Xanewok what version of rls were you expecting with rust 1.45.0?

Here's what I'm seeing
rustc 1.44.0 --> rls 1.41.0 (2659cbf 2020-04-14)
rustc 1.44.1 --> rls 1.41.0 (7d3aba2 2020-06-17)
rustc 1.45.0 --> rls 1.41.0 (085f24b 2020-05-28)

@calebcartwright
Copy link
Member

Sure others have already validated, but just wanted to confirm that the rustfmt version in the 1.45.1 prerelrease looks good and resolves the issue 👍

@calebcartwright
Copy link
Member

Can this be closed now?

@cuviper
Copy link
Member

cuviper commented Aug 6, 2020

Yes, thanks!

@cuviper cuviper closed this as completed Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-release Relevant to the release subteam, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants