-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: verify rustup checksum in CI (#21637)
* chore: bump rust in CI to 1.52.1
- Loading branch information
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
|
||
RUST_LATEST_VERSION=1.52.1 | ||
# For security, we specify a particular rustup version and a SHA256 hash, computed | ||
# ourselves and hardcoded here. When updating `RUSTUP_LATEST_VERSION`: | ||
# 1. Download the new rustup script from https://github.com/rust-lang/rustup/releases. | ||
# 2. Audit the script and changes to it. You might want to grep for strange URLs... | ||
# 3. Update `OUR_RUSTUP_SHA` with the result of running `sha256sum rustup-init.sh`. | ||
RUSTUP_LATEST_VERSION=1.24.2 | ||
OUR_RUSTUP_SHA="40229562d4fa60e102646644e473575bae22ff56c3a706898a47d7241c9c031e" | ||
|
||
|
||
# Download rustup script | ||
curl --proto '=https' --tlsv1.2 -sSf \ | ||
https://raw.githubusercontent.com/rust-lang/rustup/${RUSTUP_LATEST_VERSION}/rustup-init.sh -O | ||
|
||
# Verify checksum of rustup script. Exit with error if check fails. | ||
echo "${OUR_RUSTUP_SHA} rustup-init.sh" | sha256sum --check -- \ | ||
|| { echo "Checksum problem!"; exit 1; } | ||
|
||
# Run rustup. | ||
sh rustup-init.sh --default-toolchain "$RUST_LATEST_VERSION" -y | ||
export PATH="${HOME}/.cargo/bin:${PATH}" |