Skip to content

perl: fix modules for compatibility with miniperl#225640

Closed
ck3d wants to merge 2 commits intoNixOS:stagingfrom
ck3d:fix-miniperl-modules
Closed

perl: fix modules for compatibility with miniperl#225640
ck3d wants to merge 2 commits intoNixOS:stagingfrom
ck3d:fix-miniperl-modules

Conversation

@ck3d
Copy link
Contributor

@ck3d ck3d commented Apr 10, 2023

Description of changes

When perl modules are cross-compiled, miniperl is used which do not allow dynamic loading.
This PR adds compatibitly for miniperl to following modules:

  • CPAN::Meta
  • JSON::PP
  • Data::Dumper

Additionally, this PR fixes #66741, the cross compilation for Perl module ModuleBuild. Following command will succeed:

nix-build -A pkgsCross.aarch64-multiplatform.perlPackages.ModuleBuild
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@ck3d ck3d requested review from dasJ, stigtsp and zakame as code owners April 10, 2023 20:37
@ofborg ofborg bot added 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Apr 10, 2023
@ck3d ck3d force-pushed the fix-miniperl-modules branch 2 times, most recently from 5269229 to 89da019 Compare April 15, 2023 14:15
@ofborg ofborg bot removed 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. labels Apr 15, 2023
@stigtsp
Copy link
Member

stigtsp commented Apr 15, 2023

Using builtins seems like a nice solution, I'll have a look!

@Artturin Artturin added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Apr 15, 2023
@G3zz
Copy link
Contributor

G3zz commented Jun 7, 2023

I can help test this on aarch64. What commands should I run?

@G3zz
Copy link
Contributor

G3zz commented Jun 7, 2023

I rebased over master on my nixpkgs fork: G3zz@f5c7e6e
I am currently trying to cross-compile nixos on this branch to see if this fixes the issue I was getting with File::Temp

@ck3d
Copy link
Contributor Author

ck3d commented Jun 8, 2023

The compilation of ModuleBuild give confidence for the patch. Thanks for your offer, but I do not know what else could be tested.

@stigtsp
Copy link
Member

stigtsp commented Jun 27, 2023

Hi there!

I think this looks like an interesting fix to issues with cross build. Planning on looking at this when perl-5.38.0 drops next week. The patches might need some work for 5.38.0 though.

@avnik
Copy link
Contributor

avnik commented Jun 27, 2023

I tried it on recent nixos-23.05 branch (with minimal required change -- one file renamed), it works and even allow me to build nix-build -A pkgsCross.aarch64-multiplatform.xdg-utils

@ck3d ck3d force-pushed the fix-miniperl-modules branch from 89da019 to 2d6f287 Compare July 2, 2023 13:02
@ck3d
Copy link
Contributor Author

ck3d commented Jul 2, 2023

Thanks for testing. I updated this PR to the latest version of branch statging.

@stigtsp
Copy link
Member

stigtsp commented Jul 6, 2023

I've included these commits, and updated them for perl-5.38.0 in:

@ck3d
Copy link
Contributor Author

ck3d commented Jul 6, 2023

Great, thanks. I will close this PR.

@ck3d ck3d closed this Jul 6, 2023
@stigtsp
Copy link
Member

stigtsp commented Jul 28, 2023

* [[staging] perl: 5.36.0 -> 5.38.0 #241848](https://github.com/NixOS/nixpkgs/pull/241848)

This has now been merged into staging, if anyone would like to test cross-builds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: cross-compilation Building packages on a different platform than they will be used on 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants