From 19cbbeae0fc7bbf9a20d8f590f866aa00b7eb3e4 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 18 Jan 2026 02:26:30 +0200 Subject: [PATCH] samba: avoid shebang patching by using correct pythonWrap As explained in #480392, the shebangs need fixing not because of samba's build system, but because our `wrapPythonPrograms` is buggy. --- pkgs/servers/samba/4.x.nix | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/pkgs/servers/samba/4.x.nix b/pkgs/servers/samba/4.x.nix index de5a3b225876..1dbfd1528467 100644 --- a/pkgs/servers/samba/4.x.nix +++ b/pkgs/servers/samba/4.x.nix @@ -35,6 +35,7 @@ rpcsvc-proto, bash, python3Packages, + pkgsHostTarget, nixosTests, libiconv, testers, @@ -113,7 +114,10 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ python3Packages.python - python3Packages.wrapPython + # Not `python3Packages.wrapPython` to workaround + # `python3Packages.wrapPython.__spliced.buildHost` having the wrong + # `pythonHost`. See https://github.com/NixOS/nixpkgs/issues/434307 + pkgsHostTarget.python3Packages.wrapPython wafHook pkg-config bison @@ -310,15 +314,6 @@ stdenv.mkDerivation (finalAttrs: { # Fix PYTHONPATH for some tools wrapPythonPrograms - - # Samba does its own shebang patching, but uses build Python - find $out/bin -type f -executable | while read file; do - isScript "$file" || continue - substituteInPlace "$file" \ - --replace-fail \ - ${lib.getBin buildPackages.python3Packages.python} \ - ${lib.getBin python3Packages.python} - done ''; disallowedReferences = lib.optionals isCross [