Open Majiir opened 1 year ago
Hi, Did you find any workaround for this issue? I am also facing same issue when I cross compile for riscv arch.
I never solved the cross-compilation problem. I did switch away from GRUB, because it's what was ultimately pulling in this dependency.
Issue persists in command
$> nix-build '<nixpkgs>' -A pkgsCross.aarch64-multiplatform.perlPackages.Testutf8
Did similar changes for Testutf8 too but another Perl package failed:
error: builder for '/nix/store/mp6ap29xawb3mwjsb66dmy5z9a358g9a-perl5.36.0-XML-SAX-1.02-riscv64-unknown-linux-gnu.drv' failed with exit code 2;
last 10 log lines:
> Installing /nix/store/7fhvq7m7r20lxi6i9smvj8z3v88vrpi3-perl5.36.0-XML-SAX-1.02-riscv64-unknown-linux-gnu/share/man/man3/XML::SAX::ParserFactory.3
> Installing /nix/store/7fhvq7m7r20lxi6i9smvj8z3v88vrpi3-perl5.36.0-XML-SAX-1.02-riscv64-unknown-linux-gnu/share/man/man3/XML::SAX::PurePerl::Reader.3
> Installing /nix/store/7fhvq7m7r20lxi6i9smvj8z3v88vrpi3-perl5.36.0-XML-SAX-1.02-riscv64-unknown-linux-gnu/share/man/man3/XML::SAX.3
> Installing /nix/store/7fhvq7m7r20lxi6i9smvj8z3v88vrpi3-perl5.36.0-XML-SAX-1.02-riscv64-unknown-linux-gnu/share/man/man3/XML::SAX::DocumentLocator.3
> Installing /nix/store/7fhvq7m7r20lxi6i9smvj8z3v88vrpi3-perl5.36.0-XML-SAX-1.02-riscv64-unknown-linux-gnu/share/man/man3/XML::SAX::PurePerl.3
> Installing /nix/store/7fhvq7m7r20lxi6i9smvj8z3v88vrpi3-perl5.36.0-XML-SAX-1.02-riscv64-unknown-linux-gnu/share/man/man3/XML::SAX::Intro.3
> Appending installation info to /nix/store/7fhvq7m7r20lxi6i9smvj8z3v88vrpi3-perl5.36.0-XML-SAX-1.02-riscv64-unknown-linux-gnu/lib/perl5/5.36.0/riscv64-linux/perllocal.pod
> Can't locate XML/SAX.pm in @INC (you may need to install the XML::SAX module) (@INC contains: /nix/store/44xnllrmif2398vhfwk7nskafhv88sss-perl-riscv64-unknown-linux-gnu-5.36.0-mini/lib/perl5/cross_perl/5.36.0 /nix/store/0dka6kdnwpsk7rjywkfyvw3dgihw9ip5-perl-riscv64-unknown-linux-gnu-5.36.0/lib/perl5/5.36.0 /nix/store/0dka6kdnwpsk7rjywkfyvw3dgihw9ip5-perl-riscv64-unknown-linux-gnu-5.36.0/lib/perl5/5.36.0/riscv64-linux /nix/store/0dka6kdnwpsk7rjywkfyvw3dgihw9ip5-perl-riscv64-unknown-linux-gnu-5.36.0/lib/perl5/site_perl/5.36.0 /nix/store/0dka6kdnwpsk7rjywkfyvw3dgihw9ip5-perl-riscv64-unknown-linux-gnu-5.36.0/lib/perl5/site_perl/5.36.0/riscv64-linux /nix/store/am6q1w1cgk0nax02i4p62ddwgh396l6p-perl5.36.0-XML-NamespaceSupport-1.12-riscv64-unknown-linux-gnu/lib/perl5/site_perl/5.36.0 /nix/store/am6q1w1cgk0nax02i4p62ddwgh396l6p-perl5.36.0-XML-NamespaceSupport-1.12-riscv64-unknown-linux-gnu/lib/perl5/site_perl/5.36.0/riscv64-linux /nix/store/5v2lvxgp5cjhibdczhgvf8lwvcc4nxrm-perl5.36.0-XML-SAX-Base-1.09-riscv64-unknown-linux-gnu/lib/perl5/site_perl/5.36.0 /nix/store/5v2lvxgp5cjhibdczhgvf8lwvcc4nxrm-perl5.36.0-XML-SAX-Base-1.09-riscv64-unknown-linux-gnu/lib/perl5/site_perl/5.36.0/riscv64-linux /nix/store/7fhvq7m7r20lxi6i9smvj8z3v88vrpi3-perl5.36.0-XML-SAX-1.02-riscv64-unknown-linux-gnu/lib/perl5/site_perl .).
> BEGIN failed--compilation aborted.
> make: *** [Makefile:743: install_sax_pureperl] Error 2
For full logs, run 'nix log /nix/store/mp6ap29xawb3mwjsb66dmy5z9a358g9a-perl5.36.0-XML-SAX-1.02-riscv64-unknown-linux-gnu.drv'.
error: 1 dependencies of derivation '/nix/store/fkp36ghyc5bc30ssyibj5ad8cxgzzy4r-perl-riscv64-unknown-linux-gnu-5.36.0-env.drv' failed to build
error: 1 dependencies of derivation '/nix/store/9d1slcn6318p8jkk3hckias0mqfjvhzd-install-grub.sh.drv' failed to build
error: 1 dependencies of derivation '/nix/store/mgl01qiwv01rxxwc0fx215a2kzixrg5s-nixos-system-ghaf-host-22.11.20230323.467f913.drv' failed to build
error: 1 dependencies of derivation '/nix/store/4mxfbydrjp4rffhn24xi6ddrrnsw259i-nixos-disk-image.drv' failed to build
[ghaf]$>
I just hit this issue as well and am coming to this trying to cross compile nixos to armv7l
(so not a Perl expert at all), but I think I can see why it's happening:
Looking at this issue, the problem seems to be that the default install target is install_sax_pureperl
, which is defined in the package's Makefile.PL
to be:
\t\@\$(PERL) -MXML::SAX -e "XML::SAX->add_parser(q(XML::SAX::PurePerl))->save_parsers()"
This won't work during cross-compilation because the PERL variable points to a perl.mini (not a full perl), which is only supposed to be used for configuration - according to the few references I've seen.
The nix derivation also has a postInstall
attribute that also uses the PERL variable - which will also be inappropriate during cross-compilation.
Not knowing the Perl ecosystem very well, I wonder if we could change the installTarget to pure_install
, which would stop this stateful mutation. If it's actually needed (I don't know), then perhaps there is another way to configure the interpreter using a config file or something similar?
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/cross-compiling-and-maybe-even-remote-deploying-a-nixos-system/31755/6
This is now preventing NixOS cross-compilation due to #246772.
Steps To Reproduce
Build
perlPackages.Testutf8
cross-compiled forarmv7l-hf-multiplatform
on ax86_64-linux
host:Build log
Additional context
Above build log is from
nixpkgs
at 9ecc270f02b09b2f6a76b98488554dd842797357. It also fails on latestmaster
(535abb755ed4f0b912bb70d2834371a358185ce8).Notify maintainers
I'm not sure who to notify here. The last maintainer appears to be a deleted user.
Metadata