diff --git a/pkgs/development/tools/misc/ccache/default.nix b/pkgs/development/tools/misc/ccache/default.nix index c5cb277c256..ae7ecad7ea1 100644 --- a/pkgs/development/tools/misc/ccache/default.nix +++ b/pkgs/development/tools/misc/ccache/default.nix @@ -27,12 +27,10 @@ let ccache = stdenv.mkDerivation rec { doCheck = !stdenv.isDarwin; - passthru = let - unwrappedCC = stdenv.cc.cc; - in { + passthru = { # A derivation that provides gcc and g++ commands, but that # will end up calling ccache for the given cacheDir - links = extraConfig: stdenv.mkDerivation rec { + links = {unwrappedCC, extraConfig}: stdenv.mkDerivation rec { name = "ccache-links"; passthru = { isClang = unwrappedCC.isClang or false; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 52fcdb2167d..03ae106c481 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9009,8 +9009,8 @@ in # }; # You can use a different directory, but whichever directory you choose # should be owned by user root, group nixbld with permissions 0770. - ccacheWrapper = makeOverridable ({ extraConfig ? "" }: - wrapCC (ccache.links extraConfig)) {}; + ccacheWrapper = makeOverridable ({ extraConfig ? "", unwrappedCC ? stdenv.cc.cc }: + wrapCC (ccache.links {inherit unwrappedCC extraConfig;})) {}; ccacheStdenv = lowPrio (overrideCC stdenv buildPackages.ccacheWrapper); cccc = callPackage ../development/tools/analysis/cccc { };