Skip to content

Commit dd0a32b

Browse files
committed
Backfill MAJOR.MINOR Rustup channel manifests
Now that rust-lang/rust#76107 has been merged, new releases will also write their manifests to channel-rust-1.x.toml as well as channel-rust-1.x.y.toml to enable `rustup install 1.48` to get the latest patch release in a minor release series. This commit adds an idempotent script to copy manifests and their signatures for the last patch release in every minor release series to the corresponding minor manifest files so that past minor versions will work with the rustup functionality too. This script should only need to be run once, but should be safe to run more than once. It starts at 1.8 because we don't have manifests for 1.0-1.7, and it ends with 1.47 because 1.48 will be the first stable release to write out the 1.x channel manifest.
1 parent 23dfbf6 commit dd0a32b

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

bin/backfill-manifests.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
secrets=/data/secrets.toml
5+
6+
declare minor_versions_with_patch_releases
7+
8+
minor_versions_with_patch_releases[12]=1
9+
minor_versions_with_patch_releases[15]=1
10+
minor_versions_with_patch_releases[22]=1
11+
minor_versions_with_patch_releases[24]=1
12+
minor_versions_with_patch_releases[26]=2
13+
minor_versions_with_patch_releases[27]=2
14+
minor_versions_with_patch_releases[29]=2
15+
minor_versions_with_patch_releases[30]=1
16+
minor_versions_with_patch_releases[31]=1
17+
minor_versions_with_patch_releases[34]=2
18+
minor_versions_with_patch_releases[41]=1
19+
minor_versions_with_patch_releases[43]=1
20+
minor_versions_with_patch_releases[44]=1
21+
minor_versions_with_patch_releases[45]=2
22+
23+
export AWS_ACCESS_KEY_ID="$(tq dist.aws-access-key-id < $secrets)"
24+
export AWS_SECRET_ACCESS_KEY="$(tq dist.aws-secret-key < $secrets)"
25+
26+
bucket="$(tq dist.upload-bucket < $secrets)"
27+
dir="$(tq dist.upload-dir < $secrets)"
28+
29+
for minor in {8..47}
30+
do
31+
if [ ${minor_versions_with_patch_releases[$minor]+_} ]; then
32+
last_patch=${minor_versions_with_patch_releases[$minor]};
33+
else
34+
last_patch=0;
35+
fi
36+
37+
src="s3://${bucket}/${dir}/channel-rust-1.${minor}.${last_patch}.toml"
38+
dst="s3://${bucket}/${dir}/channel-rust-1.${minor}.toml"
39+
40+
aws cp --only-show-errors "${src}" "${dst}"
41+
aws cp --only-show-errors "${src}".asc "${dst}".asc
42+
aws cp --only-show-errors "${src}".sha256 "${dst}".sha256
43+
done

0 commit comments

Comments
 (0)