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
Conversation
Previously this was injected during install, causing the build system to rebuild the entire package.
@@ -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" |
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@Ericson2314 This should go to staging, it rebuilds almost +5000 packages. |
It's already in evaluation 1451298 so probably too late: |
Well, it's broken so nothing actually gets cached until the next eval. |
My bad on missing the ofborg numbers. |
Motivation for this change
Allow the user to disable
git
's dependencies onperl
, making it possible to cross-compile it.Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)