Skip to content

Commit 2f16be4

Browse files
committed
Auto merge of #65990 - Centril:rollup-v843h4a, r=Centril
Rollup of 7 pull requests Successful merges: - #65274 (Upload toolstates.json to rust-lang-ci2) - #65434 (Add long error explanation for E0577) - #65850 (Update comments re type parameter hack in object safety) - #65955 (ci: revert msys2 ca-certificates hack) - #65959 (Fix an incorrect docstring for Immediate in librustc_mir/interpret.) - #65979 (Switch CrateMetadata's source_map_import_info from RwLock to Once) - #65981 (work around aggressive syntax feature gating) Failed merges: r? @ghost
2 parents 03d537e + 83000c2 commit 2f16be4

File tree

20 files changed

+197
-151
lines changed

20 files changed

+197
-151
lines changed

src/bootstrap/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,6 +1080,10 @@ impl Build {
10801080
/// done. The file is updated immediately after this function completes.
10811081
pub fn save_toolstate(&self, tool: &str, state: ToolState) {
10821082
if let Some(ref path) = self.config.save_toolstates {
1083+
if let Some(parent) = path.parent() {
1084+
// Ensure the parent directory always exists
1085+
t!(std::fs::create_dir_all(parent));
1086+
}
10831087
let mut file = t!(fs::OpenOptions::new()
10841088
.create(true)
10851089
.read(true)

src/ci/azure-pipelines/auto.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ jobs:
140140
IMAGE: x86_64-gnu-aux
141141
x86_64-gnu-tools:
142142
IMAGE: x86_64-gnu-tools
143+
DEPLOY_TOOLSTATES_JSON: toolstates-linux.json
143144
x86_64-gnu-debug:
144145
IMAGE: x86_64-gnu-debug
145146
x86_64-gnu-nopt:
@@ -262,8 +263,9 @@ jobs:
262263
# MSVC tools tests
263264
x86_64-msvc-tools:
264265
MSYS_BITS: 64
265-
SCRIPT: src/ci/docker/x86_64-gnu-tools/checktools.sh x.py /tmp/toolstates.json windows
266-
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --save-toolstates=/tmp/toolstates.json
266+
SCRIPT: src/ci/docker/x86_64-gnu-tools/checktools.sh x.py /tmp/toolstate/toolstates.json windows
267+
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --save-toolstates=/tmp/toolstate/toolstates.json
268+
DEPLOY_TOOLSTATES_JSON: toolstates-windows.json
267269

268270
# 32/64-bit MinGW builds.
269271
#

src/ci/azure-pipelines/steps/run.yml

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -183,37 +183,21 @@ steps:
183183
condition: and(succeeded(), not(variables.SKIP_JOB))
184184
displayName: Run build
185185

186-
# If we're a deploy builder, use the `aws` command to publish everything to our
187-
# bucket.
188-
- bash: |
189-
set -e
190-
source src/ci/shared.sh
191-
if [ "$AGENT_OS" = "Linux" ]; then
192-
rm -rf obj/build/dist/doc
193-
upload_dir=obj/build/dist
194-
else
195-
rm -rf build/dist/doc
196-
upload_dir=build/dist
197-
fi
198-
ls -la $upload_dir
199-
deploy_dir=rustc-builds
200-
if [ "$DEPLOY_ALT" == "1" ]; then
201-
deploy_dir=rustc-builds-alt
202-
fi
203-
retry aws s3 cp --no-progress --recursive --acl public-read ./$upload_dir s3://$DEPLOY_BUCKET/$deploy_dir/$BUILD_SOURCEVERSION
186+
- bash: src/ci/scripts/upload-artifacts.sh
204187
env:
205188
AWS_ACCESS_KEY_ID: $(UPLOAD_AWS_ACCESS_KEY_ID)
206189
AWS_SECRET_ACCESS_KEY: $(UPLOAD_AWS_SECRET_ACCESS_KEY)
207-
condition: and(succeeded(), not(variables.SKIP_JOB), or(eq(variables.DEPLOY, '1'), eq(variables.DEPLOY_ALT, '1')))
208190
displayName: Upload artifacts
209-
210-
# Upload CPU usage statistics that we've been gathering this whole time. Always
211-
# execute this step in case we want to inspect failed builds, but don't let
212-
# errors here ever fail the build since this is just informational.
213-
- bash: aws s3 cp --acl public-read cpu-usage.csv s3://$DEPLOY_BUCKET/rustc-builds/$BUILD_SOURCEVERSION/cpu-$CI_JOB_NAME.csv
214-
env:
215-
AWS_ACCESS_KEY_ID: $(UPLOAD_AWS_ACCESS_KEY_ID)
216-
AWS_SECRET_ACCESS_KEY: $(UPLOAD_AWS_SECRET_ACCESS_KEY)
217-
condition: variables['UPLOAD_AWS_SECRET_ACCESS_KEY']
218-
continueOnError: true
219-
displayName: Upload CPU usage statistics
191+
# Adding a condition on DEPLOY=1 or DEPLOY_ALT=1 is not needed as all deploy
192+
# builders *should* have the AWS credentials available. Still, explicitly
193+
# adding the condition is helpful as this way CI will not silently skip
194+
# deploying artifacts from a dist builder if the variables are misconfigured,
195+
# erroring about invalid credentials instead.
196+
condition: |
197+
and(
198+
succeeded(), not(variables.SKIP_JOB),
199+
or(
200+
variables.UPLOAD_AWS_SECRET_ACCESS_KEY,
201+
eq(variables.DEPLOY, '1'), eq(variables.DEPLOY_ALT, '1')
202+
)
203+
)

src/ci/docker/run.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ fi
106106
mkdir -p $HOME/.cargo
107107
mkdir -p $objdir/tmp
108108
mkdir -p $objdir/cores
109+
mkdir -p /tmp/toolstate
109110

110111
args=
111112
if [ "$SCCACHE_BUCKET" != "" ]; then
@@ -156,6 +157,7 @@ else
156157
args="$args --volume $objdir:/checkout/obj"
157158
args="$args --volume $HOME/.cargo:/cargo"
158159
args="$args --volume $HOME/rustsrc:$HOME/rustsrc"
160+
args="$args --volume /tmp/toolstate:/tmp/toolstate"
159161
args="$args --env LOCAL_USER_ID=`id -u`"
160162
fi
161163

src/ci/docker/x86_64-gnu-tools/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ ENV CHECK_LINKS 1
2626

2727
ENV RUST_CONFIGURE_ARGS \
2828
--build=x86_64-unknown-linux-gnu \
29-
--save-toolstates=/tmp/toolstates.json
30-
ENV SCRIPT /tmp/checktools.sh ../x.py /tmp/toolstates.json linux
29+
--save-toolstates=/tmp/toolstate/toolstates.json
30+
ENV SCRIPT /tmp/checktools.sh ../x.py /tmp/toolstate/toolstates.json linux

src/ci/docker/x86_64-gnu-tools/checktools.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -eu
44

55
X_PY="$1"
6-
TOOLSTATE_FILE="$(realpath $2)"
6+
TOOLSTATE_FILE="$(realpath -m $2)"
77
OS="$3"
88
COMMIT="$(git rev-parse HEAD)"
99
CHANGED_FILES="$(git diff --name-status HEAD HEAD^)"
@@ -13,6 +13,7 @@ SIX_WEEK_CYCLE="$(( ($(date +%s) / 86400 - 20) % 42 ))"
1313
# The Wednesday after this has value 0.
1414
# We track this value to prevent regressing tools in the last week of the 6-week cycle.
1515

16+
mkdir -p "$(dirname $TOOLSTATE_FILE)"
1617
touch "$TOOLSTATE_FILE"
1718

1819
# Try to test all the tools and store the build/test success in the TOOLSTATE_FILE

src/ci/scripts/install-msys2-packages.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
88
if isWindows; then
99
pacman -S --noconfirm --needed base-devel ca-certificates make diffutils tar
1010

11-
# FIXME(#65767): workaround msys bug, step 2
12-
arch=i686
13-
if [ "$MSYS_BITS" = "64" ]; then
14-
arch=x86_64
15-
fi
16-
pacman -U --noconfirm --noprogressbar mingw-w64-$arch-ca-certificates-20180409-1-any.pkg.tar.xz
17-
rm mingw-w64-$arch-ca-certificates-20180409-1-any.pkg.tar.xz
18-
1911
# Make sure we use the native python interpreter instead of some msys equivalent
2012
# one way or another. The msys interpreters seem to have weird path conversions
2113
# baked in which break LLVM's build system one way or another, so let's use the

src/ci/scripts/install-msys2.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/bin/bash
2-
# ignore-tidy-linelength
32
# Download and install MSYS2, needed primarily for the test suite (run-make) but
43
# also used by the MinGW toolchain for assembling things.
54
#
@@ -13,13 +12,6 @@ IFS=$'\n\t'
1312
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
1413

1514
if isWindows; then
16-
# FIXME(#65767): workaround msys bug, step 1
17-
arch=i686
18-
if [ "$MSYS_BITS" = "64" ]; then
19-
arch=x86_64
20-
fi
21-
curl -O "${MIRRORS_BASE}/msys2-repo/mingw/$arch/mingw-w64-$arch-ca-certificates-20180409-1-any.pkg.tar.xz"
22-
2315
choco install msys2 --params="/InstallDir:${SYSTEM_WORKFOLDER}/msys2 /NoPath" -y --no-progress
2416
mkdir -p "${SYSTEM_WORKFOLDER}/msys2/home/${USERNAME}"
2517

src/ci/scripts/upload-artifacts.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
# Upload all the artifacts to our S3 bucket. All the files inside ${upload_dir}
3+
# will be uploaded to the deploy bucket and eventually signed and released in
4+
# static.rust-lang.org.
5+
6+
set -euo pipefail
7+
IFS=$'\n\t'
8+
9+
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
10+
11+
upload_dir="$(mktemp -d)"
12+
13+
# Release tarballs produced by a dist builder.
14+
if [[ "${DEPLOY-0}" -eq "1" ]] || [[ "${DEPLOY_ALT-0}" -eq "1" ]]; then
15+
dist_dir=build/dist
16+
if isLinux; then
17+
dist_dir=obj/build/dist
18+
fi
19+
rm -rf "${dist_dir}/doc"
20+
cp -r "${dist_dir}"/* "${upload_dir}"
21+
fi
22+
23+
# CPU usage statistics.
24+
cp cpu-usage.csv "${upload_dir}/cpu-${CI_JOB_NAME}.csv"
25+
26+
# Toolstate data.
27+
if [[ -n "${DEPLOY_TOOLSTATES_JSON+x}" ]]; then
28+
cp /tmp/toolstate/toolstates.json "${upload_dir}/${DEPLOY_TOOLSTATES_JSON}"
29+
fi
30+
31+
echo "Files that will be uploaded:"
32+
ls -lah "${upload_dir}"
33+
echo
34+
35+
deploy_dir="rustc-builds"
36+
if [[ "${DEPLOY_ALT-0}" -eq "1" ]]; then
37+
deploy_dir="rustc-builds-alt"
38+
fi
39+
deploy_url="s3://${DEPLOY_BUCKET}/${deploy_dir}/$(ciCommit)"
40+
41+
retry aws s3 cp --no-progress --recursive --acl public-read "${upload_dir}" "${deploy_url}"

src/ci/shared.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ function getCIBranch {
4646
echo "$BUILD_SOURCEBRANCHNAME"
4747
}
4848

49+
function ciCommit {
50+
echo "${BUILD_SOURCEVERSION}"
51+
}
52+
4953
function ciCommandAddPath {
5054
if [[ $# -ne 1 ]]; then
5155
echo "usage: $0 <path>"

0 commit comments

Comments
 (0)