immunant / c2rust

Migrate C code to Rust
https://c2rust.com/
Other
3.81k stars 220 forks source link

Use log crate for debugging output in c2rust-analyze #1102

Open ahomescu opened 2 weeks ago

ahomescu commented 2 weeks ago

Replace all eprintln! macros with uses of the log crate for more efficient and fine-grained debugging output.

spernsteiner commented 14 hours ago

This is a good idea, but it seems like it will be difficult to merge due to conflicts. Also, it seems like github won't run the CI (or at least doesn't show the CI results here) if it detects conflicts.

I'd suggest running the major CI checks locally first. This is quicker and involves less hassle than running the actual CI, especially given this issue with the conflicts. The major checks are cargo fmt --check (should output nothing; if it outputs a diff, run cargo fmt to apply the suggested changes), cargo check (should give no warnings), and cargo test. For cargo test in particular, you might need to adjust some log levels - a bunch of tests want to inspect the "final labeling for foo" output, which is currently at debug! level in this branch. Or it might be a good idea to let individual tests set their own RUST_LOG values (there's already some machinery for test-specific options that you could extend for this).

Once it's mostly working, you can try doing the procedure of: rebase + test locally + force push + wait for CI + merge. This part of the repo is fairly low-traffic, so I doubt it will be necessary to "close the tree" in order to get this merged.

kkysen commented 14 hours ago

You can also run the CI checks by running ./scripts/run_ci_checks.sh.