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
libgcrypt: Fix cross-compilation #35520
Conversation
@@ -135,6 +135,8 @@ let | |||
inherit overrides; | |||
|
|||
inherit cc; | |||
|
|||
isCross = targetPlatform != buildPlatform; |
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.
@Ericson2314 FYI
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.
@shlevy Actually I've been purposely resisting doing anything like that.
The concept of three platform parameters (Build, Host, and Target) is nasty (the target platform really ought not to exist), but when people try to package existing legacy software without understanding those three, the results can be quite confusing. (I had to sort out lots of that from earlier cross attempts.)
Not having an isCross
forces people to understand the 3 before doing anything, which while annoying, prevents that issue. I wish I had a less hostile solution, but I haven't thought of any. Thoughts?
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.
@Ericson2314 I'm really not a huge fan of making things more verbose and annoying for this kind of case... If we really need to have a more stringent review in these cases, maybe we can have Ofborg ping some nixpkgs-cross-committers group when stdenv.isCross
is added to some file? @grahamc ?
Success on x86_64-linux (full log) Partial log (click to expand)
|
Success on x86_64-darwin (full log) Partial log (click to expand)
|
Success on aarch64-linux (full log) Partial log (click to expand)
|
@@ -19,10 +21,19 @@ stdenv.mkDerivation rec { | |||
# The build enables -O2 by default for everything else. | |||
hardeningDisable = stdenv.lib.optional stdenv.cc.isClang "fortify"; | |||
|
|||
depsBuildBuild = stdenv.lib.optional stdenv.isCross buildPackages.stdenv.cc; |
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.
Lets make this unconditional? It won't hurt for native builds, but conversely every cross-only conditional is an invitation for bit-rot. Totally understand landing as is first, and then sending in the unconditional version as a staging PR after if its a mass-rebuild. [Sometimes my rebuild avoidance is just impatience to get something else working :).]
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.
@Ericson2314 already done on staging :) 24ad507
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.
Haha nice
buildInputs = [ libgpgerror ] | ||
++ stdenv.lib.optional stdenv.isDarwin gettext | ||
++ stdenv.lib.optional enableCapabilities libcap; | ||
|
||
preConfigure = if stdenv.isCross then '' |
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.
If libgpgerror
doesn't depend on (native) libgcrypt
, then hopefully this can be unconditional too?
No description provided.