Repository navigation
Fix target selection for MIR Linker - #1789
Conversation
When running MIR Linker with multiple targets (e.g., unit tests), we were failing to compile since the call to `cargo rustc` would have multiple targets. Invoke separate calls for each target for now.
tedinski
left a comment
There was a problem hiding this comment.
What's left to solve #1448 ? Not asking for it in this PR, just curious.
I'm guessing we still just link all the generated goto binaries together, so the next step would be not doing that, and tracking which binary each proof harness is in?
|
|
||
| /// Extract the targets inside a package. | ||
| /// If `--tests` is given, the list of targets will include any integration tests. | ||
| fn package_targets(args: &KaniArgs, package: &Package) -> Vec<Vec<String>> { |
There was a problem hiding this comment.
Part of me wants a type here, but can you at least clarify what the return value is? e.g. this apprears to be arguments?
There was a problem hiding this comment.
I thought about creating a type, but it would end up being a bit messy, since you end up with 2 args for --tests and --bin but only one for --lib. This would create more branches later when translating it to arguments. So I ended up keeping it simple and just using Vec<Vec<_>>.
Yes, linking is still a problem, but I think it might be the only one left. Note that I had to slightly change the names of the harnesses in each crate of the example, otherwise they would conflict with each other. |
|
I added a little |
Description of changes:
When running MIR Linker with multiple targets (e.g., integration tests), we were failing to compile since the call to
cargo rustcwould have multiple targets.Invoke separate calls for each target for now.
Resolved issues:
Resolves #1764
Related RFC:
Call-outs:
I was wondering if it's worth suppressing cargo's messages and printing our own (in a follow up PR). The output is not great right now since it just have some multiple cargo logs in sequence. For the test below, you would get the following:
Details
Testing:
How is this change tested? New test
Is this a refactor change? No
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.