Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

saw-rustc --version panics (but crux-rustc --version doesn't) #50

Open
RyanGlScott opened this issue Aug 15, 2023 · 1 comment
Open
Labels

Comments

@RyanGlScott
Copy link
Contributor

While crux-rustc --version works as you would expect:

$ crux-rustc --version
normal build - ["rustc", "--version", "--target", "x86_64-unknown-linux-gnu", "--cfg", "crux"]
rustc 1.69.0-nightly (5e37043d6 2023-01-22)

saw-rustc --version, on the other hand, will panic:

$ RUST_BACKTRACE=1 saw-rustc --version
test build - extract output path - ["rustc", "--version", "--test", "--target", "x86_64-unknown-linux-gnu", "--cfg", "crux"]
rustc 1.69.0-nightly (5e37043d6 2023-01-22)
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/bin/mir-json-rustc-wrapper.rs:86:27
stack backtrace:
   0: rust_begin_unwind
             at /rustc/5e37043d63bfe2f3be8fa5a05b07d6c0dad5775d/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/5e37043d63bfe2f3be8fa5a05b07d6c0dad5775d/library/core/src/panicking.rs:64:14
   2: core::panicking::panic
             at /rustc/5e37043d63bfe2f3be8fa5a05b07d6c0dad5775d/library/core/src/panicking.rs:114:5
   3: mir_json_rustc_wrapper_real::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

The backtrace points to this line as the culprit:

callbacks.output_path.unwrap()

I'm somewhat surprised by this, given how similar the two commands are. At first glance, one possible explanation is that saw-rustc calls rustc with --test, but crux-rustc does not.

@RyanGlScott
Copy link
Contributor Author

See also #77. I suspect that we may need to reimplement some or all of the logic that powers the --version option in order to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant