Skip to content

Comments

openssl: cross compilation without host perl#115911

Merged
FRidh merged 1 commit intoNixOS:stagingfrom
thefloweringash:openssl-cross-perl
Mar 13, 2021
Merged

openssl: cross compilation without host perl#115911
FRidh merged 1 commit intoNixOS:stagingfrom
thefloweringash:openssl-cross-perl

Conversation

@thefloweringash
Copy link
Member

@thefloweringash thefloweringash commented Mar 11, 2021

The perl reference is in the interpreter line for c_rehash, so fix
that while we're here.

Motivation for this change

I initially ported perl-cross to darwin for aarch64-darwin bootstrap tools in #105026, but it wasn't of high enough quality to upstream. Looking at the dependency for perl, it was only from openssl, and not from any part used by the bootstrap tools.

It seems to be only the interpreter line for c_rehash, which is currently inconsistent.

Before

Native:
1.0.2: #!/nix/store/76qi9w2yd4xb8kykw3maj7n5g35qk7k2-perl-5.32.1/bin/perl
1.1: #!/usr/bin/env perl

Cross:
1.0.2: #!/nix/store/2gcqvw532bvcf4rvvg7a2rhpcyhxm28j-perl-5.32.1-aarch64-unknown-linux-gnu/bin/perl
1.1: #!/usr/bin/env perl

After

Native:
1.0.2: #!/nix/store/76qi9w2yd4xb8kykw3maj7n5g35qk7k2-perl-5.32.1/bin/perl
1.1: #!/nix/store/76qi9w2yd4xb8kykw3maj7n5g35qk7k2-perl-5.32.1/bin/perl

Cross:
1.0.2: #!/nix/store/2gcqvw532bvcf4rvvg7a2rhpcyhxm28j-perl-5.32.1-aarch64-unknown-linux-gnu/bin/perl
1.1: #!/nix/store/2gcqvw532bvcf4rvvg7a2rhpcyhxm28j-perl-5.32.1-aarch64-unknown-linux-gnu/bin/perl

Cross without perl:
1.0.2: #!/usr/bin/env perl
1.1: #!/usr/bin/env perl
Test case
let
  native = import ./. {
    localSystem = "x86_64-linux";
  };

  cross = import ./. {
    localSystem = "x86_64-linux";
    crossSystem = "aarch64-linux";
  };
in native.runCommand "openssl-interpreters" {} ''
  report() {
    local version=$1
    local pkg=$2
    echo -n "$version: "
    head -1 $pkg/bin/c_rehash
  }
  (
    echo "Native:"
    report 1.0.2 ${native.openssl_1_0_2}
    report 1.1   ${native.openssl_1_1}
    echo

    echo "Cross:"
    report 1.0.2 ${cross.openssl_1_0_2}
    report 1.1   ${cross.openssl_1_1}
    echo

    echo "Cross without perl:"
    report 1.0.2 ${cross.openssl_1_0_2.override { withPerl = false; }}
    report 1.1   ${cross.openssl_1_1.override { withPerl = false; }}
  ) > $out
''
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

The perl reference is in the interpreter line for c_rehash, so fix
that while we're here.
@ofborg ofborg bot added the 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. label Mar 11, 2021
@ofborg ofborg bot requested a review from peti March 11, 2021 10:09
@ofborg ofborg bot added 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 Mar 11, 2021
@siraben
Copy link
Member

siraben commented Mar 11, 2021

Related: openssl cannot cross-compile on Darwin because of this perl dependency. #113985

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

Labels

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-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 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.

3 participants