Merge pull request #119176 from MetaDark/ccache-4.2.1

This commit is contained in:
Sandro 2021-04-11 22:56:19 +02:00 committed by GitHub
commit 78a8239355
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 7 deletions

View file

@ -13,19 +13,29 @@
let ccache = stdenv.mkDerivation rec { let ccache = stdenv.mkDerivation rec {
pname = "ccache"; pname = "ccache";
version = "4.2"; version = "4.2.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = pname; owner = pname;
repo = pname; repo = pname;
rev = "v${version}"; rev = "v${version}";
sha256 = "1lr9804xyzbs72f9jbbzy1fjqxwrwpb4rp431wqialvms4251d8f"; hash = "sha256-AmgJpW7AGCSggbHp1fLO5yhXS9LIm7O77nQdDERJYAA=";
}; };
patches = lib.optional stdenv.isDarwin (substituteAll { patches = [
src = ./force-objdump-on-darwin.patch; # test/run use compgen to get environment variable names, but
objdump = "${binutils.bintools}/bin/objdump"; # 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 ]; nativeBuildInputs = [ asciidoc cmake perl ];
@ -38,7 +48,7 @@ let ccache = stdenv.mkDerivation rec {
checkPhase = '' checkPhase = ''
export HOME=$(mktemp -d) export HOME=$(mktemp -d)
ctest --output-on-failure ${lib.optionalString stdenv.isDarwin '' ctest --output-on-failure ${lib.optionalString stdenv.isDarwin ''
-E '^(test.nocpp2|test.modules)$' -E '^(test.nocpp2|test.basedir|test.multi_arch)$'
''} ''}
''; '';

View file

@ -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