diff --git a/pkgs/development/tools/misc/ccache/default.nix b/pkgs/development/tools/misc/ccache/default.nix index 0cf98d651c5b..642a1cf4ebfe 100644 --- a/pkgs/development/tools/misc/ccache/default.nix +++ b/pkgs/development/tools/misc/ccache/default.nix @@ -13,19 +13,29 @@ let ccache = stdenv.mkDerivation rec { pname = "ccache"; - version = "4.2"; + version = "4.2.1"; src = fetchFromGitHub { owner = pname; repo = pname; rev = "v${version}"; - sha256 = "1lr9804xyzbs72f9jbbzy1fjqxwrwpb4rp431wqialvms4251d8f"; + hash = "sha256-AmgJpW7AGCSggbHp1fLO5yhXS9LIm7O77nQdDERJYAA="; }; - patches = lib.optional stdenv.isDarwin (substituteAll { - src = ./force-objdump-on-darwin.patch; - objdump = "${binutils.bintools}/bin/objdump"; - }); + patches = [ + # test/run use compgen to get environment variable names, but + # compgen isn't available in non-interactive bash. + ./env-instead-of-compgen.patch + + # 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 + # Darwin. + (substituteAll { + src = ./force-objdump-on-darwin.patch; + objdump = "${binutils.bintools}/bin/objdump"; + }) + ]; nativeBuildInputs = [ asciidoc cmake perl ]; @@ -38,7 +48,7 @@ let ccache = stdenv.mkDerivation rec { checkPhase = '' export HOME=$(mktemp -d) ctest --output-on-failure ${lib.optionalString stdenv.isDarwin '' - -E '^(test.nocpp2|test.modules)$' + -E '^(test.nocpp2|test.modules|test.basedir|test.multi_arch)$' ''} ''; diff --git a/pkgs/development/tools/misc/ccache/env-instead-of-compgen.patch b/pkgs/development/tools/misc/ccache/env-instead-of-compgen.patch new file mode 100644 index 000000000000..313de0fa58c3 --- /dev/null +++ b/pkgs/development/tools/misc/ccache/env-instead-of-compgen.patch @@ -0,0 +1,18 @@ +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