-
Notifications
You must be signed in to change notification settings - Fork 58
feat: cargo CLI update target directory #1662
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
feat: cargo CLI update target directory #1662
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
I think the major comment is we should discuss and finalize the behavior first (or if we've done this before, we should document somewhere). e.g. do we always do keygen in prove/run even though key is already there?
Also the functions in global.rs
should have clear docs, as their names don't match what they do. (implicit build/keygen happens in get_xx
function
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
||
**Usage Example**: To build the guest binary in the `my_target` directory: | ||
**Description**: Name of the generated initialization file, which will be written into the manifest directory. |
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.
what's init file?
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.
I believe it's a .rs
file that contains setup macros (ex. moduli_init
, sw_init
, etc.) for a guest program? The idea being that given your config openvm.toml
, it will auto-generate those macros so the user doesn't need to worry about them.
|
||
**Description**: Restricts the build to the example target with the given name, similar to `cargo build --example <NAME>`. Projects often include code samples or demos under the examples directory, and this flag focuses on compiling a specific example. | ||
By default all package libraries and binaries will be built. To build samples or demos under the `examples` directory, use either the `--example` or `--examples` option. |
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.
how do we decide which one to transpile
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.
All targets that are built are transpiled
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
book/src/writing-apps/build.md
Outdated
|
||
- `--manifest-dir <MANIFEST_DIR>` | ||
Generally, outputs will always be built to the **target directory**, which will either be determined by the manifest path or explicitly set using the `--target-dir` option. OpenVM-specific artifacts will be placed in `${target_dir}/openvm/`, but if `--output-dir` is specified they will be copied to `${output-dir}/` as well. |
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.
might be worth to mention the default target directory when not explicitly set
```bash | ||
cargo openvm build --example my_example | ||
``` | ||
**Description**: Builds the package's library. |
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.
when is this useful? i thought the use case always involves some kind of executable?
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.
Doesn't really do anything special, mainly here for alignment with cargo build
. I guess it will build the library to the risc0 target?
Commit: e69505c |
Resolves INT-3882, and records changes in the book as per INT-4038. Most importantly, reworks command outputs to primarily use the
target/
directory that Cargo uses and assumes full control over.target_dir
; if unspecified,cargo openvm
will use the Cargo default${target_dir}/openvm/
, while all other artifacts are stored in${target_dir}/openvm/${profile}
${output_dir}
.
, as this file should generally be the final outputOther changes include:
build
no longer generates app commitsrun
will callbuild
before attempting to executeprove
will callbuild
before attempting to generate a proofevm-proving-setup
with references tosetup
openvm.toml
's default location is in the working directory instead of.
The basic workflow should now be
cargo openvm prove ...
intocargo openvm verify ...
.