-
Notifications
You must be signed in to change notification settings - Fork 352
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
Explore using cargo-hakari to avoid duplicate builds between miri test
and miri run
#3372
Comments
One challenge might be that the crate can't be in a workspace -- this entire repository is embedded in the rustc repo as a subtree, and rustc makes Miri a workspace member, so Miri's Cargo.toml can't itself be declared a workspace root. @sunshowers is that a problem for hakari, or does it also work for non-workspace crates? |
Hmmm, interesting. I've never tried it on single-crate projects, but I wonder if there's a way to make it work with some creativity. For example you could have an outer Cargo.toml that does declare a workspace, and import miri as a subdirectory into the Rust tree (so the Rust tree never sees miri as a workspace, just as a crate). |
The subtree approach we are working doesn't let us do that I think. This repo here is basically just a projection of the |
Just using hakari on Miri fails:
I was hoping it could just consider this to be a single-crate workspace, but unfortunately that's not how it works. However, even if I make Miri into a workspace, I get a rather inscrutable error message:
|
I managed to get it to work by tweaking the workspace settings:
And that seems to work indeed. :) No more rebuilds in However we can't set this up for CI because we can't have this |
In the end I went with #3881 -- entirely avoiding the use of |
./miri test
and./miri run
currently each build their own copy of the Miri binary. The reasons for that are described here. The tool https://crates.io/crates/cargo-hakari is intended to help with cases like that when they arise in a workspace; maybe they also help with the situation of multiple crates within a single package.The text was updated successfully, but these errors were encountered: