diff options
author | Frederik Rietdijk <fridh@fridh.nl> | 2019-07-15 14:14:19 +0200 |
---|---|---|
committer | Frederik Rietdijk <freddyrietdijk@fridh.nl> | 2019-07-19 11:27:56 +0200 |
commit | 594ca3f1cfd5b188c440e9460dfbfece14706009 (patch) | |
tree | e8cf25bfaddd36c85f31a7b5ef6ee9789055db5b | |
parent | 2d5769884d573aef748443ee1e686444ab58ba78 (diff) | |
download | nixlib-594ca3f1cfd5b188c440e9460dfbfece14706009.tar nixlib-594ca3f1cfd5b188c440e9460dfbfece14706009.tar.gz nixlib-594ca3f1cfd5b188c440e9460dfbfece14706009.tar.bz2 nixlib-594ca3f1cfd5b188c440e9460dfbfece14706009.tar.lz nixlib-594ca3f1cfd5b188c440e9460dfbfece14706009.tar.xz nixlib-594ca3f1cfd5b188c440e9460dfbfece14706009.tar.zst nixlib-594ca3f1cfd5b188c440e9460dfbfece14706009.zip |
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; });
-rw-r--r-- | pkgs/development/tools/misc/ccache/default.nix | 6 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 4 |
2 files changed, 4 insertions, 6 deletions
diff --git a/pkgs/development/tools/misc/ccache/default.nix b/pkgs/development/tools/misc/ccache/default.nix index c5cb277c256f..ae7ecad7ea1c 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 52fcdb2167d4..03ae106c481a 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 { }; |