From cb6f36e8ffabf98238240106cbe5b3f6f1fae854 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sat, 17 Feb 2024 15:38:01 -0500 Subject: [PATCH] xrootd: fix plugin loading on Linux (#289140) --- pkgs/applications/science/misc/root/default.nix | 8 ++------ pkgs/tools/networking/xrootd/default.nix | 15 +++------------ 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/pkgs/applications/science/misc/root/default.nix b/pkgs/applications/science/misc/root/default.nix index 7c9d6f5cb0a6..9548db1c7c47 100644 --- a/pkgs/applications/science/misc/root/default.nix +++ b/pkgs/applications/science/misc/root/default.nix @@ -214,13 +214,10 @@ stdenv.mkDerivation rec { # suppress warnings from compilation of the vendored clang to avoid running into log limits on the Hydra NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ "-Wno-shadow" "-Wno-maybe-uninitialized" ]; - # Workaround the xrootd runpath bug #169677 by prefixing [DY]LD_LIBRARY_PATH with ${lib.makeLibraryPath xrootd}. - # TODO: Remove the [DY]LDLIBRARY_PATH prefix for xrootd when #200830 get merged. postInstall = '' for prog in rootbrowse rootcp rooteventselector rootls rootmkdir rootmv rootprint rootrm rootslimtree; do wrapProgram "$out/bin/$prog" \ - --set PYTHONPATH "$out/lib" \ - --set ${lib.optionalString stdenv.isDarwin "DY"}LD_LIBRARY_PATH "$out/lib:${lib.makeLibraryPath [ xrootd ]}" + --set PYTHONPATH "$out/lib" done # Make ldd and sed available to the ROOT executable by prefixing PATH. @@ -229,8 +226,7 @@ stdenv.mkDerivation rec { gnused # sed stdenv.cc # c++ ld etc. stdenv.cc.libc # ldd - ]}" \ - --prefix ${lib.optionalString stdenv.hostPlatform.isDarwin "DY"}LD_LIBRARY_PATH : "${lib.makeLibraryPath [ xrootd ]}" + ]}" # Patch thisroot.{sh,csh,fish} diff --git a/pkgs/tools/networking/xrootd/default.nix b/pkgs/tools/networking/xrootd/default.nix index 991b9039860e..1ceb6380aaa1 100644 --- a/pkgs/tools/networking/xrootd/default.nix +++ b/pkgs/tools/networking/xrootd/default.nix @@ -135,22 +135,13 @@ stdenv.mkDerivation (finalAttrs: { "-DENABLE_VOMS=${if stdenv.isLinux then "TRUE" else "FALSE"}" ]; - # Workaround the library-not-found issue - # happening to binaries compiled with xrootd libraries. - # See #169677 - preFixup = '' - makeWrapperArgs+=("--prefix" "${lib.optionalString stdenv.hostPlatform.isDarwin "DY"}LD_LIBRARY_PATH" ":" "${placeholder "out"}/lib") - ''; - - postFixup = '' - while IFS= read -r FILE; do - wrapProgram "$FILE" "''${makeWrapperArgs[@]}" - done < <(find "$bin/bin" -mindepth 1 -maxdepth 1 -type f,l -perm -a+x) - '' + lib.optionalString (externalEtc != null) '' + postFixup = lib.optionalString (externalEtc != null) '' moveToOutput etc "$etc" ln -s ${lib.escapeShellArg externalEtc} "$out/etc" ''; + dontPatchELF = true; # shrinking rpath will cause runtime failures in dlopen + meta = with lib; { description = "High performance, scalable fault tolerant data access"; homepage = "https://xrootd.slac.stanford.edu";