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
This commit is contained in:
magicquark
2025-12-14 04:20:00 +00:00
parent b3e1a7e68a
commit 0dd94f05b0
+2 -2
View File
@@ -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 = ''