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

Clang response files break ccache #119779

Closed
Kha opened this issue Apr 18, 2021 · 1 comment · Fixed by #178280
Closed

Clang response files break ccache #119779

Kha opened this issue Apr 18, 2021 · 1 comment · Fixed by #178280
Labels
0.kind: bug Something is broken

Comments

@Kha
Copy link
Contributor

Kha commented Apr 18, 2021

Describe the bug
#112449 hides clang arguments in a "response file" by default if isClang is true, but ccache does not support this and responds with "no input files" instead.

Additional context
The following workaround can be used to disable response files in a ccacheWrapper result cc, fixing the issue:

  cc.overrideAttrs (old: {
    installPhase = builtins.replaceStrings ["use_response_file_by_default=1"] ["use_response_file_by_default=0"] old.installPhase;
  })

Notify maintainers
@angerman

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: ccacheWrapper ccacheStdenv
# a list of nixos modules affected by the problem
module: programs.ccache
@Kha Kha added the 0.kind: bug Something is broken label Apr 18, 2021
Kha added a commit to leanprover/lean4 that referenced this issue Apr 18, 2021
@rrbutani
Copy link
Contributor

rrbutani commented Mar 20, 2022

I've run into this issue as well.

Can we perhaps add a export NIX_CC_USE_RESPONSE_FILE=0 to the ccache-links wrapper (gated on isClang, maybe)?
Edit: my bad, that doesn't work; we need the env var to be set before the outer layer of stdenv wrapper machinery runs. By the time we're in the ccache wrapper it's too late.

It's also not clear to me if this is a bug in ccache or intended behavior (I was not able to find an issue for it upstream) but it's definitely reproducible:

# Okay:
nix-shell -p stdenv --run 'bash -c "cc @<(echo --version)"'

# Not okay:
nix-shell -p ccache --run 'bash -c "ccache cc @<(echo --version)"'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants