Skip to content

Commit

Permalink
ccache.links: make it a function of unwrappedCC
Browse files Browse the repository at this point in the history
That way we can use a ccacheStdenv with e.g. a different CC:

stdenv = overrideCC gcc8Stdenv (ccacheWrapper.override { unwrappedCC
= gcc8Stdenv.cc.cc; });
  • Loading branch information
FRidh committed Jul 19, 2019
1 parent 2d57698 commit 594ca3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions pkgs/development/tools/misc/ccache/default.nix
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -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 { };
Expand Down

0 comments on commit 594ca3f

Please sign in to comment.