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

compiletest: call cargo-miri directly rather than via 'cargo run' #3318

Merged
merged 1 commit into from
Feb 24, 2024

Conversation

RalfJung
Copy link
Member

Fixes #3297. Thanks to @bjorn3 for figuring out the cause of this.

r? @oli-obk

@rustbot
Copy link
Collaborator

rustbot commented Feb 24, 2024

Error: The feature assign is not enabled in this repository.
To enable it add its section in the triagebot.toml in the root of the repository.

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.

// Set the `cargo-miri` binary, which we expect to be in the same folder as the `miri` binary.
// (It's a separate crate, so we don't get an env var from cargo.)
let mut prog = miri_path();
prog.set_file_name("cargo-miri");
Copy link
Member

Choose a reason for hiding this comment

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

This needs the .exe extension on Windows, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Does it?

I guess CI will tell...

Copy link
Contributor

@RossSmyth RossSmyth Feb 24, 2024

Choose a reason for hiding this comment

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

".exe" is in the PATHEXT env var so it should just execute (that's how my miri.bat file works). Though since this is executed in bash on msys2 I'm not sure if that applies or not as I do not use that. But CI seems to be doing something.

Copy link
Member

Choose a reason for hiding this comment

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

I thought PATHEXT only applied to cmd.exe and ShellExecute and not CreateProcess. std::process::Command uses CreateProcessW. The documentation of CreateProcessW doesn't mention whether or not it does apply

Copy link
Member Author

Choose a reason for hiding this comment

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

Windows CI seems to be working so it does seem to add the .exe. 🤷

Copy link
Member

Choose a reason for hiding this comment

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

Command, for security reasons, uses its own logic for finding the exe and for compatibility reasons it always assumes .exe was intended if no extension is present.

Copy link
Member Author

@RalfJung RalfJung Feb 24, 2024

Choose a reason for hiding this comment

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

@ChrisDenton do you magically show up when someone says the word "Windows" in a Rust repo? ;)

Anyway, thanks for the explanation! :)

Copy link
Member

Choose a reason for hiding this comment

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

Yes, but only if the proper rituals are observed

@oli-obk
Copy link
Contributor

oli-obk commented Feb 24, 2024

Will that work on a clean build running ./miri test tests/pass-dep? If not, we should at least provide some useful diagnostic to the user

@bjorn3
Copy link
Member

bjorn3 commented Feb 24, 2024

It should. miri-script already builds cargo-miri before running the test suite.

@RalfJung
Copy link
Member Author

Yes, cargo clean && ./miri test tests/pass-dep still works.

@oli-obk
Copy link
Contributor

oli-obk commented Feb 24, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Feb 24, 2024

📌 Commit fc3bd52 has been approved by oli-obk

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Feb 24, 2024

⌛ Testing commit fc3bd52 with merge 3fe1097...

@bors
Copy link
Contributor

bors commented Feb 24, 2024

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

@bors bors merged commit 3fe1097 into rust-lang:master Feb 24, 2024
8 checks passed
@RalfJung RalfJung deleted the compiletest-rebuilds branch February 25, 2024 07:13
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.

"./miri test" is very slow on repeated executions
7 participants