Skip to content

-Ztime-passes and --message-format=json are incompatible #55508

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
matthiaskrgr opened this issue Oct 30, 2018 · 2 comments
Closed

-Ztime-passes and --message-format=json are incompatible #55508

matthiaskrgr opened this issue Oct 30, 2018 · 2 comments
Labels
A-driver Area: rustc_driver that ties everything together into the `rustc` compiler C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Oct 30, 2018

cargo new bla
cd bla
RUSTC_WRAPPER="" RUSTFLAGS="-Ztime-passes" cargo check --message-format=json --verbose
    Checking bla v0.1.0 (/tmp/bla)
     Running `rustc --edition=2018 --crate-name bla src/main.rs --color always --error-format json --crate-type bin --emit=dep-info,metadata -C debuginfo=2 -C metadata=72226aea1ba16fe0 -C extra-filename=-72226aea1ba16fe0 --out-dir /tmp/bla/target/debug/deps -C incremental=/tmp/bla/target/debug/incremental -L dependency=/tmp/bla/target/debug/deps -Ztime-passes`
error: Could not compile `bla`.

Caused by:
  failed to parse process output: `rustc --edition=2018 --crate-name bla src/main.rs --color always --error-format json --crate-type bin --emit=dep-info,metadata -C debuginfo=2 -C metadata=72226aea1ba16fe0 -C extra-filename=-72226aea1ba16fe0 --out-dir /tmp/bla/target/debug/deps -C incremental=/tmp/bla/target/debug/incremental -L dependency=/tmp/bla/target/debug/deps -Ztime-passes` (exit code: 0)

Caused by:
  compiler stdout is not empty: `  time: 0.000; rss: 49MB   parsing`

I was trying to debug a case where json message would eventually OOM my machine but apparently I cannot use time-passes for that :(

meta:

rustc 1.31.0-nightly (d586d5d2f 2018-10-29)
binary: rustc
commit-hash: d586d5d2f51489821b471f20959333558c24b129
commit-date: 2018-10-29
host: x86_64-unknown-linux-gnu
release: 1.31.0-nightly
LLVM version: 8.0
@matthiaskrgr matthiaskrgr changed the title -Ztime-passes --message-format=json incompatible -Ztime-passes and --message-format=json are incompatible Oct 30, 2018
@jonas-schievink jonas-schievink added A-driver Area: rustc_driver that ties everything together into the `rustc` compiler T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 27, 2019
@Enselic
Copy link
Member

Enselic commented Nov 18, 2023

Triage: Looks like this works now?

$ RUSTC_WRAPPER="" RUSTFLAGS="-Ztime-passes" cargo check --message-format=json --verbose
    Checking bla v0.1.0 (/home/martin/src/bla)
     Running `/home/martin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc --crate-name bla --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=198 --crate-type bin --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 -C metadata=6e4a690f2ea19ab3 -C extra-filename=-6e4a690f2ea19ab3 --out-dir /home/martin/src/bla/target/debug/deps -C incremental=/home/martin/src/bla/target/debug/incremental -L dependency=/home/martin/src/bla/target/debug/deps -Ztime-passes`
time:   0.002; rss:   38MB ->   42MB (   +3MB)  parse_crate
time:   0.003; rss:   42MB ->   44MB (   +2MB)  setup_global_ctxt
time:   0.001; rss:   44MB ->   46MB (   +2MB)  crate_injection
time:   0.031; rss:   46MB ->   58MB (  +12MB)  expand_crate
time:   0.031; rss:   46MB ->   58MB (  +12MB)  macro_expand_crate
time:   0.001; rss:   58MB ->   60MB (   +2MB)  late_resolve_crate
time:   0.004; rss:   58MB ->   60MB (   +2MB)  resolve_crate
time:   0.004; rss:   60MB ->   62MB (   +2MB)  looking_for_entry_point
time:   0.005; rss:   60MB ->   62MB (   +2MB)  misc_checking_1
time:   0.002; rss:   62MB ->   64MB (   +2MB)  type_collecting
time:   0.002; rss:   64MB ->   66MB (   +2MB)  item_types_checking
time:   0.016; rss:   62MB ->   70MB (   +8MB)  type_check_crate
time:   0.009; rss:   70MB ->   76MB (   +6MB)  MIR_borrow_checking
time:   0.001; rss:   76MB ->   85MB (   +8MB)  codegen_crate
time:   0.001; rss:   83MB ->   69MB (  -14MB)  free_global_ctxt
time:   0.084; rss:   30MB ->   65MB (  +35MB)  total
{"reason":"compiler-artifact","package_id":"bla 0.1.0 (path+file:///home/martin/src/bla)","manifest_path":"/home/martin/src/bla/Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"bla","src_path":"/home/martin/src/bla/src/main.rs","edition":"2021","doc":true,"doctest":false,"test":true},"profile":{"opt_level":"0","debuginfo":2,"debug_assertions":true,"overflow_checks":true,"test":false},"features":[],"filenames":["/home/martin/src/bla/target/debug/deps/libbla-6e4a690f2ea19ab3.rmeta"],"executable":null,"fresh":false}
{"reason":"build-finished","success":true}
    Finished dev [unoptimized + debuginfo] target(s) in 0.13s

@Enselic Enselic added the C-bug Category: This is a bug. label Nov 18, 2023
@ehuss
Copy link
Contributor

ehuss commented Nov 18, 2023

Indeed, I believe this was fixed by #64497.

@ehuss ehuss closed this as completed Nov 18, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-driver Area: rustc_driver that ties everything together into the `rustc` compiler C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants