Skip to content

Commit c9b96fe

Browse files
committed
Remove override for rustup version
The override feature for the rustup version has been removed, since the version seems to be hardcoded in the binary as well. So it was possible to change the path where the artifacts were stored in S3, but using the version to verify that rustup got updated wasn't possible.
1 parent af7e298 commit c9b96fe

File tree

4 files changed

+17
-30
lines changed

4 files changed

+17
-30
lines changed

Diff for: .github/workflows/ci.yml

+14-4
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@ jobs:
6565
name: Local rustup
6666
runs-on: ubuntu-latest
6767

68-
env:
69-
RUSTUP_OVERRIDE_VERSION: 99.0.0
70-
7168
strategy:
7269
fail-fast: false
7370
matrix:
@@ -80,6 +77,9 @@ jobs:
8077
- name: Ensure Rust Stable is up to date
8178
run: rustup self update && rustup update stable
8279

80+
- name: Get the current rustup version
81+
run: echo "PREVIOUS_RUSTUP_VERSION=$(rustup --version | cut -d ' ' -f 2)" >> $GITHUB_ENV
82+
8383
- name: Start the local environment
8484
run: docker compose up -d
8585

@@ -91,8 +91,18 @@ jobs:
9191
env:
9292
RUSTUP_UPDATE_ROOT: http://localhost:9000/static/rustup
9393

94+
- name: Get the new rustup version
95+
run: echo "NEW_RUSTUP_VERSION=$(rustup --version | cut -d ' ' -f 2)" >> $GITHUB_ENV
96+
9497
- name: Verify Rustup version
95-
run: rustup --version | grep -q ${{ env.RUSTUP_OVERRIDE_VERSION }}
98+
run: |
99+
if [[ "${PREVIOUS_RUSTUP_VERSION}" == "${NEW_RUSTUP_VERSION}" ]]; then
100+
echo "Rustup version did not change"
101+
exit 1
102+
else
103+
echo "Previous Rustup version: ${PREVIOUS_RUSTUP_VERSION}"
104+
echo "New Rustup version: ${NEW_RUSTUP_VERSION}"
105+
fi
96106
97107
docker:
98108
name: Build Docker image

Diff for: local/rustup.sh

-5
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,5 @@ if [[ "${override_commit}" != "" ]]; then
107107
export PROMOTE_RELEASE_OVERRIDE_COMMIT="${override_commit}"
108108
fi
109109

110-
# Conditionally set a version for the next Rustup release
111-
if [[ "${RUSTUP_OVERRIDE_VERSION:-}" != "" ]]; then
112-
export PROMOTE_RELEASE_RUSTUP_OVERRIDE_VERSION="${RUSTUP_OVERRIDE_VERSION}"
113-
fi
114-
115110
echo "==> starting promote-release"
116111
/src/target/release/promote-release /persistent/release "${channel}"

Diff for: run.sh

+2-10
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
set -euo pipefail
66
IFS=$'\n\t'
77

8-
RUSTUP_OVERRIDE_VERSION="${RUSTUP_OVERRIDE_VERSION:-}"
9-
108
if [[ "$#" -lt 1 ]]; then
119
echo "Usage: $0 <release|rustup>"
1210
exit 1
@@ -50,11 +48,5 @@ if [[ "$(uname)" == "Linux" ]]; then
5048
cargo build --release
5149
fi
5250

53-
if [[ "$RUSTUP_OVERRIDE_VERSION" != "" ]]; then
54-
# If the RUSTUP_OVERRIDE_VERSION environment variable is set, forward it to the Docker environment.
55-
echo "==> running local release with override version ${RUSTUP_OVERRIDE_VERSION}"
56-
docker compose exec -e "RUSTUP_OVERRIDE_VERSION=${RUSTUP_OVERRIDE_VERSION}" -T local "/src/local/${command}.sh" "${channel}" "${override_commit}"
57-
else
58-
# Run the command inside the docker environment.
59-
docker compose exec -T local "/src/local/${command}.sh" "${channel}" "${override_commit}"
60-
fi
51+
# Run the command inside the docker environment.
52+
docker compose exec -T local "/src/local/${command}.sh" "${channel}" "${override_commit}"

Diff for: src/rustup.rs

+1-11
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl Context {
6161
let head_sha = self.get_commit_sha_for_rustup_release()?;
6262

6363
// The commit on the `stable` branch is used to determine the version number
64-
let version = self.get_next_rustup_version(&head_sha)?;
64+
let version = self.get_next_rustup_version_from_github(&head_sha)?;
6565

6666
// Download the Rustup artifacts from S3
6767
let dist_dir = self.download_rustup_artifacts(&head_sha)?;
@@ -115,16 +115,6 @@ impl Context {
115115
Ok(commit.sha)
116116
}
117117

118-
fn get_next_rustup_version(&self, sha: &str) -> anyhow::Result<String> {
119-
// Allow the version to be overridden manually, for example to test the release process
120-
if let Ok(version) = std::env::var("PROMOTE_RELEASE_RUSTUP_OVERRIDE_VERSION") {
121-
println!("Using override version: {}", version);
122-
Ok(version)
123-
} else {
124-
self.get_next_rustup_version_from_github(sha)
125-
}
126-
}
127-
128118
fn get_next_rustup_version_from_github(&self, sha: &str) -> anyhow::Result<String> {
129119
println!("Getting next Rustup version from Cargo.toml...");
130120

0 commit comments

Comments
 (0)