-
Notifications
You must be signed in to change notification settings - Fork 2
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 cargo run-saw
command
#59
Comments
A related issue is that the name of the JSON file includes a cargo-generated hash that changes sometimes, such as when adding a library dependency, so we may need Another option would be to have |
Is there always only a single |
That's right. |
This is an awful hack but it seems to work
It's probably a better idea just to have |
On a clean build, there will be only one. But the filename includes a hash of crate metadata, so if you build, add/remove a dependency, and build again, you might end up with two different |
Currently, the process of going from a Rust project to a SAW file is somewhat clunky. You must undergo the following steps:
cargo saw-build
.linking <N> mir files into example.linked-mir.json
.example.linked-mir.json
file name from the build output..saw
file containingmir_load_module "example.linked-mir.json"
.This is all doable, but a bit tiresome. It would be convenient to have a
cargo run-saw
command that automates the process. That is, starting from a Rust project,cargo run-saw
would build the code, grab the name of the resulting MIR JSON file, and then emit a.saw
template that already contains the appropriate call tomir_load_module
. From there, users can build upon the.saw
template further, and if they need to rebuild their Rust code, they can usecargo saw-build
instead ofrun-saw
.This idea is similar in spirit to
cargo crux-test
's ability to generate a separate test script involving the compiled MIR JSON file, except thatrun-saw
's functionality would be separate fromsaw-build
.The text was updated successfully, but these errors were encountered: