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

Fails when a rustc wrapper like sccache is set #55

Closed
amousset opened this issue Aug 3, 2022 · 7 comments
Closed

Fails when a rustc wrapper like sccache is set #55

amousset opened this issue Aug 3, 2022 · 7 comments
Labels
bug Something isn't working third party Work item for a third-party dependency

Comments

@amousset
Copy link
Contributor

amousset commented Aug 3, 2022

Having a rustc wrapper defined (like build caching with RUSTC_WRAPPER=sccache) makes build fail:

$ export RUSTC_WRAPPER=sccache
$ cargo auditable build --release
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/amousset/.cargo/bin/sccache /home/amousset/.cargo/bin/cargo-auditable rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit status: 2)
  --- stderr
  sccache: error: failed to execute compile
  sccache: caused by: Compiler not supported: "Unrecognized command: \"-E\"\n"
@amousset
Copy link
Contributor Author

amousset commented Aug 3, 2022

This is because RUSTC_WORKSPACE_WRAPPER doesn't work well with sccache. clippy has run into the same problem, finally fixed by adding a special case to handle it in sccache.

@Shnatsel
Copy link
Member

Shnatsel commented Aug 3, 2022

Yeah, looks like sccache compiler detection just doesn't work with RUSTC_WORKSPACE_WRAPPER. It fails to realize that we're invoking rustc, and complains about an unsupported compiler. Looks like it will need to be fixed in sccache.

I don't want to add ourselves as another special case. A more robust approach to this would be looking at the second argument as well, not just the first one, to determine the kind of the executable. This can be done either unconditionally, or only if RUSTC_WORKSPACE_WRAPPER is set and matches the name of the executable.

I'd be grateful if someone could take care of the issue report and/or PR to sccache - I'll be rather pressed for time until the weekend.

@amousset
Copy link
Contributor Author

amousset commented Aug 3, 2022

I'll try to make a proper fix for sccache.

@Shnatsel Shnatsel added the third party Work item for a third-party dependency label Aug 5, 2022
@Shnatsel
Copy link
Member

I've reported the issue to sccache: mozilla/sccache#1274

@Shnatsel Shnatsel added the bug Something isn't working label Aug 11, 2022
@Shnatsel
Copy link
Member

Shnatsel commented Sep 6, 2022

A PR fixing this in sccache is up: mozilla/sccache#1280

@Shnatsel
Copy link
Member

Shnatsel commented Sep 18, 2022

This is fixed in sccache git master; closing.

@Shnatsel
Copy link
Member

Shnatsel commented Dec 1, 2022

The fix has shipped in sccache v0.3.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working third party Work item for a third-party dependency
Projects
None yet
Development

No branches or pull requests

2 participants