-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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 and .FileBaseDir: fix cross-compilation WIP #222427
Conversation
pkgs/top-level/perl-packages.nix
Outdated
# use fullperl since default perl do not support dynamic linking | ||
export PATH="$fullperl/bin:$PATH" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use addToSearchPath PATH "$fullperl/bin"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your proposal doesn't work. The function addToSearchPath adds dir at the end off and not at the beginning.
@ofborg build pkgsCross.aarch64-multiplatform.xdg-utils |
I added the same patch to FileBaseDir. You can now cross-compile xdg-utils |
Basically the same fix, but in another approach, is being carried out in #225086, may you also take a look? |
Thanks, looks better than my approach. I will update this PR. |
5d96bb2
to
8795962
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Since this causes 0 rebuilds, this can go to master directly.
Isn't the reason why we use miniperl is that the normal perl doesn't cross compile stuff? |
Oh, shit:
In this case, there are no binaries in there and the result probably runs on aarch64 (I'll test), but this approach will totally break for things that build perl modules. Edit: the "cross-compiled" File::BaseDir (non-native) perl module successfully loads on aarch64. |
The differences between perl and perl.mini in case of cross compilation are:
I will mark this PR as WIP as long we did not fix these issues. |
I close this PR in favor of #225640 |
Description of changes
This PR fixes #66741, the cross compilation for Perl module ModuleBuild and FileBaseDir. Following command will succeed:
A cross compiled Perl module gets pkgs.perl.mini passed instead of pkgs.perl. The mini do not allow dynamic loading, which causes errors during build.
definition of perl.mini:
https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/interpreters/perl/default.nix#L34
usage of perl.mini:
https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/perl-modules/generic/default.nix#L46
Following issues suffer from the same problem and can hopefully fixed in a similar way:
perlPackages.Testutf8
fails when cross-compiling #198548Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)