From daa77caf9bf660c52858772d8aa4cf9ab08ffe92 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sun, 19 Jun 2022 17:18:01 -0400 Subject: [PATCH] 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). --- pkgs/build-support/cc-wrapper/default.nix | 4 ++-- pkgs/development/tools/misc/ccache/default.nix | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 35d714f9b41e..b011322aa3dd 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -15,7 +15,7 @@ , propagateDoc ? cc != null && cc ? man , extraTools ? [], extraPackages ? [], extraBuildCommands ? "" , 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 ? {} , libcxx ? null }: @@ -178,7 +178,7 @@ stdenv.mkDerivation { local dst="$1" local wrapper="$2" 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" chmod +x "$out/bin/$dst" } diff --git a/pkgs/development/tools/misc/ccache/default.nix b/pkgs/development/tools/misc/ccache/default.nix index 98ae2d42ba40..22345023c366 100644 --- a/pkgs/development/tools/misc/ccache/default.nix +++ b/pkgs/development/tools/misc/ccache/default.nix @@ -76,6 +76,7 @@ let ccache = stdenv.mkDerivation rec { passthru = { isClang = unwrappedCC.isClang or false; isGNU = unwrappedCC.isGNU or false; + isCcache = true; }; inherit (unwrappedCC) lib; nativeBuildInputs = [ makeWrapper ];