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: fix errant references when cross-compiling #65761

Merged
merged 1 commit into from
Nov 5, 2019

Conversation

lopsided98
Copy link
Contributor

Motivation for this change

Cross-compiled Perl ends up with references to its source tarball and build coreutils.

Things done

The source tarball reference was a bit perplexing, but it turns out that Perl's build system uses the src environment variable, and writes its value into a header in the output. For native builds, some part of the config ends up of overwriting this variable, but this does not happen when cross-compiling.

The coreutils reference was simply an assumption that the correct binary would be in PATH.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option 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 nix-review --run "nix-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.
Notify maintainers

cc @edolstra

@lopsided98
Copy link
Contributor Author

I guess we need some special case for the Darwin bootstrap perl. I'm not sure what package provides pwd in that case.

@lopsided98
Copy link
Contributor Author

Oh, I see #58979 ran into the same problem.

@lopsided98
Copy link
Contributor Author

I applied the coreutils fix only to cross builds and added a comment explaining why this was done.

@matthewbauer matthewbauer added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Aug 28, 2019
@lopsided98 lopsided98 force-pushed the perl-cross-references branch from 4f7d24b to a77c9e2 Compare November 4, 2019 21:14
@lopsided98 lopsided98 force-pushed the perl-cross-references branch from a77c9e2 to 3084045 Compare November 4, 2019 21:16
@lopsided98
Copy link
Contributor Author

Sorry, I accidentally rebased on master...

Copy link
Member

@Ericson2314 Ericson2314 left a comment

Choose a reason for hiding this comment

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

I would put the comments outside the ''...'' that way they don't affect the drv. Otherwise looks good!

@lopsided98 lopsided98 force-pushed the perl-cross-references branch from 3084045 to 49afaab Compare November 5, 2019 05:35
@lopsided98
Copy link
Contributor Author

I fixed the comments.

@Ericson2314
Copy link
Member

Thank you!

@Ericson2314 Ericson2314 merged commit f11ed19 into NixOS:staging Nov 5, 2019
@lopsided98 lopsided98 deleted the perl-cross-references branch November 5, 2019 23:55
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+ 10.rebuild-darwin: 5001+ 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild 10.rebuild-linux: 501+ 10.rebuild-linux: 5001+ 10.rebuild-linux-stdenv This PR causes stdenv to rebuild
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants