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

libgcrypt: Fix cross-compilation #35520

Merged
merged 1 commit into from Feb 25, 2018
Merged

Conversation

shlevy
Copy link
Member

@shlevy shlevy commented Feb 25, 2018

No description provided.

@@ -135,6 +135,8 @@ let
inherit overrides;

inherit cc;

isCross = targetPlatform != buildPlatform;
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

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?

Copy link
Member Author

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 ?

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Partial log (click to expand)

/nix/store/xdiixrq7j3mxpnshffxa9vbs73j893d5-libgcrypt-1.8.2

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Partial log (click to expand)

/nix/store/fyq06lmsxrimyavbw3nlnm2y9w3v3x7y-libgcrypt-1.8.2

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Partial log (click to expand)

/nix/store/iy8zn6cd87samkw5bnkqh3x7jp1wpk4x-libgcrypt-1.8.2

@shlevy shlevy closed this Feb 25, 2018
@shlevy shlevy deleted the libgcrypt-cross branch February 25, 2018 04:02
@shlevy shlevy merged commit 1c1a6df into NixOS:master Feb 25, 2018
@@ -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;
Copy link
Member

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 :).]

Copy link
Member Author

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

Copy link
Member

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 ''
Copy link
Member

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?

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

3 participants