Skip to content

Commit 5abee91

Browse files
authored
Merge branch 'master' into fix-build-err-autodiff-libs
2 parents ca85a3e + 66678e6 commit 5abee91

File tree

7,000 files changed

+102831
-64892
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,000 files changed

+102831
-64892
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 10 deletions
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,7 @@ jobs:
6568
timeout-minutes: 360
6669
env:
6770
CI_JOB_NAME: ${{ matrix.name }}
71+
CI_JOB_DOC_URL: ${{ matrix.doc_url }}
6872
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
6973
# commit of PR sha or commit sha. `GITHUB_SHA` is not accurate for PRs.
7074
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
@@ -179,9 +183,28 @@ jobs:
179183
- name: show the current environment
180184
run: src/ci/scripts/dump-environment.sh
181185

186+
# Pre-build citool before the following step uninstalls rustup
187+
# Build it into the build directory, to avoid modifying sources
188+
- name: build citool
189+
run: |
190+
cd src/ci/citool
191+
CARGO_INCREMENTAL=0 CARGO_TARGET_DIR=../../../build/citool cargo build
192+
182193
- 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
194+
run: |
195+
set +e
196+
# Redirect stderr to stdout to avoid reordering the two streams in the GHA logs.
197+
src/ci/scripts/run-build-from-ci.sh 2>&1
198+
STATUS=$?
199+
set -e
200+
201+
if [[ "$STATUS" -ne 0 && -n "$CI_JOB_DOC_URL" ]]; then
202+
echo "****************************************************************************"
203+
echo "To find more information about this job, visit the following URL:"
204+
echo "$CI_JOB_DOC_URL"
205+
echo "****************************************************************************"
206+
fi
207+
exit ${STATUS}
185208
env:
186209
AWS_ACCESS_KEY_ID: ${{ env.CACHES_AWS_ACCESS_KEY_ID }}
187210
AWS_SECRET_ACCESS_KEY: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}
@@ -215,16 +238,22 @@ jobs:
215238
# erroring about invalid credentials instead.
216239
if: github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1'
217240

241+
- name: postprocess metrics into the summary
242+
run: |
243+
if [ -f build/metrics.json ]; then
244+
./build/citool/debug/citool postprocess-metrics build/metrics.json ${GITHUB_STEP_SUMMARY}
245+
elif [ -f obj/build/metrics.json ]; then
246+
./build/citool/debug/citool postprocess-metrics obj/build/metrics.json ${GITHUB_STEP_SUMMARY}
247+
else
248+
echo "No metrics.json found"
249+
fi
250+
218251
- name: upload job metrics to DataDog
219252
if: needs.calculate_matrix.outputs.run_type != 'pr'
220253
env:
221-
DATADOG_SITE: datadoghq.com
222254
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}
223255
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
256+
run: ./build/citool/debug/citool upload-build-metrics build/cpu-usage.csv
228257

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

.github/workflows/post-merge.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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 <[email protected]>' -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 "*This is an experimental post-merge analysis report. You can ignore it.*\n\n" > output.log
39+
printf "<details>\n<summary>Post-merge report</summary>\n\n" >> output.log
40+
41+
cargo run --release post-merge-report ${PARENT_COMMIT} ${{ github.sha }} >> output.log
42+
43+
printf "</details>\n" >> output.log
44+
45+
cat output.log
46+
47+
gh pr comment ${HEAD_PR} -F output.log

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ no_llvm_build
5353
/target
5454
/library/target
5555
/src/bootstrap/target
56+
/src/ci/citool/target
5657
/src/tools/x/target
5758
# Created by `x vendor`
5859
/vendor

.mailmap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@ James Hinshelwood <[email protected]> <[email protected]>
292292
293293
James Perry <[email protected]>
294294
James Sanderson <[email protected]>
295+
Jana Dönszelmann <[email protected]>
296+
297+
295298
296299
Jaro Fietz <[email protected]>
297300
Jason Fager <[email protected]>

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
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)