Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Could you please supply a example for "command line options" ? #1194

Closed
ffanyq opened this issue Dec 3, 2022 · 2 comments
Closed

Could you please supply a example for "command line options" ? #1194

ffanyq opened this issue Dec 3, 2022 · 2 comments

Comments

@ffanyq
Copy link

ffanyq commented Dec 3, 2022

I'm extremely appreciative of your contribution to Rust community. As a beginner, however, it seems a little difficult for me to use some ancillary functions
(e.g. generate a callgraph)

I have been installed the sub-command mirai by
cargo install --locked --path ./checker.

And the MIRAI_FLAGS is set to --call_graph_config ./config
by the command MIRAI_FLAGS="--call_graph_config ./config.json" over my project workspace. The file named 'config.json' is blow:

{
    "call_sites_output_path": "path/to/call_sites.json",
    "dot_output_path": "path/to/graph.dot",
    "reductions": [
        {"Slice": "main"},
        "Fold",
        "Clean",
        "Deduplicate",
    ],
    "included_crates": ["sss"],
    "datalog_config": {
        "ddlog_output_path": "path/to/graph.dat" | "path/to/datalog/",
        "type_map_output_path": "path/to/types.json",
        "type_relations_path": "path/to/type_relations.json",
        "datalog_backend": "DifferentialDatalog" | "Souffle"
    },
}

Lastly, when I use the command cargo mirai, there is no output in my project workspace. But I don't know the correct steps for generating a callgraph.

@hermanventer
Copy link
Contributor

hermanventer commented Dec 6, 2022

Are the paths in your config file actual paths? Also, you have to choose the backend to be one of "DifferentialDatalog" or "Souffle", not both or either. Likewise ddlog_output_path should be a single path.

It will also help if you can run this with MIRAI_LOG=info and append the output to this issue.

@ffanyq
Copy link
Author

ffanyq commented Dec 8, 2022

Are the paths in your config file actual paths? Also, you have to choose the backend to be one of "DifferentialDatalog" or "Souffle", not both or either. Likewise ddlog_output_path should be a single path.

It will also help if you can run this with MIRAI_LOG=info and append the output to this issue.

Thanks for your help, this problem has solved. I forgot to set the flag RUSTC_WRAPPER=mirai.

@ffanyq ffanyq closed this as completed Dec 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants