Skip to content

Commit 3288766

Browse files
committed
ci: move mirrors to their standalone bucket
Currently mirrors are stored in the rust-lang-ci2 S3 bucket along with CI toolchains. This is problematic for multiple reasons: - CI IAM credentials are allowed to both edit and delete those files. A malicious user gaining access to those credentials would be able to change our mirrored dependencies, possibly backdooring the compiler. - Contents of the rust-lang-ci2 bucket are disposable except for the mirrors' content. When we implement backups for S3 buckets we'd have to replicate just that part of the bucket, complicating the backup logic and increasing the chance of mistakes. A standalone bucket will be way easier to backup. This commit switches our CI to use the new rust-lang-ci-mirrors bucket.
1 parent 2d2448b commit 3288766

File tree

13 files changed

+25
-23
lines changed

13 files changed

+25
-23
lines changed

src/ci/azure-pipelines/auto.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ jobs:
273273
MSYS_BITS: 32
274274
RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu
275275
SCRIPT: make ci-subset-1
276-
MINGW_URL: https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror
276+
MINGW_URL: https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc
277277
MINGW_ARCHIVE: i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z
278278
MINGW_DIR: mingw32
279279
# FIXME(#59637)
@@ -283,14 +283,14 @@ jobs:
283283
MSYS_BITS: 32
284284
RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu
285285
SCRIPT: make ci-subset-2
286-
MINGW_URL: https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror
286+
MINGW_URL: https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc
287287
MINGW_ARCHIVE: i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z
288288
MINGW_DIR: mingw32
289289
x86_64-mingw-1:
290290
MSYS_BITS: 64
291291
SCRIPT: make ci-subset-1
292292
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu
293-
MINGW_URL: https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror
293+
MINGW_URL: https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc
294294
MINGW_ARCHIVE: x86_64-6.3.0-release-posix-seh-rt_v5-rev2.7z
295295
MINGW_DIR: mingw64
296296
# FIXME(#59637)
@@ -300,7 +300,7 @@ jobs:
300300
MSYS_BITS: 64
301301
SCRIPT: make ci-subset-2
302302
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu
303-
MINGW_URL: https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror
303+
MINGW_URL: https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc
304304
MINGW_ARCHIVE: x86_64-6.3.0-release-posix-seh-rt_v5-rev2.7z
305305
MINGW_DIR: mingw64
306306

@@ -327,7 +327,7 @@ jobs:
327327
MSYS_BITS: 32
328328
RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu --enable-full-tools --enable-profiler
329329
SCRIPT: python x.py dist
330-
MINGW_URL: https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror
330+
MINGW_URL: https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc
331331
MINGW_ARCHIVE: i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z
332332
MINGW_DIR: mingw32
333333
DIST_REQUIRE_ALL_TOOLS: 1
@@ -336,7 +336,7 @@ jobs:
336336
MSYS_BITS: 64
337337
SCRIPT: python x.py dist
338338
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu --enable-full-tools --enable-profiler
339-
MINGW_URL: https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror
339+
MINGW_URL: https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc
340340
MINGW_ARCHIVE: x86_64-6.3.0-release-posix-seh-rt_v5-rev2.7z
341341
MINGW_DIR: mingw64
342342
DIST_REQUIRE_ALL_TOOLS: 1

src/ci/azure-pipelines/steps/install-clang.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ steps:
3636
set -e
3737
mkdir -p citools
3838
cd citools
39-
curl -f https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror/LLVM-7.0.0-win64.tar.gz | tar xzf -
39+
curl -f https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/LLVM-7.0.0-win64.tar.gz | tar xzf -
4040
echo "##vso[task.setvariable variable=RUST_CONFIGURE_ARGS]$RUST_CONFIGURE_ARGS --set llvm.clang-cl=`pwd`/clang-rust/bin/clang-cl.exe"
4141
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['MINGW_URL'],''))
4242
displayName: Install clang (Windows)

src/ci/azure-pipelines/steps/install-sccache.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ steps:
22

33
- bash: |
44
set -e
5-
curl -fo /usr/local/bin/sccache https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror/2018-04-02-sccache-x86_64-apple-darwin
5+
curl -fo /usr/local/bin/sccache https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/2018-04-02-sccache-x86_64-apple-darwin
66
chmod +x /usr/local/bin/sccache
77
displayName: Install sccache (OSX)
88
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
99

1010
- script: |
1111
md sccache
12-
powershell -Command "$ProgressPreference = 'SilentlyContinue'; iwr -outf sccache\sccache.exe https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror/2018-04-26-sccache-x86_64-pc-windows-msvc"
12+
powershell -Command "$ProgressPreference = 'SilentlyContinue'; iwr -outf sccache\sccache.exe https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/2018-04-26-sccache-x86_64-pc-windows-msvc"
1313
echo ##vso[task.prependpath]%CD%\sccache
1414
displayName: Install sccache (Windows)
1515
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))

src/ci/azure-pipelines/steps/install-windows-build-deps.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ steps:
44
# https://github.com/wixtoolset/wix3 originally
55
- bash: |
66
set -e
7-
curl -O https://rust-lang-ci2.s3-us-west-1.amazonaws.com/rust-ci-mirror/wix311-binaries.zip
7+
curl -O https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/wix311-binaries.zip
88
echo "##vso[task.setvariable variable=WIX]`pwd`/wix"
99
mkdir -p wix/bin
1010
cd wix/bin
@@ -18,7 +18,7 @@ steps:
1818
# one is MSI installers and one is EXE, but they're not used so frequently at
1919
# this point anyway so perhaps it's a wash!
2020
- script: |
21-
powershell -Command "$ProgressPreference = 'SilentlyContinue'; iwr -outf is-install.exe https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror/2017-08-22-is.exe"
21+
powershell -Command "$ProgressPreference = 'SilentlyContinue'; iwr -outf is-install.exe https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/2017-08-22-is.exe"
2222
is-install.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-
2323
echo ##vso[task.prependpath]C:\Program Files (x86)\Inno Setup 5
2424
displayName: Install InnoSetup
@@ -109,7 +109,7 @@ steps:
109109
# Note that this is originally from the github releases patch of Ninja
110110
- script: |
111111
md ninja
112-
powershell -Command "$ProgressPreference = 'SilentlyContinue'; iwr -outf 2017-03-15-ninja-win.zip https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror/2017-03-15-ninja-win.zip"
112+
powershell -Command "$ProgressPreference = 'SilentlyContinue'; iwr -outf 2017-03-15-ninja-win.zip https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/2017-03-15-ninja-win.zip"
113113
7z x -oninja 2017-03-15-ninja-win.zip
114114
del 2017-03-15-ninja-win.zip
115115
set RUST_CONFIGURE_ARGS=%RUST_CONFIGURE_ARGS% --enable-ninja

src/ci/docker/armhf-gnu/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ RUN arm-linux-gnueabihf-gcc addentropy.c -o rootfs/addentropy -static
7272

7373
# TODO: What is this?!
7474
# Source of the file: https://github.com/vfdev-5/qemu-rpi2-vexpress/raw/master/vexpress-v2p-ca15-tc1.dtb
75-
RUN curl -O https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror/vexpress-v2p-ca15-tc1.dtb
75+
RUN curl -O https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/vexpress-v2p-ca15-tc1.dtb
7676

7777
COPY scripts/sccache.sh /scripts/
7878
RUN sh /scripts/sccache.sh

src/ci/docker/dist-various-1/install-mips-musl.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ mkdir /usr/local/mips-linux-musl
55
# originally from
66
# https://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/
77
# OpenWrt-Toolchain-ar71xx-generic_gcc-5.3.0_musl-1.1.16.Linux-x86_64.tar.bz2
8-
URL="https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror"
8+
URL="https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc"
99
FILE="OpenWrt-Toolchain-ar71xx-generic_gcc-5.3.0_musl-1.1.16.Linux-x86_64.tar.bz2"
1010
curl -L "$URL/$FILE" | tar xjf - -C /usr/local/mips-linux-musl --strip-components=2
1111

src/ci/docker/dist-various-2/build-wasi-toolchain.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
set -ex
66

77
# Originally from https://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz
8-
curl https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror/clang%2Bllvm-8.0.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz | \
8+
curl https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/clang%2Bllvm-8.0.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz | \
99
tar xJf -
1010
export PATH=`pwd`/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-14.04/bin:$PATH
1111

src/ci/docker/dist-x86_64-linux/build-openssl.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -ex
44
source shared.sh
55

66
VERSION=1.0.2k
7-
URL=https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror/openssl-$VERSION.tar.gz
7+
URL=https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/openssl-$VERSION.tar.gz
88

99
curl $URL | tar xzf -
1010

src/ci/docker/dist-x86_64-netbsd/build-netbsd-toolchain.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ cd netbsd
2525

2626
mkdir -p /x-tools/x86_64-unknown-netbsd/sysroot
2727

28-
URL=https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror
28+
URL=https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc
2929

3030
# Originally from ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-$BSD/source/sets/*.tgz
3131
curl $URL/2018-03-01-netbsd-src.tgz | tar xzf -

src/ci/docker/scripts/android-sdk-manager.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@
2323
HOST_OS = "linux"
2424

2525
# Mirroring options
26-
MIRROR_BUCKET = "rust-lang-ci2"
27-
MIRROR_BASE_DIR = "rust-ci-mirror/android/"
26+
MIRROR_BUCKET = "rust-lang-ci-mirrors"
27+
MIRROR_BUCKET_REGION = "us-west-1"
28+
MIRROR_BASE_DIR = "rustc/android/"
2829

2930
import argparse
3031
import hashlib
@@ -144,7 +145,8 @@ def cli_install(args):
144145
lockfile = Lockfile(args.lockfile)
145146
for package in lockfile.packages.values():
146147
# Download the file from the mirror into a temp file
147-
url = "https://" + MIRROR_BUCKET + ".s3.amazonaws.com/" + MIRROR_BASE_DIR
148+
url = "https://" + MIRROR_BUCKET + ".s3-" + MIRROR_BUCKET_REGION + \
149+
".amazonaws.com/" + MIRROR_BASE_DIR
148150
downloaded = package.download(url)
149151
# Extract the file in a temporary directory
150152
extract_dir = tempfile.mkdtemp()

src/ci/docker/scripts/freebsd-toolchain.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ done
5959

6060
# Originally downloaded from:
6161
# https://download.freebsd.org/ftp/releases/${freebsd_arch}/${freebsd_version}-RELEASE/base.txz
62-
URL=https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror/2019-04-04-freebsd-${freebsd_arch}-${freebsd_version}-RELEASE-base.txz
62+
URL=https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/2019-04-04-freebsd-${freebsd_arch}-${freebsd_version}-RELEASE-base.txz
6363
curl "$URL" | tar xJf - -C "$sysroot" --wildcards "${files_to_extract[@]}"
6464

6565
# Fix up absolute symlinks from the system image. This can be removed

src/ci/docker/scripts/sccache.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set -ex
22

33
curl -fo /usr/local/bin/sccache \
4-
https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror/2018-04-02-sccache-x86_64-unknown-linux-musl
4+
https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/2018-04-02-sccache-x86_64-unknown-linux-musl
55

66
chmod +x /usr/local/bin/sccache

src/ci/install-awscli.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
set -euo pipefail
1717
IFS=$'\n\t'
1818

19-
MIRROR="https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror/2019-07-27-awscli.tar"
19+
MIRROR="https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/2019-07-27-awscli.tar"
2020
DEPS_DIR="/tmp/awscli-deps"
2121

2222
pip="pip"

0 commit comments

Comments
 (0)