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

Feature/ghc gmp #43711

Merged
merged 4 commits into from Jul 23, 2018
Merged

Feature/ghc gmp #43711

merged 4 commits into from Jul 23, 2018

Conversation

angerman
Copy link
Contributor

Motivation for this change

Broken out of #43559

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option 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/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@angerman angerman requested a review from peti as a code owner July 18, 2018 02:36
] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
] ++ stdenv.lib.optional (targetPlatform == hostPlatform && !enableIntegerSimple) [
"--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
]) ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
Copy link
Member

Choose a reason for hiding this comment

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

The extra ) appears to be a typo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, fat-fingered that :(

@peti
Copy link
Member

peti commented Jul 18, 2018

How did you test these changes?

Do ghcWithPackages and ghcWithHoogle still work properly?

@angerman
Copy link
Contributor Author

I've only tested this with a mingw cross compiler. That is, I built the full ghc on the host:macOS, and a cross compiler:macOS -> mingw.

GHC needs one integer library be it integer-simple or integer-gmp.
When providing the GMP library, it needs to be the target one (as @Ericson2314 pointed out, targetPackages is essentially id when build == host == target).

GHC also has an--in-tree-gmp option, which is usually the fallback if no GMP library is found.

@peti
Copy link
Member

peti commented Jul 18, 2018

Do ghcWithPackages and ghcWithHoogle still work properly?

Also, could you please verify that those builds that are supposed to use the gmp-based integer library actually do so? The patch causes re-builds on all platforms, not just the interger-simple ones, so I reckon it might be a good idea to make sure there's no regression.

@Ericson2314
Copy link
Member

@peti Err the point of this is the GMP ones, not the integer simple ones. GMP was just being inferred by default before, and that inferred (on the GHC side) happened to be unreliable (in the cross case). This forces the build system to use GMP when we want it to. By contrast, I'm not sure why anything has changed for the integer-simple builds, unless those happen to depend on the GMP ones for some reason and thus are downstream rebuilds.

@peti
Copy link
Member

peti commented Jul 21, 2018

Err the point of this is the GMP ones, not the integer simple ones.

Yes, I understand what the change intends to do. I guess I was simply suggesting that it might be a good idea that that actually does what it's supposed to do and nothing else.

Anyhow, I'll trust your judgement. Proceed as you think would be best.

@peti peti removed their request for review July 21, 2018 08:22
@matthewbauer matthewbauer merged commit 4069149 into NixOS:master Jul 23, 2018
@FRidh
Copy link
Member

FRidh commented Jul 23, 2018

@matthewbauer Please use staging in the future.

@matthewbauer
Copy link
Member

Ok - will do that next time. Is that recommended for GHC though? Basically any change will be 500+ (no stdenv changes).

@domenkozar
Copy link
Member

domenkozar commented Jul 23, 2018

@matthewbauer
Copy link
Member

Ok sounds good. Sorry for any inconvenience.

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

7 participants