nixpkgs icon indicating copy to clipboard operation
nixpkgs copied to clipboard

Build failure: perl540Packages.XMLSAX (cross-compilation)

Open nikableh opened this issue 1 year ago • 2 comments

Nixpkgs version

  • Unstable (25.11)

Steps to reproduce

git clone https://github.com/NixOS/nixpkgs
cd nixpkgs
nix-build --arg crossSystem '{ config = "aarch64-unknown-linux-gnu"; }' -A perl540Packages.XMLSAX

Relevant log output

Installing /nix/store/d64slrsvz8k2xfnkapxkhvcwlv834jvd-perl5.40.0-XML-SAX-1.02-aarch64-unknown-linux-gnu/share/man/man3/XML::SAX::ParserFactory.3
Appending installation info to /nix/store/d64slrsvz8k2xfnkapxkhvcwlv834jvd-perl5.40.0-XML-SAX-1.02-aarch64-unknown-linux-gnu/lib/perl5/5.40.0/aarch64-linux/perllocal.pod
Can't locate XML/SAX.pm in @INC (you may need to install the XML::SAX module) (@INC entries checked: /nix/store/qk8fyph0b4sj7axxw196asp2a8zhnwbx-perl-aarch64-unknown-linux-gnu-5.40.0-mini/lib/perl5/cross_perl/5.40.0 /nix/store/5gwc7v0ml1z6ghf8wdhf4vpgblhp69zf-perl-aarch64-unknown-linux-gnu-5.40.0/lib/perl5/5.40.0 /nix/store/5gwc7v0ml1z6ghf8wdhf4vpgblhp69zf-perl-aarch64-unknown-linux-gnu-5.40.0/lib/perl5/5.40.0/aarch64-linux /nix/store/5gwc7v0ml1z6ghf8wdhf4vpgblhp69zf-perl-aarch64-unknown-linux-gnu-5.40.0/lib/perl5/site_perl/5.40.0 /nix/store/5gwc7v0ml1z6ghf8wdhf4vpgblhp69zf-perl-aarch64-unknown-linux-gnu-5.40.0/lib/perl5/site_perl/5.40.0/aarch64-linux /nix/store/slj7hyy49611v5w71qjnvw0v2l9rh988-perl5.40.0-XML-NamespaceSupport-1.12-aarch64-unknown-linux-gnu/lib/perl5/site_perl/5.40.0 /nix/store/slj7hyy49611v5w71qjnvw0v2l9rh988-perl5.40.0-XML-NamespaceSupport-1.12-aarch64-unknown-linux-gnu/lib/perl5/site_perl/5.40.0/aarch64-linux /nix/store/mcinrg80fw9wizmp7l7z95aidi27hnka-perl5.40.0-XML-SAX-Base-1.09-aarch64-unknown-linux-gnu/lib/perl5/site_perl/5.40.0 /nix/store/mcinrg80fw9wizmp7l7z95aidi27hnka-perl5.40.0-XML-SAX-Base-1.09-aarch64-unknown-linux-gnu/lib/perl5/site_perl/5.40.0/aarch64-linux /nix/store/d64slrsvz8k2xfnkapxkhvcwlv834jvd-perl5.40.0-XML-SAX-1.02-aarch64-unknown-linux-gnu/lib/perl5/site_perl .).
BEGIN failed--compilation aborted.
make: *** [Makefile:743: install_sax_pureperl] Error 2

System metadata

  • system: "x86_64-linux"
  • host os: Linux 6.15.1, NixOS, 25.05 (Warbler), 25.05.803579.70c74b02eac4
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.28.3
  • channels(root): "nixos-25.05, nixos-hardware"
  • nixpkgs: /nix/store/gdz4yp5sjq3b1q0g9ad9hicqsx1alvif-nixos-25.05/nixos

Is this issue important to you?

Add a :+1: reaction to issues you find important.

nikableh avatar Jun 23 '25 23:06 nikableh

@onny, @misuzu, @FliegendeWurst. From commit history I saw that you had some experience fixing cross-compilation in Perl? Could you please help me here? 👉👈 I have zero experience with Perl...

From what I understand, the issue may be caused by something trying to run aarch64 Perl interpreter on my 64-bit x86 CPU, which obviously fails.

nikableh avatar Jun 24 '25 07:06 nikableh

Fixed it!

The cause of the error was that upstream Makefile.PL appends a generated Makefile with an extra section that directly invokes a perl binary.

Gonna open a PR a bit later.

nikableh avatar Jun 25 '25 09:06 nikableh