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

Allow git to be cross-compiled #39425

Merged
merged 4 commits into from Apr 24, 2018
Merged

Allow git to be cross-compiled #39425

merged 4 commits into from Apr 24, 2018

Conversation

bgamari
Copy link
Contributor

@bgamari bgamari commented Apr 24, 2018

Motivation for this change

Allow the user to disable git's dependencies on perl, making it possible to cross-compile it.

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.

@@ -62,6 +62,11 @@ stdenv.mkDerivation {
NIX_LDFLAGS = stdenv.lib.optionalString (!stdenv.cc.isClang) "-lgcc_s"
+ stdenv.lib.optionalString (stdenv.isFreeBSD) "-lthr";

configureFlags = stdenv.lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
"ac_cv_fread_reads_directories=yes"
"ac_cv_snprintf_returns_bogus=no"
Copy link
Contributor

Choose a reason for hiding this comment

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

Aren't these autoconf settings supposed to be dependent on the libc, not on build != host? (This may be a more general issue, just wondering.)

Copy link
Contributor Author

@bgamari bgamari Apr 24, 2018

Choose a reason for hiding this comment

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

Indeed these won't always be correct; we are trying to predict what the results would be if the autoconf tests were run on the host. Of course, this is a losing battle so the best we can do is guess. I believe these results should hold for most "reasonable" environments but if you know of any notable cases where these answers would be wrong then do let me know.

Copy link
Member

Choose a reason for hiding this comment

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

Improving that will not cause native rebuilds so easy to do later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I should say that I also find this sort of hack quite unsatisfactory. I've needed to do this quite a bit while getting things cross-compiling but sadly haven't yet come up with a better option.

@LnL7
Copy link
Member

LnL7 commented Apr 24, 2018

@Ericson2314 This should go to staging, it rebuilds almost +5000 packages.

@matthewbauer
Copy link
Member

It's already in evaluation 1451298 so probably too late:

https://hydra.nixos.org/eval/1451298

@LnL7
Copy link
Member

LnL7 commented Apr 24, 2018

Well, it's broken so nothing actually gets cached until the next eval.

@Ericson2314
Copy link
Member

My bad on missing the ofborg numbers.

@Artturin Artturin mentioned this pull request Jul 22, 2022
13 tasks
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