-
Notifications
You must be signed in to change notification settings - Fork 100
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
Add --mir-linker
flag and wire it up to the compiler
#1652
Add --mir-linker
flag and wire it up to the compiler
#1652
Conversation
Since the MIR linker hasn't been hooked up yet, the compiler will fail if this option is selected as shown by the new tests.
--mir-linker
and wire it up to the compiler--mir-linker
flag and wire it up to the compiler
rand = "0.8.4" | ||
|
||
[package.metadata.kani] | ||
flags = { mir-linker=true, enable-unstable=true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No expected file for this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops. Thanks for the call out.
kani-driver/src/call_cargo.rs
Outdated
.env("RUSTFLAGS", "--kani-flags") | ||
.env("KANIFLAGS", flag_env); | ||
// Only joing them at the end. All kani flags must come first. | ||
kani_args.append(&mut rustc_args); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
&mut? oh, wait this says append not extend. IMO extend
is cleaner because it avoids needing the mut
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I'll use extend_from_slice()
.
Description of changes:
This change adds the
--mir-linker
option tokani-driver
and--reachability=[none | legacy | harnesses]
to the compiler. I also changedcargo kani
to invokecargo rustc
instead ofcargo [build | tests]
so the reachability flag is passed at the right moment.Resolved issues:
Resolves #1617
Related RFC:
#1600
Call-outs:
cargo rustc -- --reachability=harnesses
will inject the argument--reachability=harness
in the middle of the compiler flags. Thus, it has to be extracted from rustc args. :(Testing:
How is this change tested?
Is this a refactor change?
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.