feat: refactor Charon.toml to use Cargo.toml and add support for start_from, hide_marker_traits#1104
feat: refactor Charon.toml to use Cargo.toml and add support for start_from, hide_marker_traits#1104oliver-butterley wants to merge 17 commits intoAeneasVerif:mainfrom
Conversation
|
I noticed there is an existing integration test for the config file ( Concrete possibilities:
Currently such tests are drafted in another branch (config-file-tests), let me know if they should be added to this PR. |
|
I kinda want to rip out Charon.toml and replace it with a |
|
would you wanna do taht instead? |
We are very flexible with our needs. Just needs to have something in order to have a convenient way to write the flags. E.g., our repos currently need to pass many flags like seen in this. |
OK! Will do. |
There was a problem hiding this comment.
Please merge these new tests into one, many cargo tests are not fun to have around.
|
Thanks for your patience! Summary of the latest updates following all the comments:
Note: Updated read_toml reads ./Cargo.toml directly like was done before for Charon.toml. It's possible that for Cargo.toml there is a specific procedure which should be used but searching I didn't find a solution which was clearly better than the current version. |
The Charon.toml config file previously supported only four fields (extract_opaque_bodies, include, opaque, exclude) and rustc flags.
This PR refactors the functionality to avoid the Charon.toml file and instead uses a [metadata] section in Cargo.toml. Moreover we extend functionality to cover other commonly-needed options:
The --help text for the
cargosubcommand now mentions that the [package.metadata.charon] section in Cargo.toml is read when present.Note: The charon option
presetis not exposed in the config. The rationale being that this depends on which tool will consume Charon's output rather than on the crate itself, so it doesn't belong in the crate's Cargo.toml.