Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update Miri #103392

Merged
merged 67 commits into from
Oct 25, 2022
Merged

update Miri #103392

merged 67 commits into from
Oct 25, 2022

Conversation

RalfJung
Copy link
Member

I had to use a hacked version of josh to create this, so let's be careful with merging this and maybe wait a bit to see if the josh issue becomes more clear. But the history looks good to me, we are not adding duplicates of rustc commits that were previously mirrored to Miri.

Also I want to add some cross-testing of Miri in x.py.

RalfJung and others added 30 commits October 7, 2022 14:29
remove FFI support for macOS

We're only testing this on Linux, and `@thomcc` reports that libffi on macOS is a pain, so let's just disable this for now.
I think cargo has a bug here: rust-lang/cargo#11191
but for now we bless its output so that we can keep CI green
initial josh subtree sync

This demonstrates what a josh-based rustup would look like with my patched josh. To create it I did
```
git fetch http://localhost:8000/rust-lang/rust.git:start=75dd959a3a40eb5b4574f8d2e23aa6efbeb33573[:prefix=src/tools/miri]:/src/tools/miri.git master
git merge FETCH_HEAD
./rustup-toolchain HEAD && ./miri fmt
git commit -am rustup
```
Unlike the [previous attempt](rust-lang/miri#2554), this does not add a new root commit to the repo.

Once we merge this, we committed to using josh for subtree syncing, and in particular a version of josh that includes josh-project/josh#961 (or something compatible).
add josh instructions

This explains how to sync Miri changes to and from rustc.
- cache RTIM for the style checks
- disable fail-fast for main checks so that we can see whether the other jobs are green
CI improvements

- cache RTIM for the style checks
- disable fail-fast for main checks so that we can see whether the other jobs are green
print the target also when running tests on the host

That makes errors a bit easier to analyze.
…-obk

Ideas on getting information about borrow stacks during execution

From time to time people ask what some borrow stack looks like in some code. I just know that I am terrible at doing Stacked Borrows by hand, so I always toss together something like this.

I know that Miri has logging, but I've never found it particularly useful because there's just too much output. Also I personally don't think about exactly what the state of a borrow stack is, but this seems to be something that newcomers to Stacked Borrows always want.

Update: This has been sitting as S-waiting-on-author for a long time. I bring it out from time to time to explain Stacked Borrows to people, and just now `@JakobDegen` said
>  Can we please merge that btw? It's such a valuable teaching tool
>  Interfaces can be fixed later

I'm inclined to trust Jake's judgement here.
@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 24, 2022
@matthiaskrgr
Copy link
Member

@bors p=1 (submodule update)

@bors
Copy link
Contributor

bors commented Oct 25, 2022

⌛ Testing commit 84e6732 with merge c6a9053f8b1e55775ac26c500a1d1f675a5c4dee...

@bors
Copy link
Contributor

bors commented Oct 25, 2022

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 25, 2022
@rust-log-analyzer

This comment has been minimized.

@RalfJung
Copy link
Member Author

RalfJung commented Oct 25, 2022

That is some very strange log

     Running `build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\release\cargo-miri.exe miri test --manifest-path D:\a\rust\rust\src/tools/miri/test-cargo-miri/Cargo.toml --target i686-pc-windows-msvc --tests --`
   Compiling byteorder v1.4.3
   Compiling exported_symbol_dep v0.1.0 (D:\a\rust\rust\src\tools\miri\test-cargo-miri\exported-symbol-dep)
   Compiling issue_rust_86261 v0.1.0 (D:\a\rust\rust\src\tools\miri\test-cargo-miri\issue-rust-86261)
   Compiling cargo-miri-test v0.1.0 (D:\a\rust\rust\src\tools\miri\test-cargo-miri)
   Compiling issue_1691 v0.1.0 (D:\a\rust\rust\src\tools\miri\test-cargo-miri\issue-1691)
   Compiling byteorder v0.5.3
   Compiling exported_symbol v0.1.0 (D:\a\rust\rust\src\tools\miri\test-cargo-miri\exported-symbol)
   Compiling issue_1567 v0.1.0 (D:\a\rust\rust\src\tools\miri\test-cargo-miri\issue-1567)
   Compiling cdylib v0.1.0 (D:\a\rust\rust\src\tools\miri\test-cargo-miri\cdylib)
   Compiling issue_1705 v0.1.0 (D:\a\rust\rust\src\tools\miri\test-cargo-miri\issue-1705)
    Finished test [unoptimized + debuginfo] target(s) in 1.30s
     Running unittests src\main.rs (build\x86_64-pc-windows-msvc\stage2-tools\miri\i686-pc-windows-msvc\debug\deps\cargo_miri_test-0f976196cd517b80.exe)

running 2 tests
test test::dev_dependency ... ok
test test::exported_symbol ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running tests\main.rs (build\x86_64-pc-windows-msvc\stage2-tools\miri\i686-pc-windows-msvc\debug\deps\main-991d0e7eee076530.exe)
imported main
     Running tests\test.rs (build\x86_64-pc-windows-msvc\stage2-tools\miri\i686-pc-windows-msvc\debug\deps\test-5a629d2bcf30ccfb.exe)

running 6 tests
test cargo_env ... ok
test deps ... ok
test do_panic - should panic ... ok
test does_not_work_on_miri ... ignored
test fail_index_check - should panic ... ok
test simple ... ok

test result: ok. 5 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out

[TIMING] test::Miri { stage: 2, host: x86_64-pc-windows-msvc, target: i686-pc-windows-msvc } -- 101.188
Build completed successfully in 0:01:46
Building rustbuild
    Finished dev [unoptimized] target(s) in 0.12s
warning: the following packages contain code that will be rejected by a future version of Rust: ntapi v0.3.7
note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 8`
thread 'main' panicked at '

couldn't find required command: "cc"

', sanity.rs:59:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Build completed unsuccessfully in 0:00:00

Which part of the build is trying to run cc here? This should just be doing cargo miri test and it works fine on Miri's CI...

The panic seems to come from bootstrap

panic!("\n\ncouldn't find required command: {:?}\n\n", cmd.as_ref());

but I don't know why that code even runs.
Cc @jyn514

@RalfJung
Copy link
Member Author

Oh, this is probably not from the cargo miri test, but from the next thing checktools does

python3 "$X_PY" test --stage 2 src/tools/miri --target aarch64-apple-darwin

Looks like some part of x.py decides that it makes no sense to run this command without cc. Sadly that heuristic is wrong, Miri tests work fine on any host and don't need such tools to be installed.

I think for now I will remove the apple part from CI here, that doesn't need to block the other parts of this PR.

@RalfJung
Copy link
Member Author

Opened #103519 to track the macOS testing.

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Oct 25, 2022

📌 Commit a157e0e has been approved by oli-obk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 25, 2022
@bors
Copy link
Contributor

bors commented Oct 25, 2022

⌛ Testing commit a157e0e with merge 85d089b...

@bors
Copy link
Contributor

bors commented Oct 25, 2022

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 85d089b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 25, 2022
@bors bors merged commit 85d089b into rust-lang:master Oct 25, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 25, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (85d089b): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.3% [-4.3%, -4.3%] 1
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Footnotes

  1. the arithmetic mean of the percent change 2

  2. number of relevant changes 2

@RalfJung RalfJung deleted the miri branch October 26, 2022 10:21
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 21, 2022
update Miri

I had to use a hacked version of josh to create this, so let's be careful with merging this and maybe wait a bit to see if the josh issue becomes more clear. But the history looks good to me, we are not adding duplicates of rustc commits that were previously mirrored to Miri.

Also I want to add some cross-testing of Miri in x.py.
bjorn3 pushed a commit to bjorn3/rust that referenced this pull request Dec 14, 2022
update Miri

I had to use a hacked version of josh to create this, so let's be careful with merging this and maybe wait a bit to see if the josh issue becomes more clear. But the history looks good to me, we are not adding duplicates of rustc commits that were previously mirrored to Miri.

Also I want to add some cross-testing of Miri in x.py.
Aaron1011 pushed a commit to Aaron1011/rust that referenced this pull request Jan 6, 2023
update Miri

I had to use a hacked version of josh to create this, so let's be careful with merging this and maybe wait a bit to see if the josh issue becomes more clear. But the history looks good to me, we are not adding duplicates of rustc commits that were previously mirrored to Miri.

Also I want to add some cross-testing of Miri in x.py.
antoyo pushed a commit to antoyo/rust that referenced this pull request Jun 19, 2023
update Miri

I had to use a hacked version of josh to create this, so let's be careful with merging this and maybe wait a bit to see if the josh issue becomes more clear. But the history looks good to me, we are not adding duplicates of rustc commits that were previously mirrored to Miri.

Also I want to add some cross-testing of Miri in x.py.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.