From 8027d95ff01ba1a9dbc9f960a929ffe4e306d25c Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Sat, 22 Jul 2023 15:38:42 +0800 Subject: [PATCH 1/5] xrootd: enable structured attributes --- pkgs/tools/networking/xrootd/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/tools/networking/xrootd/default.nix b/pkgs/tools/networking/xrootd/default.nix index e5aad1b4ee9b..bb8576e7af97 100644 --- a/pkgs/tools/networking/xrootd/default.nix +++ b/pkgs/tools/networking/xrootd/default.nix @@ -24,6 +24,9 @@ }: stdenv.mkDerivation (finalAttrs: { + + __structuredAttrs = true; + pname = "xrootd"; version = "5.5.5"; From 9c80ef7f16acb29560154af94615768d16858559 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Fri, 26 May 2023 17:26:47 +0800 Subject: [PATCH 2/5] xrootd: wrap executables with [DY]LD_LIBRARY_PATH --- pkgs/tools/networking/xrootd/default.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/networking/xrootd/default.nix b/pkgs/tools/networking/xrootd/default.nix index bb8576e7af97..47496173642c 100644 --- a/pkgs/tools/networking/xrootd/default.nix +++ b/pkgs/tools/networking/xrootd/default.nix @@ -4,6 +4,7 @@ , fetchFromGitHub , cmake , cppunit +, makeWrapper , pkg-config , curl , fuse @@ -58,6 +59,7 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake + makeWrapper pkg-config ]; @@ -104,7 +106,18 @@ stdenv.mkDerivation (finalAttrs: { "-DENABLE_TESTS=TRUE" ]; - postFixup = lib.optionalString (externalEtc != null) '' + makeWrapperArgs = [ + # Workaround the library-not-found issue + # happening to binaries compiled with xrootd libraries. + # See #169677 + "--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) '' mv "$out"/etc{,.orig} ln -s ${lib.escapeShellArg externalEtc} "$out/etc" ''; From bc744410f5b6e406b2ac2cd0a000db6c88fdc2bd Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Fri, 26 May 2023 17:30:25 +0800 Subject: [PATCH 3/5] xrootd.fetchxrd: remove duplicated wrapping --- pkgs/tools/networking/xrootd/fetchxrd.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/tools/networking/xrootd/fetchxrd.nix b/pkgs/tools/networking/xrootd/fetchxrd.nix index b7a77f80549b..c5ec8f02e783 100644 --- a/pkgs/tools/networking/xrootd/fetchxrd.nix +++ b/pkgs/tools/networking/xrootd/fetchxrd.nix @@ -21,11 +21,9 @@ inherit url; urls = if urls == [ ] then lib.singleton url else urls; } - # Set [DY]LD_LIBRARY_PATH to workaround #169677 - # TODO: Remove the library path after #200830 get merged '' for u in $urls; do - ${lib.optionalString buildPlatform.isDarwin "DY"}LD_LIBRARY_PATH=${lib.makeLibraryPath [ xrootd ]} xrdcp --force "$u" "$out" + xrdcp --force "$u" "$out" ret=$? (( ret != 0 )) || break done From 4f318516389444054791920017c5e3e29bfb2c1c Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Thu, 3 Aug 2023 07:57:02 +0800 Subject: [PATCH 4/5] xrootd.fetchxrd: show progress bar with --verbose Show the progress bar and other information during the download. Provide a way to distinguish connection interrupt from authentication failure. --- pkgs/tools/networking/xrootd/fetchxrd.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/networking/xrootd/fetchxrd.nix b/pkgs/tools/networking/xrootd/fetchxrd.nix index c5ec8f02e783..5bad585186ac 100644 --- a/pkgs/tools/networking/xrootd/fetchxrd.nix +++ b/pkgs/tools/networking/xrootd/fetchxrd.nix @@ -23,7 +23,7 @@ } '' for u in $urls; do - xrdcp --force "$u" "$out" + xrdcp --verbose --force "$u" "$out" ret=$? (( ret != 0 )) || break done From 95f76d1d100df7126ce202606745557710aa1c33 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Fri, 21 Jul 2023 02:46:47 +0800 Subject: [PATCH 5/5] xrootd: opt out systemd where it breaks --- pkgs/top-level/all-packages.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index af68261a0fb9..2ef5f06ea73c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1889,7 +1889,10 @@ with pkgs; xpaste = callPackage ../tools/text/xpaste { }; - xrootd = callPackage ../tools/networking/xrootd { }; + xrootd = callPackage ../tools/networking/xrootd { + # Workaround systemd static build breakage + systemd = if systemd.meta.broken then null else systemd; + }; yabridge = callPackage ../tools/audio/yabridge { wine = wineWowPackages.staging;