Closed Mandragorian closed 2 months ago
I mean, we need a loop for
setup
I think we actually need support in rustc-build-sysroot for passing through the full list of targets to Cargo, not a loop.
Why should calling setup
in a loop not work?
Ah, bad phrasing. It will work, but we don't need to use a loop. It would be much faster to let Cargo run all the sysroot builds in parallel.
Ah, that's what you mean. Yeah makes sense. It also complicates the copying and printing logic, though.
We can leave that as a future possibility though, it doesn't have to happen in this PR.
Looking into the code more, I see that if I don't loop I get an error that error: only one --target argument is supported
, which I think originates from cargo
and not miri
.
I also realized that the loop as I had set it up wouldn't work since exec(cmd)
never returns. Multiple targets are only supported for the build
subcommand. So I think that if we want to support running/testing for all targets specified in miri, we might need to spawn the command in a loop after all.
Multiple targets are only supported for the build subcommand.
Wait, really? We intend to mirror cargo test
. If cargo test
does not support multiple targets then I don't think we should, either.
But I was sure I checked this, see this comment.
ah my bad. I actually run cargo miri run
instead of test
. sorry for the confusion.
@rustbot ready
@rustbot author
@rustbot ready
This looks great, thanks. :)
Can you please squash this into a single commit? (ideally while keeping the same base commit so that the force-push has an empty diff)
This looks great, thanks. :)
Can you please squash this into a single commit? (ideally while keeping the same base commit so that the force-push has an empty diff)
done!
Great, thanks!
@bors r+
:pushpin: Commit 471dcec041122b1bba8ab4fd8085f88e3bd275ff has been approved by RalfJung
It is now in the queue for this repository.
:hourglass: Testing commit 471dcec041122b1bba8ab4fd8085f88e3bd275ff with merge cdaa4d595545623cce8e94ee1de4920a392b95a1...
:sunny: Test successful - checks-actions Approved by: RalfJung Pushing cdaa4d595545623cce8e94ee1de4920a392b95a1 to master...
Currently cargo-miri uses the first target specified in the command line. However, when multiple targets are specified in a
cargo build
invocation, cargo will build for all of them.Miri should match this behaviour to reduce surprises.
Fixes: #3460