-
Notifications
You must be signed in to change notification settings - Fork 94
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
[ci] Roll pinned nightly toolchain automatically #408
Conversation
214f020
to
6504d1c
Compare
62581c1
to
b19affc
Compare
3509cf2
to
bcae814
Compare
bcae814
to
e5c6363
Compare
@jswrenn This is ready for review mod outstanding comments, which are minor and mechanical. If you approve, I'll only make changes as described in those comments. |
2a08ba5
to
097698b
Compare
4e279bc
to
15ad251
Compare
15ad251
to
b652457
Compare
name: Roll pinned toolchain versions | ||
on: | ||
schedule: | ||
- cron: '29 12 * * *' |
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.
What's the rationale for running this at 12:29? Seems like an oddly specific time, so if there's a rationale here, I'd be curious to hear it.
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.
Partially copy-pasted from another file. The 12 (UTC) is chosen so it runs in the middle of the night for those in the US and produces PRs which have already run through CI by the morning.
function update-pinned-version { | ||
VERSION_NAME="$1" | ||
VERSION="$2" | ||
# For nightly, this is the same as `$VERSION`. For stable, it's | ||
# `stable` because `rustup` doesn't recognize that `x.y.z` refers to | ||
# the same thing as `stable` even if they're the same toolchain. | ||
VERSION_FOR_CARGO="$3" | ||
ZEROCOPY_FEATURES="$4" | ||
|
||
# Confirm that `Cargo.toml` lists the pinned version in the expected | ||
# format. This is a prerequisite for the subsequent `sed` command. | ||
REGEX="^pinned-$VERSION_NAME = \"[a-z0-9\.-]*\"$" | ||
validate-file "$REGEX" Cargo.toml | ||
sed -i -e "s/$REGEX/pinned-$VERSION_NAME = \"$VERSION\"/" Cargo.toml | ||
|
||
# Confirm that the update didn't bork `Cargo.toml`. | ||
validate-file "$REGEX" Cargo.toml | ||
|
||
# Update `.stderr` files as needed for the new version. | ||
TRYBUILD=overwrite cargo "+$VERSION_FOR_CARGO" test --package zerocopy $ZEROCOPY_FEATURES | ||
TRYBUILD=overwrite cargo "+$VERSION_FOR_CARGO" test --package zerocopy-derive | ||
} |
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.
Once the cargo script work is stabilized, it might be a tad more robust to use toml_edit
for this.
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.
Ah good idea!
Rolling nightly toolchain works. Blocked on #412 in order to support rolling stable toolchain.