Skip to content

Commit 8f38b28

Browse files
Merge branch 'master' into const_cell
2 parents 3ccfc8c + 3f55023 commit 8f38b28

File tree

7,593 files changed

+119596
-71696
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

7,593 files changed

+119596
-71696
lines changed

.github/ISSUE_TEMPLATE/bootstrap.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Describe what you expected to happen.
3232
Describe what actually happened.
3333
-->
3434

35-
### Bootstrap configuration (config.toml)
35+
### Bootstrap configuration (bootstrap.toml)
3636
```toml
3737
<config>
3838
```

.github/workflows/ci.yml

+56-10
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# This file defines our primary CI workflow that runs on pull requests
22
# and also on pushes to special branches (auto, try).
33
#
4-
# The actual definition of the executed jobs is calculated by a Python
5-
# script located at src/ci/github-actions/ci.py, which
4+
# The actual definition of the executed jobs is calculated by the
5+
# `src/ci/citool` crate, which
66
# uses job definition data from src/ci/github-actions/jobs.yml.
77
# You should primarily modify the `jobs.yml` file if you want to modify
88
# what jobs are executed in CI.
@@ -56,7 +56,10 @@ jobs:
5656
- name: Calculate the CI job matrix
5757
env:
5858
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
59-
run: python3 src/ci/github-actions/ci.py calculate-job-matrix >> $GITHUB_OUTPUT
59+
run: |
60+
cd src/ci/citool
61+
CARGO_INCREMENTAL=0 cargo test
62+
CARGO_INCREMENTAL=0 cargo run calculate-job-matrix >> $GITHUB_OUTPUT
6063
id: jobs
6164
job:
6265
name: ${{ matrix.full_name }}
@@ -65,6 +68,9 @@ jobs:
6568
timeout-minutes: 360
6669
env:
6770
CI_JOB_NAME: ${{ matrix.name }}
71+
CI_JOB_DOC_URL: ${{ matrix.doc_url }}
72+
GITHUB_WORKFLOW_RUN_ID: ${{ github.run_id }}
73+
GITHUB_REPOSITORY: ${{ github.repository }}
6874
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
6975
# commit of PR sha or commit sha. `GITHUB_SHA` is not accurate for PRs.
7076
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
@@ -179,9 +185,28 @@ jobs:
179185
- name: show the current environment
180186
run: src/ci/scripts/dump-environment.sh
181187

188+
# Pre-build citool before the following step uninstalls rustup
189+
# Build it into the build directory, to avoid modifying sources
190+
- name: build citool
191+
run: |
192+
cd src/ci/citool
193+
CARGO_INCREMENTAL=0 CARGO_TARGET_DIR=../../../build/citool cargo build
194+
182195
- name: run the build
183-
# Redirect stderr to stdout to avoid reordering the two streams in the GHA logs.
184-
run: src/ci/scripts/run-build-from-ci.sh 2>&1
196+
run: |
197+
set +e
198+
# Redirect stderr to stdout to avoid reordering the two streams in the GHA logs.
199+
src/ci/scripts/run-build-from-ci.sh 2>&1
200+
STATUS=$?
201+
set -e
202+
203+
if [[ "$STATUS" -ne 0 && -n "$CI_JOB_DOC_URL" ]]; then
204+
echo "****************************************************************************"
205+
echo "To find more information about this job, visit the following URL:"
206+
echo "$CI_JOB_DOC_URL"
207+
echo "****************************************************************************"
208+
fi
209+
exit ${STATUS}
185210
env:
186211
AWS_ACCESS_KEY_ID: ${{ env.CACHES_AWS_ACCESS_KEY_ID }}
187212
AWS_SECRET_ACCESS_KEY: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}
@@ -215,16 +240,37 @@ jobs:
215240
# erroring about invalid credentials instead.
216241
if: github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1'
217242

243+
- name: postprocess metrics into the summary
244+
# This step is not critical, and if some I/O problem happens, we don't want
245+
# to cancel the build.
246+
continue-on-error: true
247+
run: |
248+
if [ -f build/metrics.json ]; then
249+
METRICS=build/metrics.json
250+
elif [ -f obj/build/metrics.json ]; then
251+
METRICS=obj/build/metrics.json
252+
else
253+
echo "No metrics.json found"
254+
exit 0
255+
fi
256+
257+
# Get closest bors merge commit
258+
PARENT_COMMIT=`git rev-list --author='bors <bors@rust-lang.org>' -n1 --first-parent HEAD^1`
259+
260+
./build/citool/debug/citool postprocess-metrics \
261+
--job-name ${CI_JOB_NAME} \
262+
--parent ${PARENT_COMMIT} \
263+
${METRICS} >> ${GITHUB_STEP_SUMMARY}
264+
218265
- name: upload job metrics to DataDog
266+
# This step is not critical, and if some I/O problem happens, we don't want
267+
# to cancel the build.
268+
continue-on-error: true
219269
if: needs.calculate_matrix.outputs.run_type != 'pr'
220270
env:
221-
DATADOG_SITE: datadoghq.com
222271
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}
223272
DD_GITHUB_JOB_NAME: ${{ matrix.full_name }}
224-
run: |
225-
cd src/ci
226-
npm ci
227-
python3 scripts/upload-build-metrics.py ../../build/cpu-usage.csv
273+
run: ./build/citool/debug/citool upload-build-metrics build/cpu-usage.csv
228274

229275
# This job isused to tell bors the final status of the build, as there is no practical way to detect
230276
# when a workflow is successful listening to webhooks only in our current bors implementation (homu).

.github/workflows/ghcr.yml

+7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
# Docker Hub has a rate limit, while ghcr.io doesn't.
66
# Those images are pushed to ghcr.io by this job.
77
#
8+
# While Docker Hub rate limit *shouldn't* be an issue on GitHub Actions,
9+
# it certainly is for AWS codebuild.
10+
#
811
# Note that authenticating to DockerHub or other registries isn't possible
912
# for PR jobs, because forks can't access secrets.
1013
# That's why we use ghcr.io: it has no rate limit and it doesn't require authentication.
@@ -54,6 +57,10 @@ jobs:
5457
"ubuntu:22.04"
5558
# Mirrored because used by all linux CI jobs, including mingw-check-tidy
5659
"moby/buildkit:buildx-stable-1"
60+
# Mirrored because used when CI is running inside a Docker container
61+
"alpine:3.4"
62+
# Mirrored because used by dist-x86_64-linux
63+
"centos:7"
5764
)
5865
5966
# Mirror each image from DockerHub to ghcr.io

.github/workflows/post-merge.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Workflow that runs after a merge to master, analyses changes in test executions
2+
# and posts the result to the merged PR.
3+
4+
name: Post merge analysis
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
11+
jobs:
12+
analysis:
13+
runs-on: ubuntu-24.04
14+
if: github.repository == 'rust-lang/rust'
15+
permissions:
16+
pull-requests: write
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
# Make sure that we have enough commits to find the parent merge commit.
21+
# Since all merges should be through merge commits, fetching two commits
22+
# should be enough to get the parent bors merge commit.
23+
fetch-depth: 2
24+
- name: Perform analysis and send PR
25+
env:
26+
GH_TOKEN: ${{ github.token }}
27+
run: |
28+
# Get closest bors merge commit
29+
PARENT_COMMIT=`git rev-list --author='bors <bors@rust-lang.org>' -n1 --first-parent HEAD^1`
30+
echo "Parent: ${PARENT_COMMIT}"
31+
32+
# Find PR for the current commit
33+
HEAD_PR=`gh pr list --search "${{ github.sha }}" --state merged --json number --jq '.[0].number'`
34+
echo "HEAD: ${{ github.sha }} (#${HEAD_PR})"
35+
36+
cd src/ci/citool
37+
38+
printf "<details>\n<summary>What is this?</summary>\n" >> output.log
39+
printf "This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.\n" >> output.log
40+
printf "</details>\n\n" >> output.log
41+
42+
cargo run --release post-merge-report ${PARENT_COMMIT} ${{ github.sha }} >> output.log
43+
44+
cat output.log
45+
46+
gh pr comment ${HEAD_PR} -F output.log

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file should only ignore things that are generated during a `x.py` build,
22
# generated by common IDEs, and optional files controlled by the user that
3-
# affect the build (such as config.toml).
3+
# affect the build (such as bootstrap.toml).
44
# In particular, things like `mir_dump` should not be listed here; they are only
55
# created during manual debugging and many people like to clean up instead of
66
# having git ignore such leftovers. You can use `.git/info/exclude` to
@@ -34,6 +34,7 @@ Session.vim
3434
!/tests/run-make/thumb-none-qemu/example/.cargo
3535

3636
## Configuration
37+
/bootstrap.toml
3738
/config.toml
3839
/Makefile
3940
config.mk
@@ -53,6 +54,7 @@ no_llvm_build
5354
/target
5455
/library/target
5556
/src/bootstrap/target
57+
/src/ci/citool/target
5658
/src/tools/x/target
5759
# Created by `x vendor`
5860
/vendor

.ignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
# Make vscode *not* count `config.toml` as ignored, so it is included in search
1+
# Make vscode *not* count `bootstrap.toml` and `config.toml` as ignored, so it is included in search
2+
!/bootstrap.toml
23
!/config.toml

.mailmap

+3
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@ James Hinshelwood <jameshinshelwood1@gmail.com> <james.hinshelwood@bigpayme.com>
292292
James Miller <bladeon@gmail.com> <james@aatch.net>
293293
James Perry <james.austin.perry@gmail.com>
294294
James Sanderson <zofrex@gmail.com>
295+
Jana Dönszelmann <jana@donsz.nl>
296+
Jana Dönszelmann <jana@donsz.nl> <jonathan@donsz.nl>
297+
Jana Dönszelmann <jana@donsz.nl> <jonabent@gmail.com>
295298
Jan-Erik Rediger <janerik@fnordig.de> <badboy@archlinux.us>
296299
Jaro Fietz <jaro.fietz@gmx.de>
297300
Jason Fager <jfager@gmail.com>

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ For submodules, changes need to be made against the repository corresponding the
1818
submodule, and not the main `rust-lang/rust` repository.
1919

2020
For subtrees, prefer sending a PR against the subtree's repository if it does
21-
not need to be made against the main `rust-lang/rust` repostory (e.g. a
21+
not need to be made against the main `rust-lang/rust` repository (e.g. a
2222
rustc-dev-guide change that does not accompany a compiler change).
2323

2424
## About the [rustc-dev-guide]

0 commit comments

Comments
 (0)