Skip to content

Commit f034a4f

Browse files
authored
Rollup merge of #144623 - RalfJung:miri, r=RalfJung
miri subtree update Subtree update of `miri` to rust-lang/miri@fc4d9a2. Created using https://github.com/rust-lang/josh-sync. r? `@ghost`
2 parents 15ddf9c + dc33eb6 commit f034a4f

File tree

103 files changed

+2745
-1468
lines changed

Some content is hidden

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

103 files changed

+2745
-1468
lines changed

Cargo.lock

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,8 @@ version = "1.2.16"
466466
source = "registry+https://github.com/rust-lang/crates.io-index"
467467
checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c"
468468
dependencies = [
469+
"jobserver",
470+
"libc",
469471
"shlex",
470472
]
471473

@@ -655,6 +657,26 @@ dependencies = [
655657
"serde",
656658
]
657659

660+
[[package]]
661+
name = "cmake"
662+
version = "0.1.54"
663+
source = "registry+https://github.com/rust-lang/crates.io-index"
664+
checksum = "e7caa3f9de89ddbe2c607f4101924c5abec803763ae9534e4f4d7d8f84aa81f0"
665+
dependencies = [
666+
"cc",
667+
]
668+
669+
[[package]]
670+
name = "codespan-reporting"
671+
version = "0.12.0"
672+
source = "registry+https://github.com/rust-lang/crates.io-index"
673+
checksum = "fe6d2e5af09e8c8ad56c969f2157a3d4238cebc7c55f0a517728c38f7b200f81"
674+
dependencies = [
675+
"serde",
676+
"termcolor",
677+
"unicode-width 0.2.1",
678+
]
679+
658680
[[package]]
659681
name = "collect-license-metadata"
660682
version = "0.1.0"
@@ -913,6 +935,68 @@ dependencies = [
913935
"windows-sys 0.59.0",
914936
]
915937

938+
[[package]]
939+
name = "cxx"
940+
version = "1.0.161"
941+
source = "registry+https://github.com/rust-lang/crates.io-index"
942+
checksum = "a3523cc02ad831111491dd64b27ad999f1ae189986728e477604e61b81f828df"
943+
dependencies = [
944+
"cc",
945+
"cxxbridge-cmd",
946+
"cxxbridge-flags",
947+
"cxxbridge-macro",
948+
"foldhash",
949+
"link-cplusplus",
950+
]
951+
952+
[[package]]
953+
name = "cxx-build"
954+
version = "1.0.161"
955+
source = "registry+https://github.com/rust-lang/crates.io-index"
956+
checksum = "212b754247a6f07b10fa626628c157593f0abf640a3dd04cce2760eca970f909"
957+
dependencies = [
958+
"cc",
959+
"codespan-reporting",
960+
"indexmap",
961+
"proc-macro2",
962+
"quote",
963+
"scratch",
964+
"syn 2.0.104",
965+
]
966+
967+
[[package]]
968+
name = "cxxbridge-cmd"
969+
version = "1.0.161"
970+
source = "registry+https://github.com/rust-lang/crates.io-index"
971+
checksum = "f426a20413ec2e742520ba6837c9324b55ffac24ead47491a6e29f933c5b135a"
972+
dependencies = [
973+
"clap",
974+
"codespan-reporting",
975+
"indexmap",
976+
"proc-macro2",
977+
"quote",
978+
"syn 2.0.104",
979+
]
980+
981+
[[package]]
982+
name = "cxxbridge-flags"
983+
version = "1.0.161"
984+
source = "registry+https://github.com/rust-lang/crates.io-index"
985+
checksum = "a258b6069020b4e5da6415df94a50ee4f586a6c38b037a180e940a43d06a070d"
986+
987+
[[package]]
988+
name = "cxxbridge-macro"
989+
version = "1.0.161"
990+
source = "registry+https://github.com/rust-lang/crates.io-index"
991+
checksum = "e8dec184b52be5008d6eaf7e62fc1802caf1ad1227d11b3b7df2c409c7ffc3f4"
992+
dependencies = [
993+
"indexmap",
994+
"proc-macro2",
995+
"quote",
996+
"rustversion",
997+
"syn 2.0.104",
998+
]
999+
9161000
[[package]]
9171001
name = "darling"
9181002
version = "0.20.11"
@@ -1373,6 +1457,17 @@ dependencies = [
13731457
"version_check",
13741458
]
13751459

1460+
[[package]]
1461+
name = "genmc-sys"
1462+
version = "0.1.0"
1463+
dependencies = [
1464+
"cc",
1465+
"cmake",
1466+
"cxx",
1467+
"cxx-build",
1468+
"git2",
1469+
]
1470+
13761471
[[package]]
13771472
name = "getopts"
13781473
version = "0.2.23"
@@ -1427,6 +1522,21 @@ dependencies = [
14271522
"stable_deref_trait",
14281523
]
14291524

1525+
[[package]]
1526+
name = "git2"
1527+
version = "0.20.2"
1528+
source = "registry+https://github.com/rust-lang/crates.io-index"
1529+
checksum = "2deb07a133b1520dc1a5690e9bd08950108873d7ed5de38dcc74d3b5ebffa110"
1530+
dependencies = [
1531+
"bitflags",
1532+
"libc",
1533+
"libgit2-sys",
1534+
"log",
1535+
"openssl-probe",
1536+
"openssl-sys",
1537+
"url",
1538+
]
1539+
14301540
[[package]]
14311541
name = "glob"
14321542
version = "0.3.2"
@@ -2060,6 +2170,19 @@ dependencies = [
20602170
"cc",
20612171
]
20622172

2173+
[[package]]
2174+
name = "libgit2-sys"
2175+
version = "0.18.2+1.9.1"
2176+
source = "registry+https://github.com/rust-lang/crates.io-index"
2177+
checksum = "1c42fe03df2bd3c53a3a9c7317ad91d80c81cd1fb0caec8d7cc4cd2bfa10c222"
2178+
dependencies = [
2179+
"cc",
2180+
"libc",
2181+
"libz-sys",
2182+
"openssl-sys",
2183+
"pkg-config",
2184+
]
2185+
20632186
[[package]]
20642187
name = "libloading"
20652188
version = "0.8.8"
@@ -2099,6 +2222,15 @@ dependencies = [
20992222
"vcpkg",
21002223
]
21012224

2225+
[[package]]
2226+
name = "link-cplusplus"
2227+
version = "1.0.10"
2228+
source = "registry+https://github.com/rust-lang/crates.io-index"
2229+
checksum = "4a6f6da007f968f9def0d65a05b187e2960183de70c160204ecfccf0ee330212"
2230+
dependencies = [
2231+
"cc",
2232+
]
2233+
21022234
[[package]]
21032235
name = "linkchecker"
21042236
version = "0.1.0"
@@ -2308,6 +2440,7 @@ dependencies = [
23082440
"chrono-tz",
23092441
"colored 3.0.0",
23102442
"directories",
2443+
"genmc-sys",
23112444
"getrandom 0.3.3",
23122445
"ipc-channel",
23132446
"libc",
@@ -4877,6 +5010,12 @@ version = "1.2.0"
48775010
source = "registry+https://github.com/rust-lang/crates.io-index"
48785011
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
48795012

5013+
[[package]]
5014+
name = "scratch"
5015+
version = "1.0.8"
5016+
source = "registry+https://github.com/rust-lang/crates.io-index"
5017+
checksum = "9f6280af86e5f559536da57a45ebc84948833b3bee313a7dd25232e09c878a52"
5018+
48805019
[[package]]
48815020
name = "self_cell"
48825021
version = "1.2.0"

src/bootstrap/src/utils/proc_macro_deps.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/// See <https://github.com/rust-lang/rust/issues/134863>
44
pub static CRATES: &[&str] = &[
55
// tidy-alphabetical-start
6+
"allocator-api2",
67
"annotate-snippets",
78
"anstyle",
89
"askama_parser",
@@ -16,13 +17,17 @@ pub static CRATES: &[&str] = &[
1617
"darling_core",
1718
"derive_builder_core",
1819
"digest",
20+
"equivalent",
1921
"fluent-bundle",
2022
"fluent-langneg",
2123
"fluent-syntax",
2224
"fnv",
25+
"foldhash",
2326
"generic-array",
27+
"hashbrown",
2428
"heck",
2529
"ident_case",
30+
"indexmap",
2631
"intl-memoizer",
2732
"intl_pluralrules",
2833
"libc",

src/tools/miri/.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

src/tools/miri/.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

src/tools/miri/CONTRIBUTING.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,25 +297,27 @@ You can also directly run Miri on a Rust source file:
297297

298298
## Advanced topic: Syncing with the rustc repo
299299

300-
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
301301
rustc and Miri repositories. You can install it as follows:
302302

303303
```sh
304-
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
305305
```
306306

307-
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.
308308

309309
### Importing changes from the rustc repo
310310

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

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

315+
1) First, create a branch for the pull, e.g. `git checkout -b rustup`
316+
2) Then run the following:
315317
```sh
316318
# Fetch and merge rustc side of the history. Takes ca 5 min the first time.
317319
# This will also update the `rustc-version` file.
318-
./miri rustc-pull
320+
rustc-josh-sync pull
319321
# Update local toolchain and apply formatting.
320322
./miri toolchain && ./miri fmt
321323
git commit -am "rustup"
@@ -328,12 +330,12 @@ needed.
328330

329331
### Exporting changes to the rustc repo
330332

331-
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,
332334
assuming we are on an up-to-date master branch:
333335

334336
```sh
335337
# Push the Miri changes to your rustc fork (substitute your github handle for YOUR_NAME).
336-
./miri rustc-push YOUR_NAME miri
338+
rustc-josh-sync push miri YOUR_NAME
337339
```
338340

339341
This will create a new branch called `miri` in your fork, and the output should include a link that

0 commit comments

Comments
 (0)