-
Notifications
You must be signed in to change notification settings - Fork 733
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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. 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. |
||
cd $ADMIN | ||
git init rustfmt | ||
cd rustfmt | ||
git fetch --depth=1 https://github.com/rust-lang/rustfmt $COMMIT | ||
git checkout $COMMIT | ||
cd ../.. | ||
fi | ||
|
||
if [ ! -x $ADMIN/rustfmt/target/release/cargo-fmt ] ; 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.
Uh oh!
There was an error while loading. Please reload this page.
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.