cargo bloat prints json-time on stderr
jvimal opened this issue · 8 comments
I installed cargo bloat on a Mac and the functionality is great and useful. However, after running cargo bloat --crates --time
, I am seeing output like this every time I run any cargo command (build, clippy, etc.):
json-time {"crate_name":"derive_builder_macro","time":1492788223,"build_script":false}
json-time {"crate_name":"git2","time":6255647714,"build_script":false}
json-time {"crate_name":"build_info_proc","time":4735568231,"build_script":false}
json-time {"crate_name":"syntex_syntax","time":25882835499,"build_script":false}
json-time {"crate_name":"tonic_build","time":2963543957,"build_script":false}
json-time {"crate_name":"build_info_build","time":2070763756,"build_script":false}
json-time {"crate_name":"derive_builder","time":536162450,"build_script":false}
json-time {"crate_name":"rustfmt","time":9911235635,"build_script":false}
This happens even after I uninstall cargo bloat, which is very weird, as I see that the output is indeed generated by this script: https://github.com/RazrFalcon/cargo-bloat/blob/master/src/main.rs#L423-L428. I verified that there is no binary named cargo-bloat
inside ~/.cargo/bin.
This is driving me a bit crazy, lol. Any cargo experts here can help me figure out why this is happening?
unset RUSTC_WRAPPER
?
I obviously cannot reproduce it. Something is wrong with your terminal emulator.
@RazrFalcon thanks for the quick response. I checked my env variables and there is no RUSTC_WRAPPER. I also unset it, tried bash, zsh, sh on both iTerm2 and Terminal.app, and I still encounter the issue.
I tired it on another rust project, and I don't see the json-time
output. One difference is that the project where I see the issue is a cargo workspace, the other project is not.
Just reboot.
cargo bloat doesn't do anything. It simply sets RUSTC_WRAPPER
temporarily. Something is wrong with your machine.
I rebooted and I still saw the issue; however, I did a cargo clean
and that seems to have solved the issue.
Was finally able to reproduce it. Looks like this is because of Rust's incremental compilation. We have to run cargo clean
automatically.
What I see is that the target/release/.fingerprint//output- files have this extra content in them from the rebuild, and cargo is essentially printing this cached output, which is a little annoying.
Deleting these files is another workaround to get rid of this output.