From 0dd94f05b04768c808d19c2e28dfae19105e5c2f Mon Sep 17 00:00:00 2001 From: magicquark <198001825+magicquark@users.noreply.github.com> Date: Sat, 13 Dec 2025 04:54:09 +0000 Subject: [PATCH] podman: fix cross compilation build - See `Nixpkgs` issue 467994 for detailed build logs showing the failure. - `Podman` will use its vendored version of `go-md2man` when the `GOMD2MAN` environment variable is unset. - When cross compiling from `x86_64-linux` to `aarch64-linux`, this results in the tool being compiled with the `aarch64-linux` compiler using `x86_64-linux` options. The compiler arch is wrong, so the build fails. - To circumvent this use `Nixpkgs` version of `go-md2man`. - The current vendored version matches `Nixpkgs` version (v2.0.7): https://github.com/containers/podman/commit/7e14a0340922a03781f9f6238a914b04a749573f - The reason for the vendoring is detailed in this commit: https://github.com/containers/podman/commit/dfec510b41b536d4a3afc810cab335d1d0feb3e0 --- pkgs/by-name/po/podman/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/po/podman/package.nix b/pkgs/by-name/po/podman/package.nix index 6ec4a19e901c..a8ef71d47183 100644 --- a/pkgs/by-name/po/podman/package.nix +++ b/pkgs/by-name/po/podman/package.nix @@ -5,6 +5,7 @@ pkg-config, installShellFiles, buildGoModule, + buildPackages, gpgme, lvm2, btrfs-progs, @@ -12,7 +13,6 @@ libseccomp, libselinux, systemdMinimal, - go-md2man, nixosTests, python3, makeBinaryWrapper, @@ -71,7 +71,6 @@ buildGoModule (finalAttrs: { nativeBuildInputs = [ pkg-config - go-md2man installShellFiles makeBinaryWrapper python3 @@ -90,6 +89,7 @@ buildGoModule (finalAttrs: { env = { HELPER_BINARIES_DIR = "${placeholder "out"}/libexec/podman"; # used in buildPhase & installPhase PREFIX = "${placeholder "out"}"; + GOMD2MAN = "${buildPackages.go-md2man}/bin/go-md2man"; }; buildPhase = ''