ccache.links: make it a function of unwrappedCC

That way we can use a ccacheStdenv with e.g. a different CC:

stdenv = overrideCC gcc8Stdenv (ccacheWrapper.override { unwrappedCC
= gcc8Stdenv.cc.cc; });
This commit is contained in:
Frederik Rietdijk 2019-07-15 14:14:19 +02:00 committed by Frederik Rietdijk
parent 2d5769884d
commit 594ca3f1cf
2 changed files with 4 additions and 6 deletions

View File

@ -27,12 +27,10 @@ let ccache = stdenv.mkDerivation rec {
doCheck = !stdenv.isDarwin; doCheck = !stdenv.isDarwin;
passthru = let passthru = {
unwrappedCC = stdenv.cc.cc;
in {
# A derivation that provides gcc and g++ commands, but that # A derivation that provides gcc and g++ commands, but that
# will end up calling ccache for the given cacheDir # will end up calling ccache for the given cacheDir
links = extraConfig: stdenv.mkDerivation rec { links = {unwrappedCC, extraConfig}: stdenv.mkDerivation rec {
name = "ccache-links"; name = "ccache-links";
passthru = { passthru = {
isClang = unwrappedCC.isClang or false; isClang = unwrappedCC.isClang or false;

View File

@ -9009,8 +9009,8 @@ in
# }; # };
# You can use a different directory, but whichever directory you choose # You can use a different directory, but whichever directory you choose
# should be owned by user root, group nixbld with permissions 0770. # should be owned by user root, group nixbld with permissions 0770.
ccacheWrapper = makeOverridable ({ extraConfig ? "" }: ccacheWrapper = makeOverridable ({ extraConfig ? "", unwrappedCC ? stdenv.cc.cc }:
wrapCC (ccache.links extraConfig)) {}; wrapCC (ccache.links {inherit unwrappedCC extraConfig;})) {};
ccacheStdenv = lowPrio (overrideCC stdenv buildPackages.ccacheWrapper); ccacheStdenv = lowPrio (overrideCC stdenv buildPackages.ccacheWrapper);
cccc = callPackage ../development/tools/analysis/cccc { }; cccc = callPackage ../development/tools/analysis/cccc { };