Skip to content

Commit 6a69760

Browse files
authored
Merge branch 'rust-lang:master' into master
2 parents 31e35cd + 70b3f46 commit 6a69760

File tree

18,173 files changed

+487030
-328189
lines changed

Some content is hidden

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

18,173 files changed

+487030
-328189
lines changed

.editorconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ end_of_line = lf
99
charset = utf-8
1010
trim_trailing_whitespace = true
1111
insert_final_newline = true
12+
13+
[!src/llvm-project]
1214
indent_style = space
1315
indent_size = 4
1416

.git-blame-ignore-revs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,7 @@ ec2cc761bc7067712ecc7734502f703fe3b024c8
2929
99cb0c6bc399fb94a0ddde7e9b38e9c00d523bad
3030
# reformat with rustfmt edition 2024
3131
c682aa162b0d41e21cc6748f4fecfe01efb69d1f
32+
# reformat with updated edition 2024
33+
1fcae03369abb4c2cc180cd5a49e1f4440a81300
34+
# Breaking up of compiletest runtest.rs
35+
60600a6fa403216bfd66e04f948b1822f6450af7

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*.h rust
66
*.rs rust diff=rust
77
*.fixed linguist-language=Rust
8+
*.pp linguist-language=Rust
89
*.mir linguist-language=Rust
910
src/etc/installer/gfx/* binary
1011
src/vendor/** -text

.github/ISSUE_TEMPLATE/bootstrap.md

Lines changed: 1 addition & 1 deletion
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/ISSUE_TEMPLATE/library_tracking_issue.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Library Tracking Issue
33
about: A tracking issue for an unstable library feature.
44
title: Tracking Issue for XXX
5-
labels: C-tracking-issue, T-libs-api
5+
labels: C-tracking-issue, T-libs-api, S-tracking-unimplemented
66
---
77
<!--
88
Thank you for creating a tracking issue!
@@ -49,6 +49,8 @@ For larger features, more steps might be involved.
4949
If the feature is changed later, please add those PRs here as well.
5050
-->
5151

52+
(Remember to update the `S-tracking-*` label when checking boxes.)
53+
5254
- [ ] Implementation: #...
5355
- [ ] Final comment period (FCP)[^1]
5456
- [ ] Stabilization PR

.github/ISSUE_TEMPLATE/tracking_issue.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ for larger features an implementation could be broken up into multiple PRs.
4141
- [ ] Implement the RFC (cc @rust-lang/XXX -- can anyone write up mentoring
4242
instructions?)
4343
- [ ] Adjust documentation ([see instructions on rustc-dev-guide][doc-guide])
44-
- [ ] Formatting for new syntax has been added to the [Style Guide] ([nightly-style-procedure])
44+
- [ ] Style updates for any new syntax ([nightly-style-procedure])
45+
- [ ] Style team decision on new formatting
46+
- [ ] Formatting for new syntax has been added to the [Style Guide]
47+
- [ ] (non-blocking) Formatting has been implemented in `rustfmt`
4548
- [ ] Stabilization PR ([see instructions on rustc-dev-guide][stabilization-guide])
4649

4750
[stabilization-guide]: https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#stabilization-pr
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
name: Future Incompatibility Tracking Issue
3+
about: A tracking issue for a future-incompatible lint
4+
title: Tracking Issue for future-incompatibility lint XXX
5+
labels: C-tracking-issue C-future-incompatibility T-compiler A-lints
6+
---
7+
<!--
8+
Thank you for creating a future-incompatible tracking issue! 📜 These issues
9+
are for lints that implement a future-incompatible warning.
10+
11+
Remember to add team labels to the tracking issue.
12+
For something that affects the language, this would be `T-lang`, and for libs
13+
it would be `T-libs-api`.
14+
Also check for any `A-` labels to add.
15+
-->
16+
17+
This is the **tracking issue** for the `YOUR_LINT_NAME_HERE` future-compatibility warning and other related errors. The goal of this page is describe why this change was made and how you can fix code that is affected by it. It also provides a place to ask questions or register a complaint if you feel the change should not be made. For more information on the policy around future-compatibility warnings, see our [breaking change policy guidelines][guidelines].
18+
19+
[guidelines]: https://rustc-dev-guide.rust-lang.org/bug-fix-procedure.html
20+
21+
### What is the warning for?
22+
23+
*Describe the conditions that trigger the warning.*
24+
25+
### Why was this change made?
26+
27+
*Explain why this change was made. If there is additional context, like an MCP, link it here.*
28+
29+
### Example
30+
31+
```rust
32+
// Include an example here.
33+
```
34+
35+
### Recommendations
36+
37+
*Give some recommendations on how a user can avoid the lint.*
38+
39+
### When will this warning become a hard error?
40+
41+
*If known, describe the future plans. For example, how long you anticipate this being a warning, or if there are other factors that will influence the anticipated closure.*
42+
43+
### Steps
44+
45+
- [ ] Implement the lint
46+
- [ ] Raise lint level to deny
47+
- [ ] Make lint report in dependencies
48+
- [ ] Switch to a hard error
49+
50+
### Implementation history
51+
52+
<!--
53+
Include a list of all the PRs that were involved in implementing the lint.
54+
-->

.github/workflows/ci.yml

Lines changed: 95 additions & 37 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.
@@ -34,7 +34,7 @@ concurrency:
3434
# For a given workflow, if we push to the same branch, cancel all previous builds on that branch.
3535
# We add an exception for try builds (try branch) and unrolled rollup builds (try-perf), which
3636
# are all triggered on the same branch, but which should be able to run concurrently.
37-
group: ${{ github.workflow }}-${{ ((github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.sha) || github.ref }}
37+
group: ${{ github.workflow }}-${{ ((github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try') && github.sha) || github.ref }}
3838
cancel-in-progress: true
3939
env:
4040
TOOLSTATE_REPO: "https://github.com/rust-lang-nursery/rust-toolstate"
@@ -53,48 +53,62 @@ jobs:
5353
steps:
5454
- name: Checkout the source code
5555
uses: actions/checkout@v4
56+
# Cache citool to make its build faster, as it's in the critical path.
57+
# The rust-cache doesn't bleed into the main `job`, so it should not affect any other
58+
# Rust compilation.
59+
- name: Cache citool
60+
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
61+
with:
62+
workspaces: src/ci/citool
5663
- name: Calculate the CI job matrix
5764
env:
5865
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
59-
run: python3 src/ci/github-actions/ci.py calculate-job-matrix >> $GITHUB_OUTPUT
66+
run: |
67+
cd src/ci/citool
68+
CARGO_INCREMENTAL=0 cargo test
69+
CARGO_INCREMENTAL=0 cargo run calculate-job-matrix >> $GITHUB_OUTPUT
6070
id: jobs
6171
job:
6272
name: ${{ matrix.full_name }}
6373
needs: [ calculate_matrix ]
6474
runs-on: "${{ matrix.os }}"
65-
defaults:
66-
run:
67-
shell: ${{ contains(matrix.os, 'windows') && 'msys2 {0}' || 'bash' }}
6875
timeout-minutes: 360
76+
# The bors environment contains secrets required for elevated workflows (try and auto builds),
77+
# which need to access e.g. S3 and upload artifacts. We want to provide access to that
78+
# environment only on the try/auto branches, which are only accessible to bors.
79+
# This also ensures that PR CI (which doesn't get write access to S3) works, as it cannot
80+
# access the environment.
81+
#
82+
# We only enable the environment for the rust-lang/rust repository, so that CI works on forks.
83+
environment: ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try' || github.ref == 'refs/heads/auto')) && 'bors') || '' }}
6984
env:
7085
CI_JOB_NAME: ${{ matrix.name }}
86+
CI_JOB_DOC_URL: ${{ matrix.doc_url }}
87+
GITHUB_WORKFLOW_RUN_ID: ${{ github.run_id }}
88+
GITHUB_REPOSITORY: ${{ github.repository }}
7189
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
7290
# commit of PR sha or commit sha. `GITHUB_SHA` is not accurate for PRs.
7391
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
7492
DOCKER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7593
SCCACHE_BUCKET: rust-lang-ci-sccache2
94+
SCCACHE_REGION: us-west-1
7695
CACHE_DOMAIN: ci-caches.rust-lang.org
7796
continue-on-error: ${{ matrix.continue_on_error || false }}
7897
strategy:
7998
matrix:
8099
# Check the `calculate_matrix` job to see how is the matrix defined.
81100
include: ${{ fromJSON(needs.calculate_matrix.outputs.jobs) }}
82101
steps:
83-
- if: contains(matrix.os, 'windows')
84-
uses: msys2/[email protected]
85-
with:
86-
# i686 jobs use mingw32. x86_64 and cross-compile jobs use mingw64.
87-
msystem: ${{ contains(matrix.name, 'i686') && 'mingw32' || 'mingw64' }}
88-
# don't try to download updates for already installed packages
89-
update: false
90-
# don't try to use the msys that comes built-in to the github runner,
91-
# so we can control what is installed (i.e. not python)
92-
release: true
93-
# Inherit the full path from the Windows environment, with MSYS2's */bin/
94-
# dirs placed in front. This lets us run Windows-native Python etc.
95-
path-type: inherit
96-
install: >
97-
make
102+
- name: Install cargo in AWS CodeBuild
103+
if: matrix.codebuild
104+
run: |
105+
# Check if cargo is installed
106+
if ! command -v cargo &> /dev/null; then
107+
echo "Cargo not found, installing Rust..."
108+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal
109+
# Make cargo available in PATH
110+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
111+
fi
98112
99113
- name: disable git crlf conversion
100114
run: git config --global core.autocrlf false
@@ -109,7 +123,7 @@ jobs:
109123
# intensive jobs to run on free runners, which however also have
110124
# less disk space.
111125
- name: free up disk space
112-
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
126+
run: src/ci/scripts/free-disk-space.sh
113127
if: matrix.free_disk
114128

115129
# Rust Log Analyzer can't currently detect the PR number of a GitHub
@@ -130,9 +144,6 @@ jobs:
130144
# which then uses log commands to actually set them.
131145
EXTRA_VARIABLES: ${{ toJson(matrix.env) }}
132146

133-
- name: setup upstream remote
134-
run: src/ci/scripts/setup-upstream-remote.sh
135-
136147
- name: ensure the channel matches the target branch
137148
run: src/ci/scripts/verify-channel.sh
138149

@@ -173,6 +184,8 @@ jobs:
173184
run: src/ci/scripts/install-ninja.sh
174185

175186
- name: enable ipv6 on Docker
187+
# Don't run on codebuild because systemctl is not available
188+
if: ${{ !matrix.codebuild }}
176189
run: src/ci/scripts/enable-docker-ipv6.sh
177190

178191
# Disable automatic line ending conversion (again). On Windows, when we're
@@ -192,12 +205,36 @@ jobs:
192205
- name: ensure the stable version number is correct
193206
run: src/ci/scripts/verify-stable-version-number.sh
194207

208+
# Show the environment just before we run the build
209+
# This makes it easier to diagnose problems with the above install scripts.
210+
- name: show the current environment
211+
run: src/ci/scripts/dump-environment.sh
212+
213+
# Pre-build citool before the following step uninstalls rustup
214+
# Build it into the build directory, to avoid modifying sources
215+
- name: build citool
216+
run: |
217+
cd src/ci/citool
218+
CARGO_INCREMENTAL=0 CARGO_TARGET_DIR=../../../build/citool cargo build
219+
195220
- name: run the build
196-
# Redirect stderr to stdout to avoid reordering the two streams in the GHA logs.
197-
run: src/ci/scripts/run-build-from-ci.sh 2>&1
221+
run: |
222+
set +e
223+
# Redirect stderr to stdout to avoid reordering the two streams in the GHA logs.
224+
src/ci/scripts/run-build-from-ci.sh 2>&1
225+
STATUS=$?
226+
set -e
227+
228+
if [[ "$STATUS" -ne 0 && -n "$CI_JOB_DOC_URL" ]]; then
229+
echo "****************************************************************************"
230+
echo "To find more information about this job, visit the following URL:"
231+
echo "$CI_JOB_DOC_URL"
232+
echo "****************************************************************************"
233+
fi
234+
exit ${STATUS}
198235
env:
199-
AWS_ACCESS_KEY_ID: ${{ env.CACHES_AWS_ACCESS_KEY_ID }}
200-
AWS_SECRET_ACCESS_KEY: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}
236+
AWS_ACCESS_KEY_ID: ${{ secrets.CACHES_AWS_ACCESS_KEY_ID }}
237+
AWS_SECRET_ACCESS_KEY: ${{ secrets.CACHES_AWS_SECRET_ACCESS_KEY }}
201238

202239
- name: create github artifacts
203240
run: src/ci/scripts/create-doc-artifacts.sh
@@ -219,25 +256,46 @@ jobs:
219256
- name: upload artifacts to S3
220257
run: src/ci/scripts/upload-artifacts.sh
221258
env:
222-
AWS_ACCESS_KEY_ID: ${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}
223-
AWS_SECRET_ACCESS_KEY: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}
259+
AWS_ACCESS_KEY_ID: ${{ secrets.ARTIFACTS_AWS_ACCESS_KEY_ID }}
260+
AWS_SECRET_ACCESS_KEY: ${{ secrets.ARTIFACTS_AWS_SECRET_ACCESS_KEY }}
224261
# Adding a condition on DEPLOY=1 or DEPLOY_ALT=1 is not needed as all deploy
225262
# builders *should* have the AWS credentials available. Still, explicitly
226263
# adding the condition is helpful as this way CI will not silently skip
227264
# deploying artifacts from a dist builder if the variables are misconfigured,
228265
# erroring about invalid credentials instead.
229266
if: github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1'
230267

268+
- name: postprocess metrics into the summary
269+
# This step is not critical, and if some I/O problem happens, we don't want
270+
# to cancel the build.
271+
continue-on-error: true
272+
run: |
273+
if [ -f build/metrics.json ]; then
274+
METRICS=build/metrics.json
275+
elif [ -f obj/build/metrics.json ]; then
276+
METRICS=obj/build/metrics.json
277+
else
278+
echo "No metrics.json found"
279+
exit 0
280+
fi
281+
282+
# Get closest bors merge commit
283+
PARENT_COMMIT=`git rev-list --author='bors <[email protected]>' -n1 --first-parent HEAD^1`
284+
285+
./build/citool/debug/citool postprocess-metrics \
286+
--job-name ${CI_JOB_NAME} \
287+
--parent ${PARENT_COMMIT} \
288+
${METRICS} >> ${GITHUB_STEP_SUMMARY}
289+
231290
- name: upload job metrics to DataDog
291+
# This step is not critical, and if some I/O problem happens, we don't want
292+
# to cancel the build.
293+
continue-on-error: true
232294
if: needs.calculate_matrix.outputs.run_type != 'pr'
233295
env:
234-
DATADOG_SITE: datadoghq.com
235296
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}
236297
DD_GITHUB_JOB_NAME: ${{ matrix.full_name }}
237-
run: |
238-
cd src/ci
239-
npm ci
240-
python3 scripts/upload-build-metrics.py ../../build/cpu-usage.csv
298+
run: ./build/citool/debug/citool upload-build-metrics build/cpu-usage.csv
241299

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

.github/workflows/ghcr.yml

Lines changed: 7 additions & 0 deletions
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

0 commit comments

Comments
 (0)