Skip to content

Commit dffec95

Browse files
committed
sync Miri
1 parent 1536a53 commit dffec95

40 files changed

+605
-883
lines changed

Cargo.lock

Lines changed: 22 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -385,11 +385,12 @@ version = "0.1.0"
385385
dependencies = [
386386
"cargo_metadata 0.15.0",
387387
"directories",
388+
"rustc-build-sysroot",
388389
"rustc-workspace-hack",
390+
"rustc_tools_util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
389391
"rustc_version",
390392
"serde",
391393
"serde_json",
392-
"vergen",
393394
]
394395

395396
[[package]]
@@ -647,7 +648,7 @@ dependencies = [
647648
"regex",
648649
"rustc-semver",
649650
"rustc-workspace-hack",
650-
"rustc_tools_util",
651+
"rustc_tools_util 0.2.0",
651652
"semver",
652653
"serde",
653654
"syn",
@@ -1082,9 +1083,9 @@ dependencies = [
10821083

10831084
[[package]]
10841085
name = "directories"
1085-
version = "3.0.2"
1086+
version = "4.0.1"
10861087
source = "registry+https://github.com/rust-lang/crates.io-index"
1087-
checksum = "e69600ff1703123957937708eb27f7a564e48885c537782722ed0ba3189ce1d7"
1088+
checksum = "f51c5d4ddabd36886dd3e1438cb358cdcb0d7c499cb99cb4ac2e38e18b5cb210"
10881089
dependencies = [
10891090
"dirs-sys",
10901091
]
@@ -1174,26 +1175,6 @@ dependencies = [
11741175
"log",
11751176
]
11761177

1177-
[[package]]
1178-
name = "enum-iterator"
1179-
version = "0.6.0"
1180-
source = "registry+https://github.com/rust-lang/crates.io-index"
1181-
checksum = "c79a6321a1197d7730510c7e3f6cb80432dfefecb32426de8cea0aa19b4bb8d7"
1182-
dependencies = [
1183-
"enum-iterator-derive",
1184-
]
1185-
1186-
[[package]]
1187-
name = "enum-iterator-derive"
1188-
version = "0.6.0"
1189-
source = "registry+https://github.com/rust-lang/crates.io-index"
1190-
checksum = "1e94aa31f7c0dc764f57896dc615ddd76fc13b0d5dca7eb6cc5e018a5a09ec06"
1191-
dependencies = [
1192-
"proc-macro2",
1193-
"quote",
1194-
"syn",
1195-
]
1196-
11971178
[[package]]
11981179
name = "env_logger"
11991180
version = "0.7.1"
@@ -1531,18 +1512,6 @@ dependencies = [
15311512
"wasi 0.9.0+wasi-snapshot-preview1",
15321513
]
15331514

1534-
[[package]]
1535-
name = "getset"
1536-
version = "0.1.1"
1537-
source = "registry+https://github.com/rust-lang/crates.io-index"
1538-
checksum = "24b328c01a4d71d2d8173daa93562a73ab0fe85616876f02500f53d82948c504"
1539-
dependencies = [
1540-
"proc-macro-error",
1541-
"proc-macro2",
1542-
"quote",
1543-
"syn",
1544-
]
1545-
15461515
[[package]]
15471516
name = "gimli"
15481517
version = "0.25.0"
@@ -3029,6 +2998,17 @@ dependencies = [
30292998
"mdbook",
30302999
]
30313000

3001+
[[package]]
3002+
name = "rustc-build-sysroot"
3003+
version = "0.3.3"
3004+
source = "registry+https://github.com/rust-lang/crates.io-index"
3005+
checksum = "ec5f3689b6c560d6a3a17fcbe54204cd870b4fcf46342d60de16715b660d2c92"
3006+
dependencies = [
3007+
"anyhow",
3008+
"rustc_version",
3009+
"tempfile",
3010+
]
3011+
30323012
[[package]]
30333013
name = "rustc-demangle"
30343014
version = "0.1.21"
@@ -4165,6 +4145,12 @@ dependencies = [
41654145
name = "rustc_tools_util"
41664146
version = "0.2.0"
41674147

4148+
[[package]]
4149+
name = "rustc_tools_util"
4150+
version = "0.2.0"
4151+
source = "registry+https://github.com/rust-lang/crates.io-index"
4152+
checksum = "b725dadae9fabc488df69a287f5a99c5eaf5d10853842a8a3dfac52476f544ee"
4153+
41684154
[[package]]
41694155
name = "rustc_trait_selection"
41704156
version = "0.0.0"
@@ -5330,21 +5316,6 @@ version = "0.2.10"
53305316
source = "registry+https://github.com/rust-lang/crates.io-index"
53315317
checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c"
53325318

5333-
[[package]]
5334-
name = "vergen"
5335-
version = "5.1.0"
5336-
source = "registry+https://github.com/rust-lang/crates.io-index"
5337-
checksum = "dfbc87f9a7a9d61b15d51d1d3547284f67b6b4f1494ce3fc5814c101f35a5183"
5338-
dependencies = [
5339-
"anyhow",
5340-
"chrono",
5341-
"enum-iterator",
5342-
"getset",
5343-
"git2",
5344-
"rustversion",
5345-
"thiserror",
5346-
]
5347-
53485319
[[package]]
53495320
name = "version_check"
53505321
version = "0.9.3"

src/bootstrap/test.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -494,16 +494,6 @@ impl Step for Miri {
494494
// sysroot does not seem to populate it, so we do that first.
495495
builder.ensure(compile::Std::new(compiler_std, host));
496496
let sysroot = builder.sysroot(compiler_std);
497-
let mut cargo =
498-
builder.cargo(compiler, Mode::ToolRustc, SourceType::Submodule, host, "install");
499-
cargo.arg("xargo");
500-
// Configure `cargo install` path. cargo adds a `bin/`.
501-
cargo.env("CARGO_INSTALL_ROOT", &builder.out);
502-
503-
let mut cargo = Command::from(cargo);
504-
if !try_run(builder, &mut cargo) {
505-
return;
506-
}
507497

508498
// # Run `cargo miri setup`.
509499
let mut cargo = tool::prepare_tool_cargo(
@@ -525,8 +515,6 @@ impl Step for Miri {
525515
cargo.env("MIRI", &miri);
526516
// Debug things.
527517
cargo.env("RUST_BACKTRACE", "1");
528-
// Let cargo-miri know where xargo ended up.
529-
cargo.env("XARGO_CHECK", builder.out.join("bin").join("xargo-check"));
530518

531519
let mut cargo = Command::from(cargo);
532520
builder.run(&mut cargo);

src/ci/scripts/should-skip-this.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ if [[ -n "${CI_ONLY_WHEN_SUBMODULES_CHANGED-}" ]]; then
1818
# Submodules pseudo-files inside git have the 160000 permissions, so when
1919
# those files are present in the diff a submodule was updated.
2020
echo "Submodules were updated"
21-
elif ! git diff --quiet "$BASE_COMMIT" -- src/tools/clippy src/tools/rustfmt; then
21+
elif ! (git diff --quiet "$BASE_COMMIT" -- \
22+
src/tools/clippy src/tools/rustfmt src/tools/miri); then
2223
# There is not an easy blanket search for subtrees. For now, manually list
2324
# the subtrees.
24-
echo "Clippy or rustfmt subtrees were updated"
25+
echo "Tool subtrees were updated"
2526
elif ! (git diff --quiet "$BASE_COMMIT" -- \
2627
src/test/rustdoc-gui \
2728
src/librustdoc \

src/tools/miri/.github/workflows/ci.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
schedule:
1313
- cron: '5 15 * * *' # At 15:05 UTC every day.
1414

15+
env:
16+
CARGO_UNSTABLE_SPARSE_REGISTRY: 'true'
17+
1518
jobs:
1619
build:
1720
runs-on: ${{ matrix.os }}
@@ -38,14 +41,6 @@ jobs:
3841
if: runner.os == 'Linux'
3942
run: echo "MIRIFLAGS=-Zmiri-tag-gc=1" >> $GITHUB_ENV
4043

41-
# We install gnu-tar because BSD tar is buggy on macOS builders of GHA.
42-
# See <https://github.com/actions/cache/issues/403>.
43-
- name: Install GNU tar
44-
if: runner.os == 'macOS'
45-
run: |
46-
brew install gnu-tar
47-
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
48-
4944
# Cache the global cargo directory, but NOT the local `target` directory which
5045
# we cannot reuse anyway when the nightly changes (and it grows quite large
5146
# over time).
@@ -62,15 +57,14 @@ jobs:
6257
# contains package information of crates installed via `cargo install`.
6358
~/.cargo/.crates.toml
6459
~/.cargo/.crates2.json
65-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', 'cargo-miri/src/version.rs') }}
60+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
6661
restore-keys: ${{ runner.os }}-cargo
6762

68-
- name: Install rustup-toolchain-install-master and xargo
69-
if: ${{ steps.cache.outputs.cache-hit == 'false' }}
63+
- name: Install rustup-toolchain-install-master
64+
if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
7065
shell: bash
7166
run: |
72-
cargo install rustup-toolchain-install-master
73-
cargo install xargo
67+
cargo install -f rustup-toolchain-install-master
7468
7569
- name: Install "master" toolchain
7670
shell: bash

src/tools/miri/CONTRIBUTING.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ for you. If you don't want all of these to happen, you can add individual `.auto
3838
## Building and testing Miri
3939

4040
Invoking Miri requires getting a bunch of flags right and setting up a custom
41-
sysroot with xargo. The `miri` script takes care of that for you. With the
41+
sysroot. The `miri` script takes care of that for you. With the
4242
build environment prepared, compiling Miri is just one command away:
4343

4444
```
@@ -275,3 +275,28 @@ see <https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html>.
275275

276276
With this, you should now have a working development setup! See
277277
[above](#building-and-testing-miri) for how to proceed working on Miri.
278+
279+
280+
### Fetching the latest changes from the rustc repo
281+
282+
Run the josh proxy locally
283+
284+
```
285+
docker run -p 8000:8000 -e JOSH_REMOTE=https://github.com -v josh-vol:/data/git joshproject/josh-proxy:latest
286+
```
287+
288+
Register the josh proxy as a remote
289+
290+
```
291+
git remote add josh http://localhost:8000/rust-lang/rust.git:/src/tools/miri.git
292+
```
293+
294+
Fetch (takes ca 5-10 min the first time)
295+
296+
```
297+
git fetch josh
298+
git checkout josh/master
299+
git switch -c josh_sync
300+
```
301+
302+
Now push `josh_sync` to your own miri fork and open a PR with it.

0 commit comments

Comments
 (0)