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

openssl: cross compilation without host perl #115911

Merged
merged 1 commit into from
Mar 13, 2021

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.
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants