cc-wrapper: disable response files for ccache

The problem is that the ccache wrapper does not work with response
files (it seems like the fd doesn't survive after exec in the
makeWrapper wrapper).
This commit is contained in:
Dmitry Kalinkin 2022-06-19 17:18:01 -04:00
parent dd38503071
commit daa77caf9b
No known key found for this signature in database
GPG key ID: 5157B3EC8B2CA333
2 changed files with 3 additions and 2 deletions

View file

@ -15,7 +15,7 @@
, propagateDoc ? cc != null && cc ? man , propagateDoc ? cc != null && cc ? man
, extraTools ? [], extraPackages ? [], extraBuildCommands ? "" , extraTools ? [], extraPackages ? [], extraBuildCommands ? ""
, nixSupport ? {} , nixSupport ? {}
, isGNU ? false, isClang ? cc.isClang or false, gnugrep ? null , isGNU ? false, isClang ? cc.isClang or false, isCcache ? cc.isCcache or false, gnugrep ? null
, buildPackages ? {} , buildPackages ? {}
, libcxx ? null , libcxx ? null
}: }:
@ -178,7 +178,7 @@ stdenv.mkDerivation {
local dst="$1" local dst="$1"
local wrapper="$2" local wrapper="$2"
export prog="$3" export prog="$3"
export use_response_file_by_default=${if isClang then "1" else "0"} export use_response_file_by_default=${if isClang && !isCcache then "1" else "0"}
substituteAll "$wrapper" "$out/bin/$dst" substituteAll "$wrapper" "$out/bin/$dst"
chmod +x "$out/bin/$dst" chmod +x "$out/bin/$dst"
} }

View file

@ -76,6 +76,7 @@ let ccache = stdenv.mkDerivation rec {
passthru = { passthru = {
isClang = unwrappedCC.isClang or false; isClang = unwrappedCC.isClang or false;
isGNU = unwrappedCC.isGNU or false; isGNU = unwrappedCC.isGNU or false;
isCcache = true;
}; };
inherit (unwrappedCC) lib; inherit (unwrappedCC) lib;
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [ makeWrapper ];