haskellPackages: allow configuring gmp when cross compiling#481162
haskellPackages: allow configuring gmp when cross compiling#481162wolfgangwalther merged 1 commit intoNixOS:haskell-updatesfrom
Conversation
sternenseemann
left a comment
There was a problem hiding this comment.
What problem are you attempting to solve here, exactly?
| !(lib.meta.availableOn stdenv.hostPlatform gmp && lib.meta.availableOn stdenv.targetPlatform gmp) | ||
| !(lib.meta.availableOn stdenv.hostPlatform gmp) | ||
| || !(lib.meta.availableOn stdenv.targetPlatform gmp) | ||
| || stdenv.targetPlatform.isStatic |
There was a problem hiding this comment.
This is a bad change. It is possible to build statically with GMP enabled and this may even be useful sometimes. It is also not a problem legally per se, you just have to ensure that it is possible for users to relink the resulting executable with another version of GMP. This is ostensibly possible when providing the user with the Nix expressions via overriding etc.
There was a problem hiding this comment.
I don't have a strong opinion myself. I did it this way based on #445672 (comment) but whatever consensus you guys reach works for me.
Current status is that we don't allow gmp for static builds because they're considered cross. More specifically, we allow enableNativeBignum but then skip the --with-gmp flags, so this seemed like the smallest relaxing of constraints that made it consistent and caused static TH to build
| @@ -311,6 +313,7 @@ | |||
| enableUnregisterised ? false, | |||
| }: | |||
|
|
|||
| assert !enableNativeBignum -> !stdenv.targetPlatform.isStatic; | |||
There was a problem hiding this comment.
As expressed, we shouldn't enforce this.
Currently, cross-compilation usually fails unless |
|
I think if we are going to flip the default for any platforms we'll need to add another subset next to |
Yeah, I think that makes a lot of sense. |
|
If we're ok with gmp on static builds, how about leaving the default unchanged (maybe flatten into - ++ lib.optionals (targetPlatform == hostPlatform && !enableNativeBignum) [
+ ++ lib.optionals (!enableNativeBignum) |
|
Yeah, that makes sense to me. |
Fixes error: linux: iserv-proxy-interpreter: Failed to lookup symbol: __gmpn_cmp
8e5e347 to
b6af0dc
Compare
sternenseemann
left a comment
There was a problem hiding this comment.
LGTM, but unsure whether this could cause any regressions.
I've been cherry-picking this into my other local branches to avoid needing to use |
|
If you've tested it, it's probably fine. |
ca96121
Fixed
Triggers rebuild for
Not sure why
pkgsCross.aarch64-multiplatformworked before as this is needed for integer-gmp flavour in #479902 as I would expect.Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.