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

haskell generic-builder: Fix Dependencies #33368

Closed
wants to merge 4 commits into from

Conversation

Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Jan 3, 2018

Motivation for this change

The idea is that one can do cabal configure $NIX_CABAL_FOREIGN_FLAGS which ensure that Cabal knows about C headers and libs, but not the c compiler itself.

  • nativeGhc -> depsBuildBuild
  • Setup.hs libraries -> nativeBuildInputs
  • other tools -> nativeBuildInputs
  • libraries -> (propagated)NativeBuildInputs

Also, I'm trying to start the process of smoothing over the differences between our builder and shell env.

  • Everyone gets tools
  • Everyone only accesses C through Cabal
  • No one gets extra -system or -L flags

I'd like to go even farther and

  1. stop using ghcWithPackages
  2. pass --with-package-db to ./Setup / NIX_CABAL_FOREIGN_FLAGS
  3. Only use the new db in the builder for the to-be-built package

ghcWithPackages, OTOH, should use a cc-with-packages, for a completely (cabal-install or stack)-free persistent environments. Granted, I don't know why one would want to not use either of these tools, but if ghcWithPackages continues to exist with the plan above, this gives it its own clear-cut and distinct niche.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-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/)
  • Fits CONTRIBUTING.md.

@Ericson2314 Ericson2314 requested review from ttuegel and domenkozar and removed request for edolstra January 3, 2018 06:26
@Ericson2314 Ericson2314 changed the title haskell generic-builder: Fix Depedendencies haskell generic-builder: Fix Depedencies Jan 3, 2018
@Ericson2314 Ericson2314 changed the title haskell generic-builder: Fix Depedencies haskell generic-builder: Fix Dependencies Jan 3, 2018
@peti peti self-assigned this Jan 3, 2018
@peti
Copy link
Member

peti commented Jan 3, 2018

Can you please re-base on top of the current master to shrink the diff?

@ttuegel
Copy link
Member

ttuegel commented Jan 3, 2018

Why not set the flags through CABAL_CONFIG?

@Ericson2314
Copy link
Member Author

@ttuegel Oh, I didn't know about that. Perfect!

@peti Will do.

The idea is cabal-install / `./Setup` will know about C headers and
libs, but the C compiler itself will not directly.

 - nativeGhc          -> depsBuildBuild
 - Setup.hs libraries -> nativeBuildInputs
 - other tools        -> nativeBuildInputs
 - libraries          -> (propagated)NativeBuildInputs

Also, I'm trying to start the process of smoothing over the differences
between our builder and shell env.

 - Everyone gets tools
 - Everyone only accesses C through Cabal
Also make sure that Setup.hs dependencies are kept disjoint
@Ericson2314
Copy link
Member Author

OK the later commits I added aren't really appropriate at this time, as I need to dust off my darwin hack first and make it appropriate for nix-shell, but I added them just to get the full idea out there for critique.

@Ericson2314
Copy link
Member Author

Will revisit after #26799, which is very close.

@mmahut
Copy link
Member

mmahut commented Aug 3, 2019

What is the status of this pull request?

@ttuegel ttuegel removed their request for review September 28, 2019 11:57
@domenkozar
Copy link
Member

Closing this as it's out of sync.

@domenkozar domenkozar closed this Apr 22, 2020
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

6 participants