From 3bd456e4b40b979cdd7357db946cb2c2484668b2 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Mon, 10 May 2021 17:08:41 -0400 Subject: [PATCH] =?UTF-8?q?ccache:=204.2.1=20=E2=86=92=204.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../development/tools/misc/ccache/default.nix | 23 +++++++++++-------- .../misc/ccache/env-instead-of-compgen.patch | 18 --------------- pkgs/top-level/all-packages.nix | 10 ++++---- 3 files changed, 18 insertions(+), 33 deletions(-) delete mode 100644 pkgs/development/tools/misc/ccache/env-instead-of-compgen.patch diff --git a/pkgs/development/tools/misc/ccache/default.nix b/pkgs/development/tools/misc/ccache/default.nix index 4128118decf..b905f5e8ed5 100644 --- a/pkgs/development/tools/misc/ccache/default.nix +++ b/pkgs/development/tools/misc/ccache/default.nix @@ -7,26 +7,25 @@ , cmake , perl , zstd +, bashInteractive , xcodebuild , makeWrapper }: let ccache = stdenv.mkDerivation rec { pname = "ccache"; - version = "4.2.1"; + version = "4.3"; src = fetchFromGitHub { owner = pname; repo = pname; rev = "v${version}"; - hash = "sha256-AmgJpW7AGCSggbHp1fLO5yhXS9LIm7O77nQdDERJYAA="; + hash = "sha256-ZBxDTMUZiZJLIYbvACTFwvlss+IZiMjiL0khfM5hFCM="; }; - patches = [ - # test/run use compgen to get environment variable names, but - # compgen isn't available in non-interactive bash. - ./env-instead-of-compgen.patch + outputs = [ "out" "man" ]; + patches = [ # When building for Darwin, test/run uses dwarfdump, whereas on # Linux it uses objdump. We don't have dwarfdump packaged for # Darwin, so this patch updates the test to also use objdump on @@ -38,18 +37,22 @@ let ccache = stdenv.mkDerivation rec { ]; nativeBuildInputs = [ asciidoc cmake perl ]; - buildInputs = [ zstd ]; - outputs = [ "out" "man" ]; - doCheck = true; - checkInputs = lib.optional stdenv.isDarwin xcodebuild; + checkInputs = [ + # test/run requires the compgen function which is available in + # bashInteractive, but not bash. + bashInteractive + ] ++ lib.optional stdenv.isDarwin xcodebuild; + checkPhase = '' + runHook preCheck export HOME=$(mktemp -d) ctest --output-on-failure ${lib.optionalString stdenv.isDarwin '' -E '^(test.nocpp2|test.basedir|test.multi_arch)$' ''} + runHook postCheck ''; passthru = { diff --git a/pkgs/development/tools/misc/ccache/env-instead-of-compgen.patch b/pkgs/development/tools/misc/ccache/env-instead-of-compgen.patch deleted file mode 100644 index 313de0fa58c..00000000000 --- a/pkgs/development/tools/misc/ccache/env-instead-of-compgen.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/test/run b/test/run -index cbdd98f0..bc930200 100755 ---- a/test/run -+++ b/test/run -@@ -346,11 +346,11 @@ expect_perm() { - } - - reset_environment() { -- while IFS= read -r name; do -+ while IFS='=' read -r name value; do - if [[ $name =~ ^CCACHE_[A-Z0-9_]*$ ]]; then - unset $name - fi -- done < <(compgen -e) -+ done < <(env) - - unset GCC_COLORS - unset TERM diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 01fa18d0dfa..17a76b3ae5d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12635,12 +12635,12 @@ in inherit (stdenv) cc; }; - ccacheStdenv = lowPrio (makeOverridable ({ extraConfig, stdenv }: - overrideCC stdenv (buildPackages.ccacheWrapper.override { - inherit extraConfig; + ccacheStdenv = lowPrio (makeOverridable ({ stdenv, ... } @ extraArgs: + overrideCC stdenv (buildPackages.ccacheWrapper.override ({ inherit (stdenv) cc; - })) { - extraConfig = ""; + } // lib.optionalAttrs (builtins.hasAttr "extraConfig" extraArgs) { + extraConfig = extraArgs.extraConfig; + }))) { inherit stdenv; });