Skip to content

Commit

Permalink
Merge pull request #210908 from Yarny0/auto-patchelf
Browse files Browse the repository at this point in the history
autoPatchelfHook: fix symlink handling
  • Loading branch information
layus authored Jan 15, 2023
2 parents 9fa8315 + 57c8c6c commit aa7cfc3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
7 changes: 7 additions & 0 deletions pkgs/build-support/setup-hooks/auto-patchelf.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,14 @@ def populate_cache(initial: List[Path], recursive: bool =False) -> None:
if not path.is_file():
continue

# As an optimisation, resolve the symlinks here, as the target is unique
# XXX: (layus, 2022-07-25) is this really an optimisation in all cases ?
# It could make the rpath bigger or break the fragile precedence of $out.
resolved = path.resolve()
# Do not use resolved paths when names do not match
if resolved.name != path.name:
resolved = path

try:
with open_elf(path) as elf:
osabi = get_osabi(elf)
Expand Down
10 changes: 0 additions & 10 deletions pkgs/tools/backup/tsm-client/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,6 @@ let
ln --symbolic --force --no-target-directory "$out/$(cut -b 7- <<< "$target")" "$link"
done
'';

# since 7b9fd5d1c9802131ca0a01ff08a3ff64379d2df4
# autopatchelf misses to add $out/lib to rpath;
# we have to call autopatchelf manually as it would
# run too late and overwrite our rpath otherwise
dontAutoPatchelf = true;
postFixup = ''
autoPatchelf $out
patchelf --add-rpath $out/lib $out/lib/*
'';
};

binPath = lib.makeBinPath ([ acl gnugrep procps ]
Expand Down

0 comments on commit aa7cfc3

Please sign in to comment.