Skip to content

Commit e0126aa

Browse files
committed
Auto merge of #115095 - RalfJung:miri, r=RalfJung
update Miri r? `@ghost`
2 parents 78e80e5 + 63c5542 commit e0126aa

File tree

21 files changed

+299
-74
lines changed

21 files changed

+299
-74
lines changed

.github/workflows/ci.yml

-2
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,6 @@ jobs:
189189
fetch-depth: 256 # get a bit more of the history
190190
- name: install josh-proxy
191191
run: cargo +stable install josh-proxy --git https://github.com/josh-project/josh --tag r22.12.06
192-
- name: start josh-proxy
193-
run: josh-proxy --local=$HOME/.cache/josh --remote=https://github.com --no-background &
194192
- name: setup bot git name and email
195193
run: |
196194
git config --global user.name 'The Miri Conjob Bot'

CONTRIBUTING.md

+22-24
Original file line numberDiff line numberDiff line change
@@ -165,16 +165,17 @@ to `.vscode/settings.json` in your local Miri clone:
165165
{
166166
"rust-analyzer.rustc.source": "discover",
167167
"rust-analyzer.linkedProjects": [
168-
"./Cargo.toml",
169-
"./cargo-miri/Cargo.toml"
168+
"Cargo.toml",
169+
"cargo-miri/Cargo.toml",
170+
"miri-script/Cargo.toml",
170171
],
171-
"rust-analyzer.checkOnSave.overrideCommand": [
172+
"rust-analyzer.check.overrideCommand": [
172173
"env",
173174
"MIRI_AUTO_OPS=no",
174175
"./miri",
175176
"cargo",
176177
"clippy", // make this `check` when working with a locally built rustc
177-
"--message-format=json"
178+
"--message-format=json",
178179
],
179180
// Contrary to what the name suggests, this also affects proc macros.
180181
"rust-analyzer.cargo.buildScripts.overrideCommand": [
@@ -230,25 +231,16 @@ You can also directly run Miri on a Rust source file:
230231
## Advanced topic: Syncing with the rustc repo
231232

232233
We use the [`josh` proxy](https://github.com/josh-project/josh) to transmit changes between the
233-
rustc and Miri repositories.
234+
rustc and Miri repositories. You can install it as follows:
234235

235236
```sh
236237
cargo +stable install josh-proxy --git https://github.com/josh-project/josh --tag r22.12.06
237-
josh-proxy --local=$HOME/.cache/josh --remote=https://github.com --no-background
238238
```
239239

240-
This uses a directory `$HOME/.cache/josh` as a cache, to speed up repeated pulling/pushing.
241-
242-
To make josh push via ssh instead of https, you can add the following to your `.gitconfig`:
243-
244-
```toml
245-
[url "git@github.com:"]
246-
pushInsteadOf = https://github.com/
247-
```
240+
Josh will automatically be started and stopped by `./miri`.
248241

249242
### Importing changes from the rustc repo
250243

251-
Josh needs to be running, as described above.
252244
We assume we start on an up-to-date master branch in the Miri repo.
253245

254246
```sh
@@ -267,16 +259,14 @@ needed.
267259

268260
### Exporting changes to the rustc repo
269261

270-
Keep in mind that pushing is the most complicated job that josh has to do --
271-
pulling just filters the rustc history, but pushing needs to construct a new
272-
rustc history that would filter to the given Miri history! To avoid problems, it
273-
is a good idea to always pull immediately before you push. In particular, you
274-
should never do two josh pushes without an intermediate pull; that can lead to
275-
duplicated commits.
262+
Keep in mind that pushing is the most complicated job that josh has to do -- pulling just filters
263+
the rustc history, but pushing needs to construct a new rustc history that would filter to the given
264+
Miri history! To avoid problems, it is a good idea to always pull immediately before you push. If
265+
you are getting strange errors, chances are you are running into [this josh
266+
bug](https://github.com/josh-project/josh/issues/998). In that case, please get in touch on Zulip.
276267

277-
Josh needs to be running, as described above. We will use the josh proxy to push
278-
to your fork of rustc. Run the following in the Miri repo, assuming we are on an
279-
up-to-date master branch:
268+
We will use the josh proxy to push to your fork of rustc. Run the following in the Miri repo,
269+
assuming we are on an up-to-date master branch:
280270

281271
```sh
282272
# Push the Miri changes to your rustc fork (substitute your github handle for YOUR_NAME).
@@ -286,3 +276,11 @@ up-to-date master branch:
286276
This will create a new branch called 'miri' in your fork, and the output should
287277
include a link to create a rustc PR that will integrate those changes into the
288278
main repository.
279+
280+
If this fails due to authentication problems, it can help to make josh push via ssh instead of
281+
https. Add the following to your `.gitconfig`:
282+
283+
```toml
284+
[url "git@github.com:"]
285+
pushInsteadOf = https://github.com/
286+
```

Cargo.lock

+11-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ rustc_version = "0.4"
4141
# Features chosen to match those required by env_logger, to avoid rebuilds
4242
regex = { version = "1.5.5", default-features = false, features = ["perf", "std"] }
4343
lazy_static = "1.4.0"
44+
# Require a version of serde without intransparent unreproducible binary blobs.
45+
serde = { version = "1.0.185", features = ["derive"] }
4446

4547
[package.metadata.rust-analyzer]
4648
# This crate uses #[feature(rustc_private)].

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,8 @@ Some native rustc `-Z` flags are also very relevant for Miri:
458458
Moreover, Miri recognizes some environment variables:
459459

460460
* `MIRI_AUTO_OPS` indicates whether the automatic execution of rustfmt, clippy and toolchain setup
461-
should be skipped. If it is set to any value, they are skipped. This is used for avoiding infinite
462-
recursion in `./miri` and to allow automated IDE actions to avoid the auto ops.
461+
should be skipped. If it is set to `no`, they are skipped. This is used to allow automated IDE
462+
actions to avoid the auto ops.
463463
* `MIRI_LOG`, `MIRI_BACKTRACE` control logging and backtrace printing during
464464
Miri executions, also [see "Testing the Miri driver" in `CONTRIBUTING.md`][testing-miri].
465465
* `MIRIFLAGS` (recognized by `cargo miri` and the test suite) defines extra

cargo-miri/Cargo.lock

+10-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cargo-miri/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ rustc-build-sysroot = "0.4.1"
2222

2323
# Enable some feature flags that dev-dependencies need but dependencies
2424
# do not. This makes `./miri install` after `./miri build` faster.
25-
serde = { version = "*", features = ["derive"] }
25+
# Require a version of serde without intransparent unreproducible binary blobs.
26+
serde = { version = "1.0.185", features = ["derive"] }
2627

2728
[build-dependencies]
2829
rustc_tools_util = "0.3"

ci.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function run_tests {
5252

5353
# Also run some many-seeds tests. 64 seeds means this takes around a minute per test.
5454
for FILE in tests/many-seeds/*.rs; do
55-
MIRI_SEEDS=64 CARGO_EXTRA_FLAGS="$CARGO_EXTRA_FLAGS -q" ./miri many-seeds ./miri run "$FILE"
55+
MIRI_SEEDS=64 ./miri many-seeds ./miri run "$FILE"
5656
done
5757

5858
# Check that the benchmarks build and run, but without actually benchmarking.

miri

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
set -e
33
# Instead of doing just `cargo run --manifest-path .. $@`, we invoke miri-script binary directly. Invoking `cargo run` goes through
44
# rustup (that sets it's own environmental variables), which is undesirable.
5-
cargo build -q --manifest-path "$(dirname "$0")"/miri-script/Cargo.toml
5+
cargo build $CARGO_EXTRA_FLAGS -q --manifest-path "$(dirname "$0")"/miri-script/Cargo.toml
66
"$(dirname "$0")"/miri-script/target/debug/miri-script "$@"

0 commit comments

Comments
 (0)