-
Notifications
You must be signed in to change notification settings - Fork 731
Pin rustfmt and nightly revision used to build it #609
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #609 +/- ##
==========================================
+ Coverage 96.21% 96.23% +0.02%
==========================================
Files 51 51
Lines 8977 8977
==========================================
+ Hits 8637 8639 +2
+ Misses 340 338 -2
Continue to review full report at Codecov.
|
@@ -4,7 +4,13 @@ set -xe | |||
ADMIN=$(dirname "$0") | |||
PREV=$(pwd) | |||
if [ ! -d $ADMIN/rustfmt ] ; then | |||
git clone --depth 1 https://github.com/rust-lang/rustfmt $ADMIN/rustfmt | |||
COMMIT=8829e455b722f1ba8ade915ad2687639a2abb2c3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment above this about why we're pinning the Rustfmt version: We want to ensure that people submitting PRs and CI agree on what version to use, and we want to limit our exposure to breaking changes in the rust-lang/rustfmt repo.
Further, it seems like we should use a fixed version of Rust Nightly, e.g. +nightly-2021-03-31
to get a consistent build of rustfmt so the script doesn't break when the rust-lang/rust repo is updated.
Further, We need to ensure that that version of Rust Nightly is installed. Note that the runner of this script might not have any version of Rust Nightly installed already, especially if they typically use stable Rust.
@@ -4,7 +4,13 @@ set -xe | |||
ADMIN=$(dirname "$0") | |||
PREV=$(pwd) | |||
if [ ! -d $ADMIN/rustfmt ] ; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like we need to check the actual version of rustfmt stored in $ADMIN/rustfmt to see if it is the version that corresponds to the given commit. In particular, when we update $COMMIT below, this should trigger a re-download and rebuild of the new version of rustfmt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies in advance for this very annoying comment: Bazel would do this as part of its approach. If we're going this route, it might be better to download Bazel and run this script through it, instead of depending on these shell scripts to get this right.
Going to merge this. I don't think there's a lot of value in gold-plating this script, as hopefully it will go away in a future version of rustfmt available via rustup: see rust-lang/rustfmt/pull/4782 and rust-lang/rustfmt/issues/4769 |
Yeah, that's looking great! |
No description provided.