spack/lib/spack
Harmen Stoppels f9112a6244
Relocation should take hardlinks into account (#33460)
Currently `relocate_text` and `relocate_text_bin` are unsafe in the
sense that they run in parallel, and lead to races when modifying
different items pointing to the same inode.

This leads to the issue observed in #33453.

This PR:

1. Renames those functions to `unsafe_*` so people are aware
2. Adds logic to deal with hardlinks in current binary packages
3. Adds logic to deal with hardlinks when creating new binary tarballs,
   so the install side doesn't have to de-dupe hardlinks.
4. Adds a test for 3

The assumption is that all our relocation logic preserves inodes. That
is, we should never copy a file, modify it, and then move it back. I
quickly verified, and its seems like this is true for (binary) text
relocation, as well as rpath patching in patchelf (even when the file
grows) and mach-o fixes.
2022-10-21 18:30:26 +02:00
..
docs spack checksum: warn if version is deprecated (#32438) 2022-10-18 22:51:38 +00:00
env Revert "strip -Werror: all specific or none (#30284)" (#30878) 2022-05-26 14:17:01 -07:00
external Use threading.TIMEOUT_MAX when available (#32399) 2022-08-26 17:37:56 -06:00
llnl shell prompt: enclose control sequence in brackets (#33079) 2022-10-10 07:29:58 -06:00
spack Relocation should take hardlinks into account (#33460) 2022-10-21 18:30:26 +02:00