Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perlPackages.XMLParser: cross compilation is broken #73011

Closed
erictapen opened this issue Nov 8, 2019 · 3 comments
Closed

perlPackages.XMLParser: cross compilation is broken #73011

erictapen opened this issue Nov 8, 2019 · 3 comments
Labels
0.kind: bug Something is broken 6.topic: cross-compilation Building packages on a different platform than they will be used on

Comments

@erictapen
Copy link
Member

Describe the bug
perlPackages.XMLParser fails to cross compile on current nixos-unstable (7827d3f).

Unfortunately this means that one cannot crosscompile a NixOS system right now, as nixos/modules/system/activation/top-level.nix depends on the package.

To Reproduce
Run nix build nixpkgs.pkgsCross.aarch64-multiplatform.perlPackages.XMLParser.

$ nix log /nix/store/ig0bsk29l8rl5qvqy53n2n8gmnwib2m4-perl5.30.0-XML-Parser-2.46-aarch64-unknown-linux-gnu.drv
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/qmfwv8kx7dxihx6x47lcs5qnfq1x6m9w-XML-Parser-2.46.tar.gz
source root is XML-Parser-2.46
setting SOURCE_DATE_EPOCH to timestamp 1569302874 of file XML-Parser-2.46/MANIFEST
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
patching ./samples/xmlfilter...
patching ./samples/canonical...
patching ./samples/xmlcomments...
patching ./samples/xmlstats...
patching ./t/external_ent.t...
patching ./t/decl.t...
patching ./t/parament.t...

Expat must be installed prior to building XML::Parser and I can't find
it in the standard library directories. Install 'expat-devel' (or
'libexpat1-dev') package with your OS package manager. See 'README'.

Or you can download expat from:

http://sourceforge.net/projects/expat/

If expat is installed, but in a non-standard directory, then use the
following options to Makefile.PL:

    EXPATLIBPATH=...  To set the directory in which to find libexpat

    EXPATINCPATH=...  To set the directory in which to find expat.h

For example:

    perl Makefile.PL EXPATLIBPATH=/home/me/lib EXPATINCPATH=/home/me/include

Note that if you build against a shareable library in a non-standard location
you may (on some platforms) also have to set your LD_LIBRARY_PATH environment
variable at run time for perl to find the library.

no configure script, doing nothing
@nix { "action": "setPhase", "phase": "buildPhase" }
building
no Makefile, doing nothing
@nix { "action": "setPhase", "phase": "installPhase" }
installing
install flags: SHELL=/nix/store/zavn4np1jvm79f0rafkv0p1mrag09qkz-bash-4.4-p23/bin/bash pkgconfigdir=/nix/store/q3v25rngsdlaa31vxwxajhgylkqsbm2q-perl5.30.0-XML-Parser-2.46-aarch64-unknown-linux-gnu/lib/pkgconfig m4datadir=/nix/store/q3v25r>
make: *** No rule to make target 'install'.  Stop.

Additional context
I guess 076dc17, caused the issue, at least when I revert it, I can crosscompile the package.

Also this looks related to #36675.

For anybody in need of a quick and dirty fix: I use this patch to cross compile my system:

diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix
index 61822351ee2..846495ffc0f 100644
--- a/pkgs/top-level/perl-packages.nix
+++ b/pkgs/top-level/perl-packages.nix
@@ -20070,11 +20070,16 @@ let
 
   XMLParser = buildPerlPackage {
     pname = "XML-Parser";
-    version = "2.46";
-    src = fetchurl {
-      url = mirror://cpan/authors/id/T/TO/TODDR/XML-Parser-2.46.tar.gz;
-      sha256 = "0pai3ik47q7rgnix9644c673fwydz52gqkxr9kxwq765j4j36cfk";
-    };
+    version = if (stdenv.buildPlatform != stdenv.hostPlatform) then "2.44" else "2.46";
+    src = if (stdenv.buildPlatform != stdenv.hostPlatform) then
+      (fetchurl {
+        url = mirror://cpan/authors/id/T/TO/TODDR/XML-Parser-2.44.tar.gz;
+        sha256 = "05ij0g6bfn27iaggxf8nl5rhlwx6f6p6xmdav6rjcly3x5zd1s8s";
+      }) else
+      (fetchurl {
+        url = mirror://cpan/authors/id/T/TO/TODDR/XML-Parser-2.46.tar.gz;
+        sha256 = "0pai3ik47q7rgnix9644c673fwydz52gqkxr9kxwq765j4j36cfk";
+      });
     patchPhase = stdenv.lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
       substituteInPlace Expat/Makefile.PL --replace 'use English;' '#'
     '' + stdenv.lib.optionalString stdenv.isCygwin ''
@erictapen erictapen added the 0.kind: bug Something is broken label Nov 8, 2019
@veprbl veprbl added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Nov 8, 2019
@erictapen
Copy link
Member Author

Thanks!

@ilyakooo0
Copy link
Contributor

Was this issue actually resolved? There seems to be no link to a PR or anything.

@erictapen
Copy link
Member Author

This conversation is missing pieces due to GitHub removing all interactions by former user @volth. Luckily I had mail notifications enabled on that time, so here are the missing pieces:

volth: BTW, HTTP::Daemon is stuck to 6.01 and not updated for the same reason, the newer versions fail to cross-compile.
So, undoing of XMLParser: 2.44 -> 2.46 is good to

volth: XML::Parser is back to 2.44 as part of #73954
so, this issue could be closed (for some reason it was not closed automatically, probably because of merging to staging instead of master).

#73954 is itself unavailable due to the same reasons, but it was essentially a Perl packages mass upgrade (and a downgrade for XMLParser apparently).

So yes, this issue once was resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 6.topic: cross-compilation Building packages on a different platform than they will be used on
Projects
None yet
Development

No branches or pull requests

4 participants
@veprbl @ilyakooo0 @erictapen and others