Skip to content

Commit 08d092c

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 08d092c

File tree

4 files changed

+19
-30
lines changed

4 files changed

+19
-30
lines changed

Diff for: .github/workflows/ci.yml

+16-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,10 @@ 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+
id: previous-rustup-version
82+
run: echo "PREVIOUS_RUSTUP_VERSION=$(rustup --version | cut -d ' ' -f 2)" >> $GITHUB_ENV
83+
8384
- name: Start the local environment
8485
run: docker compose up -d
8586

@@ -91,8 +92,19 @@ jobs:
9192
env:
9293
RUSTUP_UPDATE_ROOT: http://localhost:9000/static/rustup
9394

95+
- name: Get the new rustup version
96+
id: new-rustup-version
97+
run: echo "NEW_RUSTUP_VERSION=$(rustup --version | cut -d ' ' -f 2)" >> $GITHUB_ENV
98+
9499
- name: Verify Rustup version
95-
run: rustup --version | grep -q ${{ env.RUSTUP_OVERRIDE_VERSION }}
100+
run: |
101+
if [ "${{ steps.previous-rustup-version.outputs.PREVIOUS_RUSTUP_VERSION }}" == "${{ steps.new-rustup-version.outputs.NEW_RUSTUP_VERSION }}" ]; then
102+
echo "Rustup version did not change"
103+
exit 1
104+
else
105+
echo "Previous Rustup version: ${{ steps.previous-rustup-version.outputs.PREVIOUS_RUSTUP_VERSION }}"
106+
echo "New Rustup version: ${{ steps.new-rustup-version.outputs.NEW_RUSTUP_VERSION }}"
107+
fi
96108
97109
docker:
98110
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)