Skip to content

Commit 58b50b7

Browse files
author
The rustc-josh-sync Cronjob Bot
committed
Merge ref 'ffb9d94dcf4a' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: ffb9d94dcf4ade0d534842be3672d5e9f47e1333 Filtered ref: 2f31646593733abae36e4c05b5a54acfb9f1f6bc This merge was created using https://github.com/rust-lang/josh-sync.
2 parents f0db863 + 9742b59 commit 58b50b7

File tree

213 files changed

+4305
-2447
lines changed

Some content is hidden

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

213 files changed

+4305
-2447
lines changed

.github/workflows/ci.yml

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,17 @@ jobs:
4545
os: macos-latest
4646
- host_target: i686-pc-windows-msvc
4747
os: windows-latest
48+
- host_target: aarch64-pc-windows-msvc
49+
os: windows-11-arm
4850
runs-on: ${{ matrix.os }}
4951
env:
5052
HOST_TARGET: ${{ matrix.host_target }}
5153
steps:
5254
- uses: actions/checkout@v4
55+
- name: apt update
56+
if: ${{ startsWith(matrix.os, 'ubuntu') }}
57+
# The runners seem to have outdated apt repos sometimes
58+
run: sudo apt update
5359
- name: install qemu
5460
if: ${{ matrix.qemu }}
5561
run: sudo apt install qemu-user qemu-user-binfmt
@@ -63,6 +69,12 @@ jobs:
6369
sudo apt update
6470
# Install needed packages
6571
sudo apt install $(echo "libatomic1: zlib1g-dev:" | sed 's/:/:${{ matrix.multiarch }}/g')
72+
- name: Install rustup on Windows ARM
73+
if: ${{ matrix.os == 'windows-11-arm' }}
74+
run: |
75+
curl -LOs https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe
76+
./rustup-init.exe -y --no-modify-path
77+
echo "$USERPROFILE/.cargo/bin" >> "$GITHUB_PATH"
6678
- uses: ./.github/workflows/setup
6779
with:
6880
toolchain_flags: "--host ${{ matrix.host_target }}"
@@ -147,35 +159,48 @@ jobs:
147159
- uses: actions/checkout@v4
148160
with:
149161
fetch-depth: 256 # get a bit more of the history
150-
- name: install josh-proxy
151-
run: cargo +stable install josh-proxy --git https://github.com/josh-project/josh --tag r24.10.04
162+
- name: install josh-sync
163+
run: cargo +stable install --locked --git https://github.com/rust-lang/josh-sync
152164
- name: setup bot git name and email
153165
run: |
154166
git config --global user.name 'The Miri Cronjob Bot'
155167
git config --global user.email '[email protected]'
156168
- name: Install nightly toolchain
157169
run: rustup toolchain install nightly --profile minimal
158-
- name: get changes from rustc
159-
run: ./miri rustc-pull
160170
- name: Install rustup-toolchain-install-master
161171
run: cargo install -f rustup-toolchain-install-master
162-
- name: format changes (if any)
172+
- name: Push changes to a branch and create PR
163173
run: |
174+
# Make it easier to see what happens.
175+
set -x
176+
# Temporarily disable early exit to examine the status code of rustc-josh-sync
177+
set +e
178+
rustc-josh-sync pull
179+
exitcode=$?
180+
set -e
181+
182+
# If there were no changes to pull, rustc-josh-sync returns status code 2.
183+
# In that case, skip the rest of the job.
184+
if [ $exitcode -eq 2 ]; then
185+
echo "Nothing changed in rustc, skipping PR"
186+
exit 0
187+
elif [ $exitcode -ne 0 ]; then
188+
# If return code was not 0 or 2, rustc-josh-sync actually failed
189+
echo "error: rustc-josh-sync failed"
190+
exit ${exitcode}
191+
fi
192+
193+
# Format changes
164194
./miri toolchain
165195
./miri fmt --check || (./miri fmt && git commit -am "fmt")
166-
- name: Push changes to a branch and create PR
167-
run: |
168-
# `git diff --exit-code` "succeeds" if the diff is empty.
169-
if git diff --exit-code HEAD^; then echo "Nothing changed in rustc, skipping PR"; exit 0; fi
170-
# The diff is non-empty, create a PR.
196+
197+
# Create a PR
171198
BRANCH="rustup-$(date -u +%Y-%m-%d)"
172199
git switch -c $BRANCH
173200
git push -u origin $BRANCH
174201
gh pr create -B master --title 'Automatic Rustup' --body 'Please close and re-open this PR to trigger CI, then enable auto-merge.'
175202
env:
176203
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
177-
ZULIP_BOT_EMAIL: ${{ secrets.ZULIP_BOT_EMAIL }}
178-
ZULIP_API_TOKEN: ${{ secrets.ZULIP_API_TOKEN }}
179204

180205
cron-fail-notify:
181206
name: cronjob failure notification
@@ -198,7 +223,7 @@ jobs:
198223
It would appear that the [Miri cron job build]('"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"') failed.
199224
200225
This likely means that rustc changed the miri directory and
201-
we now need to do a [`./miri rustc-pull`](https://github.com/rust-lang/miri/blob/master/CONTRIBUTING.md#importing-changes-from-the-rustc-repo).
226+
we now need to do a [`rustc-josh-sync pull`](https://github.com/rust-lang/miri/blob/master/CONTRIBUTING.md#importing-changes-from-the-rustc-repo).
202227
203228
Would you mind investigating this issue?
204229

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
target
2-
/doc
32
tex/*/out
43
*.dot
54
*.out

CONTRIBUTING.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,20 @@ for a list of Miri maintainers.
1313

1414
[Rust Zulip]: https://rust-lang.zulipchat.com
1515

16-
### Pull review process
16+
### PR review process
1717

1818
When you get a review, please take care of the requested changes in new commits. Do not amend
1919
existing commits. Generally avoid force-pushing. The only time you should force push is when there
2020
is a conflict with the master branch (in that case you should rebase across master, not merge), and
2121
all the way at the end of the review process when the reviewer tells you that the PR is done and you
22-
should squash the commits. If you are unsure how to use `git rebase` to squash commits, use `./miri
23-
squash` which automates the process but leaves little room for customization. (All this is to work
24-
around the fact that Github is quite bad at dealing with force pushes and does not support `git
25-
range-diff`. Maybe one day Github will be good at git and then life can become easier.)
22+
should squash the commits. (All this is to work around the fact that Github is quite bad at
23+
dealing with force pushes and does not support `git range-diff`.)
24+
25+
The recommended way to squash commits is to use `./miri squash`, which will make everything into a
26+
single commit. You will be asked for the commit message; please ensure it describes the entire PR.
27+
You can also use `git rebase` manually if you need more control (e.g. if there should be more than
28+
one commit at the end), but then please use `--keep-base` to ensure the PR remains based on the same
29+
upstream commit.
2630

2731
Most PRs bounce back and forth between the reviewer and the author several times, so it is good to
2832
keep track of who is expected to take the next step. We are using the `S-waiting-for-review` and
@@ -293,25 +297,27 @@ You can also directly run Miri on a Rust source file:
293297

294298
## Advanced topic: Syncing with the rustc repo
295299

296-
We use the [`josh` proxy](https://github.com/josh-project/josh) to transmit changes between the
300+
We use the [`josh-sync`](https://github.com/rust-lang/josh-sync) tool to transmit changes between the
297301
rustc and Miri repositories. You can install it as follows:
298302

299303
```sh
300-
cargo +stable install josh-proxy --git https://github.com/josh-project/josh --tag r24.10.04
304+
cargo install --locked --git https://github.com/rust-lang/josh-sync
301305
```
302306

303-
Josh will automatically be started and stopped by `./miri`.
307+
The commands below will automatically install and manage the [Josh](https://github.com/josh-project/josh) proxy that performs the actual work.
304308

305309
### Importing changes from the rustc repo
306310

307311
*Note: this usually happens automatically, so these steps rarely have to be done by hand.*
308312

309313
We assume we start on an up-to-date master branch in the Miri repo.
310314

315+
1) First, create a branch for the pull, e.g. `git checkout -b rustup`
316+
2) Then run the following:
311317
```sh
312318
# Fetch and merge rustc side of the history. Takes ca 5 min the first time.
313319
# This will also update the `rustc-version` file.
314-
./miri rustc-pull
320+
rustc-josh-sync pull
315321
# Update local toolchain and apply formatting.
316322
./miri toolchain && ./miri fmt
317323
git commit -am "rustup"
@@ -324,12 +330,12 @@ needed.
324330

325331
### Exporting changes to the rustc repo
326332

327-
We will use the josh proxy to push to your fork of rustc. Run the following in the Miri repo,
333+
We will use the `josh-sync` tool to push to your fork of rustc. Run the following in the Miri repo,
328334
assuming we are on an up-to-date master branch:
329335

330336
```sh
331337
# Push the Miri changes to your rustc fork (substitute your github handle for YOUR_NAME).
332-
./miri rustc-push YOUR_NAME miri
338+
rustc-josh-sync push miri YOUR_NAME
333339
```
334340

335341
This will create a new branch called `miri` in your fork, and the output should include a link that
@@ -348,6 +354,7 @@ https. Add the following to your `.gitconfig`:
348354

349355
The following environment variables are relevant to `./miri`:
350356

357+
* `CARGO` sets the binary used to execute Cargo; if none is specified, defaults to `cargo`.
351358
* `MIRI_AUTO_OPS` indicates whether the automatic execution of rustfmt, clippy and toolchain setup
352359
(as controlled by the `./auto-*` files) should be skipped. If it is set to `no`, they are skipped.
353360
This is used to allow automated IDE actions to avoid the auto ops.

0 commit comments

Comments
 (0)