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

Run cargo miri test on wasm and riscv target once they're supported #22

Open
joshlf opened this issue Oct 4, 2022 · 8 comments
Open
Labels
blocked-on-rust Blocked on a Rust feature landing or stabilizing compatibility-nonbreaking Changes that are (likely to be) non-breaking

Comments

@joshlf
Copy link
Member

joshlf commented Oct 4, 2022

Currently, Miri doesn't support any wasm target (see #22 (comment)). Once one is supported, we should run cargo miri test on a wasm target in CI.

EDIT: This appears to also be true of riscv64gc-unknown-linux-gnu, although I haven't found it documented anywhere.

Old issue text

This job failed for reasons that seem specific to running cargo miri test with the target set to wasm32-wasi. I'm going to disable the test for the time being.

Thanks to @frazar for discovering rust-lang/miri#1916, which suggests that Miri lacks support for some wasm32 targets. The task for this issue now is to a) determine whether any wasm32 targets are supported, b) switch to using a supported one if so or, c) skip running Miri when targetting wasm32 if none are supported.

@frazar
Copy link
Contributor

frazar commented Oct 10, 2022

Reading the comments to a relevant issue in the miri repo (rust-lang/miri#1916), it seems like miri does not support wasm32-unknown-unknown.

Maybe I misuderstood something?

@joshlf
Copy link
Member Author

joshlf commented Oct 10, 2022

Oh good find! Updated the issue description based on that.

@joshlf joshlf added experience-easy This issue is easy, and shouldn't require much experience good first issue Good for newcomers labels Oct 15, 2022
@memark
Copy link
Contributor

memark commented Oct 17, 2022

I can take a look!

@joshlf
Copy link
Member Author

joshlf commented Oct 17, 2022

Thanks! Assigned to you.

@memark
Copy link
Contributor

memark commented Oct 17, 2022

My investigation suggests that miri doesn't support any of the wasm32 targets as they all give the same error.

> rustup +nightly-2022-09-26 target list | rg wasm32
wasm32-unknown-emscripten
wasm32-unknown-unknown
wasm32-wasi

wasm32-unknown-emscripten

> cargo +nightly-2022-09-26 miri test --target wasm32-unknown-emscripten --features "" -- --skip ui
Preparing a sysroot for Miri (target: wasm32-unknown-emscripten)... done
   Compiling zerocopy v0.7.0-alpha (/Users/memark/Src/zerocopy)
    Finished test [unoptimized + debuginfo] target(s) in 0.04s
     Running unittests src/lib.rs (target/miri/wasm32-unknown-emscripten/debug/deps/zerocopy-cad9098b3780266a.js)
fatal error: file "/Users/memark/Src/zerocopy/target/miri/wasm32-unknown-emscripten/debug/deps/zerocopy-cad9098b3780266a.js" not found or `cargo-miri` invoked incorrectly; please only invoke this binary through `cargo miri`
error: test failed, to rerun pass `--lib`

Caused by:
  process didn't exit successfully: `/Users/memark/.rustup/toolchains/nightly-2022-09-26-aarch64-apple-darwin/bin/cargo-miri runner /Users/memark/Src/zerocopy/target/miri/wasm32-unknown-emscripten/debug/deps/zerocopy-cad9098b3780266a.js --skip ui` (exit status: 1)

wasm32-unknown-unknown

> cargo +nightly-2022-09-26 miri test --target wasm32-unknown-unknown -- --skip ui
Preparing a sysroot for Miri (target: wasm32-unknown-unknown)... done
   Compiling zerocopy v0.7.0-alpha (/Users/memark/Src/zerocopy)
    Finished test [unoptimized + debuginfo] target(s) in 0.04s
     Running unittests src/lib.rs (target/miri/wasm32-unknown-unknown/debug/deps/zerocopy-f4099b17079841af.wasm)
fatal error: file "/Users/memark/Src/zerocopy/target/miri/wasm32-unknown-unknown/debug/deps/zerocopy-f4099b17079841af.wasm" not found or `cargo-miri` invoked incorrectly; please only invoke this binary through `cargo miri`
error: test failed, to rerun pass `--lib`

Caused by:
  process didn't exit successfully: `/Users/memark/.rustup/toolchains/nightly-2022-09-26-aarch64-apple-darwin/bin/cargo-miri runner /Users/memark/Src/zerocopy/target/miri/wasm32-unknown-unknown/debug/deps/zerocopy-f4099b17079841af.wasm --skip ui` (exit status: 1)

wasm32-wasi

> cargo +nightly-2022-09-26 miri test --target wasm32-wasi -- --skip ui
Preparing a sysroot for Miri (target: wasm32-wasi)... done
   Compiling zerocopy v0.7.0-alpha (/Users/memark/Src/zerocopy)
    Finished test [unoptimized + debuginfo] target(s) in 0.04s
     Running unittests src/lib.rs (target/miri/wasm32-wasi/debug/deps/zerocopy-f11f6b13dd8fddc2.wasm)
fatal error: file "/Users/memark/Src/zerocopy/target/miri/wasm32-wasi/debug/deps/zerocopy-f11f6b13dd8fddc2.wasm" not found or `cargo-miri` invoked incorrectly; please only invoke this binary through `cargo miri`
error: test failed, to rerun pass `--lib`

Caused by:
  process didn't exit successfully: `/Users/memark/.rustup/toolchains/nightly-2022-09-26-aarch64-apple-darwin/bin/cargo-miri runner /Users/memark/Src/zerocopy/target/miri/wasm32-wasi/debug/deps/zerocopy-f11f6b13dd8fddc2.wasm --skip ui` (exit status: 1)

@joshlf joshlf changed the title Miri can't run tests for wasm32-wasi target Run cargo miri test on a wasm target once one is supported Oct 17, 2022
@joshlf
Copy link
Member Author

joshlf commented Oct 17, 2022

OK great, thanks @memark! Updated the issue description based on your findings.

@joshlf joshlf removed good first issue Good for newcomers Hacktoberfest experience-easy This issue is easy, and shouldn't require much experience labels Oct 17, 2022
@RalfJung
Copy link

My investigation suggests that miri doesn't support any of the wasm32 targets as they all give the same error.

Indeed, rust-lang/miri#1916 affects all wasm targets. I have hardly any wasm knowledge so I am not sure how to even test potential fixes. The first step would be to add .wasm around here, but then I don't know how to tell if the result makes any sense.

@RalfJung
Copy link

FWIW rust-lang/miri#2685 should help here. Miri still barely supports any FFI shims on wasm targets, but at least cargo miri run on an empty crate works now.

@joshlf joshlf added the compatibility-nonbreaking Changes that are (likely to be) non-breaking label Aug 12, 2023
@joshlf joshlf changed the title Run cargo miri test on a wasm target once one is supported Run cargo miri test on wasm and riscv target once they're supported Aug 16, 2023
joshlf added a commit that referenced this issue Aug 16, 2023
We disable Miri testing for this target because it doesn't appear to be
supported (see #22 and [1]).

[1] https://github.com/google/zerocopy/actions/runs/5883275147/job/15955625276?pr=269
joshlf added a commit that referenced this issue Aug 16, 2023
We disable Miri testing for this target because it doesn't appear to be
supported (see #22 and [1]).

[1] https://github.com/google/zerocopy/actions/runs/5883275147/job/15955625276?pr=269
joshlf added a commit that referenced this issue Aug 16, 2023
We disable Miri testing for this target because it doesn't appear to be
supported (see #22 and [1]).

[1] https://github.com/google/zerocopy/actions/runs/5883275147/job/15955625276?pr=269
joshlf added a commit that referenced this issue Aug 16, 2023
We disable Miri testing for this target because it doesn't appear to be
supported (see #22 and [1]).

[1] https://github.com/google/zerocopy/actions/runs/5883275147/job/15955625276?pr=269
@joshlf joshlf mentioned this issue Aug 20, 2023
joshlf added a commit that referenced this issue Aug 23, 2023
We disable Miri testing for this target because it doesn't appear to be
supported (see #22 and [1]).

[1] https://github.com/google/zerocopy/actions/runs/5883275147/job/15955625276?pr=269
joshlf added a commit that referenced this issue Aug 23, 2023
We disable Miri testing for this target because it doesn't appear to be
supported (see #22 and [1]).

[1] https://github.com/google/zerocopy/actions/runs/5883275147/job/15955625276?pr=269
joshlf added a commit that referenced this issue Feb 13, 2024
@joshlf joshlf added the blocked-on-rust Blocked on a Rust feature landing or stabilizing label Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked-on-rust Blocked on a Rust feature landing or stabilizing compatibility-nonbreaking Changes that are (likely to be) non-breaking
Projects
None yet
Development

No branches or pull requests

4 participants