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

Test a small cargo-miri smoke test even in run_tests_minimal #2690

Conversation

Noratrieb
Copy link
Member

This makes sure that cargo-miri works on all targets.

Implements the first step of #2685 (comment) to get that PR tested.

@Noratrieb
Copy link
Member Author

libtest needs std, right. So uh, how exactly should I do this test crate? It should be no_std, but how should I do this? no_std binaries are tricky and platform specific and this should work on all platforms (and the ones that don't support std are the more funky ones usually :D).

@RalfJung
Copy link
Member

RalfJung commented Nov 25, 2022 via email

@Noratrieb
Copy link
Member Author

Getting a no_std binary running is still platform specific. I tried getting one to work (just on x86_64-unknown-linux-gnu) and after adding panic = "abort" and a #[panic_handler] it still needs an entry point and I didn't quite figure out what the best way to do that would be. Adding a #[start] function yielded linker errors about mising libc symbols (since libc isn't linked anymore) and I assume fixing this would require platform specific code to link the right things.

@RalfJung
Copy link
Member

This is Miri, no linking should be required...

We successfully do run https://github.com/rust-lang/miri/blob/master/tests/pass/no_std.rs on no_std targets in our test suite. Does that not also work with cargo miri run?

@Noratrieb
Copy link
Member Author

Oh yes, this is Miri, I forgot about that :D

The example you have looks good, I think I can use that.

This makes sure that cargo-miri works on all targets.
@Noratrieb Noratrieb force-pushed the cargo-miri-smoke-test-ci-so-that-cargo-miri-actually-works-kinda branch from d7ace28 to ae96d6a Compare November 25, 2022 17:28
@@ -81,6 +81,10 @@ version = "0.1.0"
name = "issue_rust_86261"
version = "0.1.0"

[[package]]
name = "no-std-smoke"
version = "0.1.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is excluded, why is it listed in the lockfile...?

ci.sh Show resolved Hide resolved
@RalfJung
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Nov 26, 2022

📌 Commit d9b7035 has been approved by RalfJung

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Nov 26, 2022

⌛ Testing commit d9b7035 with merge c2eac58...

@bors
Copy link
Contributor

bors commented Nov 26, 2022

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing c2eac58 to master...

@bors bors merged commit c2eac58 into rust-lang:master Nov 26, 2022
@bors bors mentioned this pull request Nov 26, 2022
@Noratrieb Noratrieb deleted the cargo-miri-smoke-test-ci-so-that-cargo-miri-actually-works-kinda branch November 26, 2022 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants