Skip to content

Commit 236c377

Browse files
committed
Auto merge of #144085 - Kobzol:rollup-ty9p3ut, r=Kobzol
Rollup of 10 pull requests Successful merges: - #142300 (Disable `tests/run-make/mte-ffi` because no CI runners have MTE extensions enabled) - #143649 (Add test for `default_field_values` and `const_default`) - #144010 (Boostrap: add warning on `optimize = false`) - #144029 (Fix wrong messages from methods with the same name from different traits) - #144049 (rustc-dev-guide subtree update) - #144053 (Remove install Rust script from CI) - #144056 (Copy GCC sources into the build directory even outside CI) - #144063 (Add myself to the `infra-ci` reviewer group and adjust some infra auto-labels) - #144069 (ci: use windows 22 for all free runners) - #144083 (miri sleep tests: increase slack) r? `@ghost` `@rustbot` modify labels: rollup
2 parents e466296 + 0ae8205 commit 236c377

File tree

34 files changed

+303
-1055
lines changed

34 files changed

+303
-1055
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,6 @@ jobs:
152152
- name: show the current environment
153153
run: src/ci/scripts/dump-environment.sh
154154

155-
- name: install rust
156-
run: src/ci/scripts/install-rust.sh
157-
158155
- name: install awscli
159156
run: src/ci/scripts/install-awscli.sh
160157

compiler/rustc_hir_typeck/src/method/probe.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1650,7 +1650,8 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
16501650
}
16511651
}
16521652

1653-
let sources = candidates.iter().map(|p| self.candidate_source(p, self_ty)).collect();
1653+
let sources =
1654+
applicable_candidates.iter().map(|p| self.candidate_source(p.0, self_ty)).collect();
16541655
return Some(Err(MethodError::Ambiguity(sources)));
16551656
}
16561657

src/bootstrap/src/core/build_steps/gcc.rs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -220,21 +220,18 @@ fn build_gcc(metadata: &Meta, builder: &Builder<'_>, target: TargetSelection) {
220220
t!(fs::create_dir_all(install_dir));
221221

222222
// GCC creates files (e.g. symlinks to the downloaded dependencies)
223-
// in the source directory, which does not work with our CI setup, where we mount
223+
// in the source directory, which does not work with our CI/Docker setup, where we mount
224224
// source directories as read-only on Linux.
225-
// Therefore, as a part of the build in CI, we first copy the whole source directory
226-
// to the build directory, and perform the build from there.
227-
let src_dir = if builder.config.is_running_on_ci {
228-
let src_dir = builder.gcc_out(target).join("src");
229-
if src_dir.exists() {
230-
builder.remove_dir(&src_dir);
231-
}
232-
builder.create_dir(&src_dir);
233-
builder.cp_link_r(root, &src_dir);
234-
src_dir
235-
} else {
236-
root.clone()
237-
};
225+
// And in general, we shouldn't be modifying the source directories if possible, even for local
226+
// builds.
227+
// Therefore, we first copy the whole source directory to the build directory, and perform the
228+
// build from there.
229+
let src_dir = builder.gcc_out(target).join("src");
230+
if src_dir.exists() {
231+
builder.remove_dir(&src_dir);
232+
}
233+
builder.create_dir(&src_dir);
234+
builder.cp_link_r(root, &src_dir);
238235

239236
command(src_dir.join("contrib/download_prerequisites")).current_dir(&src_dir).run(builder);
240237
let mut configure_cmd = command(src_dir.join("configure"));

src/bootstrap/src/core/config/toml/rust.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,14 @@ impl Config {
531531
lld_enabled = lld_enabled_toml;
532532
std_features = std_features_toml;
533533

534+
if optimize_toml.as_ref().is_some_and(|v| matches!(v, RustOptimize::Bool(false))) {
535+
eprintln!(
536+
"WARNING: setting `optimize` to `false` is known to cause errors and \
537+
should be considered unsupported. Refer to `bootstrap.example.toml` \
538+
for more details."
539+
);
540+
}
541+
534542
optimize = optimize_toml;
535543
self.rust_new_symbol_mangling = new_symbol_mangling;
536544
set(&mut self.rust_optimize_tests, optimize_tests);

src/ci/github-actions/jobs.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ runners:
3434
os: windows-2022
3535
<<: *base-job
3636

37+
# NOTE: windows-2025 has less disk space available than windows-2022,
38+
# because the D drive is missing.
3739
- &job-windows-25
3840
os: windows-2025
3941
<<: *base-job
@@ -542,13 +544,13 @@ auto:
542544
env:
543545
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-sanitizers --enable-profiler
544546
SCRIPT: make ci-msvc-py
545-
<<: *job-windows-25
547+
<<: *job-windows
546548

547549
- name: x86_64-msvc-2
548550
env:
549551
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-sanitizers --enable-profiler
550552
SCRIPT: make ci-msvc-ps1
551-
<<: *job-windows-25
553+
<<: *job-windows
552554

553555
# i686-msvc is split into two jobs to run tests in parallel.
554556
- name: i686-msvc-1

src/ci/scripts/install-rust.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/doc/rustc-dev-guide/.github/workflows/rustc-pull.yml

Lines changed: 9 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -9,106 +9,12 @@ on:
99
jobs:
1010
pull:
1111
if: github.repository == 'rust-lang/rustc-dev-guide'
12-
runs-on: ubuntu-latest
13-
outputs:
14-
pr_url: ${{ steps.update-pr.outputs.pr_url }}
15-
permissions:
16-
contents: write
17-
pull-requests: write
18-
steps:
19-
- uses: actions/checkout@v4
20-
with:
21-
# We need the full history for josh to work
22-
fetch-depth: '0'
23-
- name: Install stable Rust toolchain
24-
run: rustup update stable
25-
- uses: Swatinem/rust-cache@v2
26-
with:
27-
workspaces: "josh-sync"
28-
# Cache the josh directory with checked out rustc
29-
cache-directories: "/home/runner/.cache/rustc-dev-guide-josh"
30-
- name: Install josh
31-
run: RUSTFLAGS="--cap-lints warn" cargo install josh-proxy --git https://github.com/josh-project/josh --tag r24.10.04
32-
- name: Setup bot git name and email
33-
run: |
34-
git config --global user.name 'The rustc-dev-guide Cronjob Bot'
35-
git config --global user.email '[email protected]'
36-
- name: Perform rustc-pull
37-
id: rustc-pull
38-
# Turn off -e to disable early exit
39-
shell: bash {0}
40-
run: |
41-
cargo run --manifest-path josh-sync/Cargo.toml -- rustc-pull
42-
exitcode=$?
43-
44-
# If no pull was performed, we want to mark this job as successful,
45-
# but we do not want to perform the follow-up steps.
46-
if [ $exitcode -eq 0 ]; then
47-
echo "pull_result=pull-finished" >> $GITHUB_OUTPUT
48-
elif [ $exitcode -eq 2 ]; then
49-
echo "pull_result=skipped" >> $GITHUB_OUTPUT
50-
exitcode=0
51-
fi
52-
53-
exit ${exitcode}
54-
- name: Push changes to a branch
55-
if: ${{ steps.rustc-pull.outputs.pull_result == 'pull-finished' }}
56-
run: |
57-
# Update a sticky branch that is used only for rustc pulls
58-
BRANCH="rustc-pull"
59-
git switch -c $BRANCH
60-
git push -u origin $BRANCH --force
61-
- name: Create pull request
62-
id: update-pr
63-
if: ${{ steps.rustc-pull.outputs.pull_result == 'pull-finished' }}
64-
env:
65-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66-
run: |
67-
# Check if an open pull request for an rustc pull update already exists
68-
# If it does, the previous push has just updated it
69-
# If not, we create it now
70-
RESULT=`gh pr list --author github-actions[bot] --state open -q 'map(select(.title=="Rustc pull update")) | length' --json title`
71-
if [[ "$RESULT" -eq 0 ]]; then
72-
echo "Creating new pull request"
73-
PR_URL=`gh pr create -B master --title 'Rustc pull update' --body 'Latest update from rustc.'`
74-
echo "pr_url=$PR_URL" >> $GITHUB_OUTPUT
75-
else
76-
PR_URL=`gh pr list --author github-actions[bot] --state open -q 'map(select(.title=="Rustc pull update")) | .[0].url' --json url,title`
77-
echo "Updating pull request ${PR_URL}"
78-
echo "pr_url=$PR_URL" >> $GITHUB_OUTPUT
79-
fi
80-
send-zulip-message:
81-
needs: [pull]
82-
if: ${{ !cancelled() }}
83-
runs-on: ubuntu-latest
84-
steps:
85-
- uses: actions/checkout@v4
86-
- name: Compute message
87-
id: create-message
88-
env:
89-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90-
run: |
91-
if [ "${{ needs.pull.result }}" == "failure" ]; then
92-
WORKFLOW_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
93-
echo "message=Rustc pull sync failed. Check out the [workflow URL]($WORKFLOW_URL)." >> $GITHUB_OUTPUT
94-
else
95-
CREATED_AT=`gh pr list --author github-actions[bot] --state open -q 'map(select(.title=="Rustc pull update")) | .[0].createdAt' --json createdAt,title`
96-
PR_URL=`gh pr list --author github-actions[bot] --state open -q 'map(select(.title=="Rustc pull update")) | .[0].url' --json url,title`
97-
week_ago=$(date +%F -d '7 days ago')
98-
99-
# If there is an open PR that is at least a week old, post a message about it
100-
if [[ -n $DATE_GH && $DATE_GH < $week_ago ]]; then
101-
echo "message=A PR with a Rustc pull has been opened for more a week. Check out the [PR](${PR_URL})." >> $GITHUB_OUTPUT
102-
fi
103-
fi
104-
- name: Send a Zulip message about updated PR
105-
if: ${{ steps.create-message.outputs.message != '' }}
106-
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5
107-
with:
108-
api-key: ${{ secrets.ZULIP_API_TOKEN }}
109-
110-
organization-url: "https://rust-lang.zulipchat.com"
111-
to: 196385
112-
type: "stream"
113-
topic: "Subtree sync automation"
114-
content: ${{ steps.create-message.outputs.message }}
12+
uses: rust-lang/josh-sync/.github/workflows/rustc-pull.yml@main
13+
with:
14+
zulip-stream-id: 196385
15+
zulip-bot-email: "[email protected]"
16+
pr-base-branch: master
17+
branch-name: rustc-pull
18+
secrets:
19+
zulip-api-token: ${{ secrets.ZULIP_API_TOKEN }}
20+
token: ${{ secrets.GITHUB_TOKEN }}

src/doc/rustc-dev-guide/README.md

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -72,49 +72,6 @@ including the `<!-- toc -->` marker at the place where you want the TOC.
7272

7373
## Synchronizing josh subtree with rustc
7474

75-
This repository is linked to `rust-lang/rust` as a [josh](https://josh-project.github.io/josh/intro.html) subtree. You can use the following commands to synchronize the subtree in both directions.
75+
This repository is linked to `rust-lang/rust` as a [josh](https://josh-project.github.io/josh/intro.html) subtree. You can use the [rustc-josh-sync](https://github.com/rust-lang/josh-sync) tool to perform synchronization.
7676

77-
You'll need to install `josh-proxy` locally via
78-
79-
```
80-
cargo install josh-proxy --git https://github.com/josh-project/josh --tag r24.10.04
81-
```
82-
Older versions of `josh-proxy` may not round trip commits losslessly so it is important to install this exact version.
83-
84-
### Pull changes from `rust-lang/rust` into this repository
85-
86-
1) Checkout a new branch that will be used to create a PR into `rust-lang/rustc-dev-guide`
87-
2) Run the pull command
88-
```
89-
cargo run --manifest-path josh-sync/Cargo.toml rustc-pull
90-
```
91-
3) Push the branch to your fork and create a PR into `rustc-dev-guide`
92-
93-
### Push changes from this repository into `rust-lang/rust`
94-
95-
NOTE: If you use Git protocol to push to your fork of `rust-lang/rust`,
96-
ensure that you have this entry in your Git config,
97-
else the 2 steps that follow would prompt for a username and password:
98-
99-
```
100-
101-
insteadOf = "https://github.com/"
102-
```
103-
104-
1) Run the push command to create a branch named `<branch-name>` in a `rustc` fork under the `<gh-username>` account
105-
```
106-
cargo run --manifest-path josh-sync/Cargo.toml rustc-push <branch-name> <gh-username>
107-
```
108-
2) Create a PR from `<branch-name>` into `rust-lang/rust`
109-
110-
#### Minimal git config
111-
112-
For simplicity (ease of implementation purposes), the josh-sync script simply calls out to system git. This means that the git invocation may be influenced by global (or local) git configuration.
113-
114-
You may observe "Nothing to pull" even if you *know* rustc-pull has something to pull if your global git config sets `fetch.prunetags = true` (and possibly other configurations may cause unexpected outcomes).
115-
116-
To minimize the likelihood of this happening, you may wish to keep a separate *minimal* git config that *only* has `[user]` entries from global git config, then repoint system git to use the minimal git config instead. E.g.
117-
118-
```
119-
GIT_CONFIG_GLOBAL=/path/to/minimal/gitconfig GIT_CONFIG_SYSTEM='' cargo run --manifest-path josh-sync/Cargo.toml -- rustc-pull
120-
```
77+
You can find a guide on how to perform the synchronization [here](./src/external-repos.md#synchronizing-a-josh-subtree).

0 commit comments

Comments
 (0)