From 203eef247e6542e71d005edf8580008f9327b34e Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Wed, 13 Nov 2024 13:57:32 +0100 Subject: [PATCH] overlay: add patchelf-venv FC-41616 This patch adds a `--add-rpath-and-shrink` option which performs `--add-rpath` and `--shrink-rpath` in a single write to not leak space (`--add-rpath` increases the ELF header size, `--shrink-rpath` doesn't reduce it when necessary). See also https://github.com/flyingcircusio/batou_ext/pull/199 & FC-41616. --- ..._135856_FC-41616-patched-patchelf_scriv.md | 22 +++++++++++++++++++ pkgs/overlay.nix | 12 ++++++++++ release/important_packages.json | 1 + 3 files changed, 35 insertions(+) create mode 100644 changelog.d/20241113_135856_FC-41616-patched-patchelf_scriv.md diff --git a/changelog.d/20241113_135856_FC-41616-patched-patchelf_scriv.md b/changelog.d/20241113_135856_FC-41616-patched-patchelf_scriv.md new file mode 100644 index 000000000..b4b5af77a --- /dev/null +++ b/changelog.d/20241113_135856_FC-41616-patched-patchelf_scriv.md @@ -0,0 +1,22 @@ + + +### Impact + +- None. + + +### NixOS XX.XX platform + +- Adds a package `patchelf-venv` to the platform overlay which contains an implementation + for the option `--add-rpath-and-shrink`. diff --git a/pkgs/overlay.nix b/pkgs/overlay.nix index 273a923ce..00e6ba721 100644 --- a/pkgs/overlay.nix +++ b/pkgs/overlay.nix @@ -347,6 +347,18 @@ builtins.mapAttrs (_: patchPhps phpLogPermissionPatch) { opensearch-dashboards = super.callPackage ./opensearch-dashboards { }; + patchelf-venv = super.patchelf.overrideAttrs ({ patches ? [], ... }: { + patches = patches ++ [ + # Adds `--add-rpath-and-shrink` option, required for convergent deployment + # tooling invoking `patchelf` multiple times on a virtualenv (see + # `batou_ext.python.FixELFRunPath`) + (fetchpatch { + url = "https://github.com/flyingcircusio/patchelf/commit/6ffde887d77275323c81c2e091891251b021abb3.patch"; + hash = "sha256-4Qct2Ez3v6DyUG26JTWt6/tkaqB9h1gYaoaObqhvFS8="; + }) + ]; + }); + percona = self.percona80; percona-toolkit = super.perlPackages.PerconaToolkit.overrideAttrs(oldAttrs: { # The script uses usr/bin/env perl and the Perl builder adds PERL5LIB to it. diff --git a/release/important_packages.json b/release/important_packages.json index ca6128a4b..775b28350 100644 --- a/release/important_packages.json +++ b/release/important_packages.json @@ -133,6 +133,7 @@ "openssl_1_1", "openssl_3", "openvpn", + "patchelf-venv", "pcre", "pcre2", "percona",