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.ModuleBuild (a dependency of git) fails to cross-compile #66741

Closed
lopsided98 opened this issue Aug 17, 2019 · 20 comments
Closed

perlPackages.ModuleBuild (a dependency of git) fails to cross-compile #66741

lopsided98 opened this issue Aug 17, 2019 · 20 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

@lopsided98
Copy link
Contributor

perlPackages.ModuleBuild fails to cross-compile, which prevents git from cross-compiling (unless perlSupport = false). I don't have much experience with Perl, but my understanding is that Scalar::Util is trying to load an XS module. I'm not sure how to work around this.

unpacking sources
unpacking source archive /nix/store/jwpgfd4pziwrrx2hywr9ckf9xil7aizc-Module-Build-0.4229.tar.gz
source root is Module-Build-0.4229
setting SOURCE_DATE_EPOCH to timestamp 1555368693 of file Module-Build-0.4229/t/xs.t
patching sources
updateAutotoolsGnuConfigScriptsPhase
configuring
patching ./t/properties/share_dir.t...
patching ./t/compat/exit.t...
patching ./t/xs.t...
patching ./t/write_default_maniskip.t...
patching ./t/versions.t...
patching ./t/use_tap_harness.t...
patching ./t/unit_run_test_harness.t...
patching ./t/tilde.t...
patching ./t/test_types.t...
patching ./t/test_type.t...
patching ./t/test_reqs.t...
patching ./t/test_file_exts.t...
patching ./t/signature.t...
patching ./t/script_dist.t...
patching ./t/runthrough.t...
patching ./t/ppm.t...
patching ./t/pod_parser.t...
patching ./t/parents.t...
patching ./t/par.t...
patching ./t/notes.t...
patching ./t/new_from_context.t...
patching ./t/mymeta.t...
patching ./t/metadata2.t...
patching ./t/metadata.t...
patching ./t/manifypods.t...
patching ./t/install_extra_target.t...
patching ./t/install.t...
patching ./t/help.t...
patching ./t/files.t...
patching ./t/extend.t...
patching ./t/ext.t...
patching ./t/destinations.t...
patching ./t/debug.t...
patching ./t/compat.t...
patching ./t/basic.t...
patching ./t/add_property_hash.t...
patching ./t/add_property_array.t...
patching ./t/add_property.t...
patching ./t/PL_files.t...
patching ./bin/config_data...
# running Build.PL --prefix /nix/store/9lm1ijj01kmimdplwrs77faflwzxjir3-perl5.28.2-Module-Build-0.4229-armv6l-unknown-linux-gnueabihf --installdirs site --config perl=/nix/store/dv4w3l6jclic0wqbkpwv6m79wbfkvk9n-perl-5.28.2-armv6l-unknown-linux-gnueabihf-dev/bin/perl --fullperl "/nix/store/by0xi2dd0aha8armhbkd2a3zdqzrjnmi-perl-5.28.2/bin/perl"
Checking prerequisites...
  test_requires:
    !  Couldn't find a $VERSION in prerequisite File::Temp

Checking optional features...
inc_bundling_support....disabled
  requires:
    ! inc::latest is not installed

ERRORS/WARNINGS FOUND IN PREREQUISITES.  You may wish to install the versions
of the modules indicated above before proceeding with this installation

Attempt to reload Scalar/Util.pm aborted.
Compilation failed in require at /nix/store/81lwy2awhy4fqxxiyqcc9jflslrzl2bm-perl-5.28.2-armv6l-unknown-linux-gnueabihf/lib/perl5/5.28.2/armv6l-linux/Data/Dumper.pm line 312.
Couldn't run Build.PL: No such file or directory at lib/Module/Build/Compat.pm line 341.

Maintainer information:

attribute:
  - perlPackages.ModuleBuild
  - git

cc @shlevy @volth because you've worked on Perl cross-compiling

@lopsided98 lopsided98 added the 0.kind: bug Something is broken label Aug 17, 2019
@FRidh FRidh added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Aug 17, 2019
@lopsided98
Copy link
Contributor Author

I read through the explanation in the manual about creating a stub implementation, but I'm not sure what to do in this case because Scalar::Util is part of Perl core.

@lopsided98
Copy link
Contributor Author

Personally, I don't really care about ModuleBuild, I just want git to cross-compile out of the box. Maybe the best solution is just to set perlSupport = false when cross-compiling, or disable git-instaweb.

@stale
Copy link

stale bot commented Jun 2, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 2, 2020
@lopsided98
Copy link
Contributor Author

I'm pretty sure this hasn't been fixed.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 2, 2020
@stale
Copy link

stale bot commented Nov 29, 2020

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 29, 2020
@yorickvP
Copy link
Contributor

yorickvP commented Jan 4, 2021

Still happening

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 4, 2021
@lopsided98
Copy link
Contributor Author

This now breaks cross-compiled NixOS because perlPackages.XMLParser transitively depends on ModuleBuild after a0d34c7.

@stigtsp
Copy link
Member

stigtsp commented Jan 22, 2021

Hey. I think reverting a0d34c7 will be a reasonable short term fix if it blocking cross-compilation. With it reverted, XML::Parser builds:

$ nix-build -A pkgsCross.aarch64-multiplatform.perlPackages.XMLParser

But git doesn't, due to perlPackages.HTMLTagCloud failing.


$ nix-build -A pkgsCross.aarch64-multiplatform.git
[..]
# running Build.PL --prefix /nix/store/8wsx1bzm95vgcb04rcvwiscxryfidj7x-perl5.32.0-Module-Build-0.4231-aarch64-unknown-linux-gnu --installdirs site --config perl=/nix/store/fv6p0jsiw4iq6k9llzjg3zg93ydh8b1n-perl-5.32.0-aarch64-unknown-linux-gnu-mini/bin/perl --fullperl "/nix/store/0akzg9fx7yi2cgzlxs41fymprnnjvcrm-perl-5.32.0/bin/perl"
Checking prerequisites...
  test_requires:
    !  Couldn't find a $VERSION in prerequisite File::Temp

Checking optional features...
inc_bundling_support....disabled
  requires:
    ! inc::latest is not installed

ERRORS/WARNINGS FOUND IN PREREQUISITES.  You may wish to install the versions
of the modules indicated above before proceeding with this installation

Attempt to reload Scalar/Util.pm aborted.
Compilation failed in require at /nix/store/3q92j7gdgh6i49knics4d3m78x8hz2ss-perl-5.32.0-aarch64-unknown-linux-gnu/lib/perl5/5.32.0/aarch64-linux/Data/Dumper.pm line 304.
Couldn't run Build.PL: No such file or directory at lib/Module/Build/Compat.pm line 341.
builder for '/nix/store/i2gz0353rd0yam3l7wcr5ljm22sp8hyz-perl5.32.0-Module-Build-0.4231-aarch64-unknown-linux-gnu.drv' failed with exit code 2
cannot build derivation '/nix/store/a43rsvfzibkghyi6gsy85xa26fkn1g0g-perl5.32.0-HTML-TagCloud-0.38-aarch64-unknown-linux-gnu.drv': 1 dependencies couldn't be built
error: build of '/nix/store/a43rsvfzibkghyi6gsy85xa26fkn1g0g-perl5.32.0-HTML-TagCloud-0.38-aarch64-unknown-linux-gnu.drv' failed

@lopsided98
Copy link
Contributor Author

Yeah, reverting that commit won't fix git because ModuleBuild is still broken, it would just stop ModuleBuild from being a requirement to build a NixOS system.

@stale
Copy link

stale bot commented Jul 21, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 21, 2021
@lopsided98
Copy link
Contributor Author

ModuleBuild still fails to cross-compile, but Perl support is git is now disabled when cross-compiling.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 21, 2021
@ju1m
Copy link
Contributor

ju1m commented Oct 16, 2021

This also prevents xdg-utils to cross-compile. And thus services.x11.xserver.enable = true fails to cross-compile.

@stigtsp stigtsp assigned zakame and unassigned zakame Oct 16, 2021
@zakame
Copy link
Member

zakame commented Oct 19, 2021

This sounds similar to #115170 - will take a better look 👀

@zakame
Copy link
Member

zakame commented Oct 20, 2021

Yeah, its basically the same thing as #115170 - the failing step

Checking prerequisites...
  test_requires:
    !  Couldn't find a $VERSION in prerequisite File::Temp

Is due to https://metacpan.org/release/LEONT/Module-Build-0.4231/source/Build.PL#L67 which doesn't really make sense for our purposes as File::Temp in our Perls are now way past 0.15:

  test_requires         => {
    'File::Temp'            => 0.15,    # tmpdir() + fixes
    'Test::More'            => 0.49,
$ nix-shell -p perl --run 'perl -MFile::Temp -E "say \$File::Temp::VERSION"'
0.2311

postPatch PR to follow shortly.

@ius
Copy link
Contributor

ius commented Feb 2, 2022

This once again breaks cross compiled NixOS because of #154809 pulling this in via ConfigIniFiles

@dasJ
Copy link
Member

dasJ commented Feb 3, 2022

stc sould be fixed by #158021

@ius
Copy link
Contributor

ius commented Feb 15, 2022

Flips sign: 0 days since the last incident. NixOS fails to cross compile again.

This time it's #157329 depending on Array-Compare which pulls in Moo, which lists ModuleRuntime in propagatedBuildInputs. As long as there's no structural fix for this issue I'm afraid we risk running into it on every rework of the core perl scripts..

@dasJ If you happen to have some time to look at it again, or someone else who does know perl...

@stigtsp
Copy link
Member

stigtsp commented Feb 15, 2022

Attempted to do a quick fix by looking more closely at modules pulled in by Array::Compare and it's dependencies, but it quickly becomes a rabbit hole where Module::Build or a dynamic perl (in case of tests for Type::Tiny) is needed. Need figure out how to fix Module::Build for cross builds to solve this class of recurring problems ...

Anyway, I've added a workaround for stc that avoids Array::Compare here #160176

@avnik
Copy link
Contributor

avnik commented Jun 27, 2023

Problem still actual, it blocks xdg-utils build

@lopsided98
Copy link
Contributor Author

This particular issue has been fixed by #225640, although Git with Perl support still fails due to a different error in libnet:

Can't load module IO, dynamic loading not available in this perl.
  (You may need to build a new perl executable which either supports
  dynamic loading or has the IO module statically linked into it.)
 at /nix/store/1yicwrwa8izkvf9vpv93wsznx5iq5pf4-perl-armv6l-unknown-linux-gnueabihf-5.38.0/lib/perl5/5.38.0/armv6l-linux/IO/Handle.pm line 268.
Compilation failed in require at /nix/store/1yicwrwa8izkvf9vpv93wsznx5iq5pf4-perl-armv6l-unknown-linux-gnueabihf-5.38.0/lib/perl5/5.38.0/armv6l-linux/IO/Handle.pm line %.
BEGIN failed--compilation aborted at /nix/store/1yicwrwa8izkvf9vpv93wsznx5iq5pf4-perl-armv6l-unknown-linux-gnueabihf-5.38.0/lib/perl5/5.38.0/armv6l-linux/IO/Handle.pm line %.
Compilation failed in require at /nix/store/1yicwrwa8izkvf9vpv93wsznx5iq5pf4-perl-armv6l-unknown-linux-gnueabihf-5.38.0/lib/perl5/5.38.0/armv6l-linux/IO/Seekable.pm line %.
BEGIN failed--compilation aborted at /nix/store/1yicwrwa8izkvf9vpv93wsznx5iq5pf4-perl-armv6l-unknown-linux-gnueabihf-5.38.0/lib/perl5/5.38.0/armv6l-linux/IO/Seekable.pm line %.
Compilation failed in require at /nix/store/1yicwrwa8izkvf9vpv93wsznx5iq5pf4-perl-armv6l-unknown-linux-gnueabihf-5.38.0/lib/perl5/5.38.0/armv6l-linux/IO/File.pm line %.
BEGIN failed--compilation aborted at /nix/store/1yicwrwa8izkvf9vpv93wsznx5iq5pf4-perl-armv6l-unknown-linux-gnueabihf-5.38.0/lib/perl5/5.38.0/armv6l-linux/IO/File.pm line %.
Compilation failed in require at Configure line %.
BEGIN failed--compilation aborted at Configure line %.
Generating a Unix-style Makefile
Writing Makefile for Net
no configure script, doing nothing
building
build flags: SHELL=/nix/store/9b4skch97sv02rwmczbxp1pwg382hv84-bash-5.2-p15/bin/bash
make: *** No rule to make target 'libnet.cfg', needed by 'pm_to_blib'.  Stop.

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

Successfully merging a pull request may close this issue.

10 participants