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

[ci] Roll pinned nightly toolchain automatically #408

Merged
merged 1 commit into from Sep 27, 2023

Conversation

joshlf
Copy link
Member

@joshlf joshlf commented Sep 21, 2023

Rolling nightly toolchain works. Blocked on #412 in order to support rolling stable toolchain.

@joshlf joshlf force-pushed the roll-nightly-github-action branch 7 times, most recently from 214f020 to 6504d1c Compare September 21, 2023 15:42
@joshlf joshlf marked this pull request as draft September 21, 2023 17:16
@joshlf joshlf force-pushed the roll-nightly-github-action branch 12 times, most recently from 62581c1 to b19affc Compare September 21, 2023 22:54
@joshlf joshlf changed the base branch from main to testutil September 21, 2023 22:55
@joshlf joshlf force-pushed the roll-nightly-github-action branch 3 times, most recently from 3509cf2 to bcae814 Compare September 21, 2023 23:32
@joshlf joshlf marked this pull request as ready for review September 21, 2023 23:45
@joshlf joshlf requested a review from jswrenn September 21, 2023 23:45
@joshlf
Copy link
Member Author

joshlf commented Sep 21, 2023

@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.

Base automatically changed from testutil to main September 22, 2023 16:56
@joshlf joshlf force-pushed the roll-nightly-github-action branch 3 times, most recently from 2a08ba5 to 097698b Compare September 23, 2023 02:18
@joshlf joshlf force-pushed the roll-nightly-github-action branch 2 times, most recently from 4e279bc to 15ad251 Compare September 27, 2023 04:06
name: Roll pinned toolchain versions
on:
schedule:
- cron: '29 12 * * *'
Copy link
Collaborator

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.

Copy link
Member Author

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.

Comment on lines +54 to +75
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
}
Copy link
Collaborator

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah good idea!

@joshlf joshlf merged commit 251f946 into main Sep 27, 2023
151 checks passed
@joshlf joshlf deleted the roll-nightly-github-action branch September 27, 2023 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants