diff options
author | Linus Heckemann <git@sphalerite.org> | 2023-07-31 11:02:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-31 11:02:20 +0200 |
commit | a3d2e71a6c6fbf389c19940899440228591b7b92 (patch) | |
tree | 629b519de6a7ce4f276742d1d3889f9504882b74 /pkgs/build-support | |
parent | 8eb8f0439b42c7eef6c751d3fd1bca986169cec3 (diff) | |
parent | 7adf0a4eeb0ac19b07ca17f27e20ca4cee12df3d (diff) | |
download | nixlib-a3d2e71a6c6fbf389c19940899440228591b7b92.tar nixlib-a3d2e71a6c6fbf389c19940899440228591b7b92.tar.gz nixlib-a3d2e71a6c6fbf389c19940899440228591b7b92.tar.bz2 nixlib-a3d2e71a6c6fbf389c19940899440228591b7b92.tar.lz nixlib-a3d2e71a6c6fbf389c19940899440228591b7b92.tar.xz nixlib-a3d2e71a6c6fbf389c19940899440228591b7b92.tar.zst nixlib-a3d2e71a6c6fbf389c19940899440228591b7b92.zip |
Merge pull request #246164 from trofi/strip-no-symlinks
setup-hooks/strip: resolve/uniq symlinks before stripping
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/setup-hooks/strip.sh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkgs/build-support/setup-hooks/strip.sh b/pkgs/build-support/setup-hooks/strip.sh index 1d65c10c5230..5f53e7e95b2e 100644 --- a/pkgs/build-support/setup-hooks/strip.sh +++ b/pkgs/build-support/setup-hooks/strip.sh @@ -68,6 +68,11 @@ stripDirs() { striperr="$(mktemp 'striperr.XXXXXX')" # Do not strip lib/debug. This is a directory used by setup-hooks/separate-debug-info.sh. find $paths -type f -a '!' -path "$prefix/lib/debug/*" -print0 | + # Make sure we process files under symlinks only once. Otherwise + # 'strip` can corrupt files when writes to them in parallel: + # https://github.com/NixOS/nixpkgs/issues/246147#issuecomment-1657072039 + xargs -r -0 -n1 -- realpath -z | sort -u -z | + xargs -r -0 -n1 -P "$NIX_BUILD_CORES" -- $cmd $stripFlags 2>"$striperr" || exit_code=$? # xargs exits with status code 123 if some but not all of the # processes fail. We don't care if some of the files couldn't |