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

perl: use perl-cross to enable cross-compilation (native build unchanged) #33578

Merged
merged 1 commit into from Jan 19, 2018

Conversation

dtzWill
Copy link
Member

@dtzWill dtzWill commented Jan 7, 2018

Motivation for this change

Get perl cross-compiling!

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.


meta = {
homepage = https://arsv.github.io/perl-cross;
description = "Cross-compilation standard implementation of the Perl 5 programmming language";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes it sound like a separate implementation of Perl. But it's only a configure script + Makefiles to be used with standard Perl.

How about this, taken from the their github page: "Configure and build perl with a cross-compiling toolchain".

if stdenv.buildPlatform == stdenv.hostPlatform
then (callPackages ../development/interpreters/perl {})
else (callPackages ../development/interpreters/perl-cross {})
) perl perl522 perl524 perl526;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it too bold to make the perl-cross build system overlay the default build environment for native too? (In any case, it can wait, I'm just curious.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of merging them, and just pushed fixes that get this working by (among other minor fixes) grabbing most of the existing expression.

I don't think using it by default will go over well-- I thought this came up before but can't find the discussion now...

Of course it would be convenient if we could use the same for both!

perl522 = common {
perlVersion = "5.22.2";
perlVersion = "5.22.4";
perlSha256 = "1yk1xn4wmnrf2ph02j28khqarpyr24qwysjzkjnjv7vh5dygb7ms";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this hash need an update?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

After investigating, the answer is actually "no"--it's just that the original hash from the earlier commit
was from 5.22.4 not 5.22.2. This hash matches the one we're using for this version in the 'normal' perl expression.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(and I just refetched and confirmed, for some reason the download went realllyyyy slow)

@dtzWill
Copy link
Member Author

dtzWill commented Jan 18, 2018

Tested that native hash doesn't change, and still builds successfully for cross on raspberryPi and aarch64.

EDIT: squashed!

cc @Ericson2314

@dtzWill dtzWill changed the title [WIP] perl-cross perl: use perl-cross to enable cross-compilation (native build unchanged) Jan 18, 2018
@Ericson2314
Copy link
Member

Cool! well merge in a second.

@Ericson2314 Ericson2314 merged commit 65d0ebe into NixOS:master Jan 19, 2018
@dtzWill dtzWill deleted the fix/perl-cross branch January 21, 2018 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants