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
Merge nix-shell and build environments of haskell derivations #6307
Conversation
GHC doesn't seem to respect the RPATH (even for dynamic libraries), but instead records the value of --extra-include-dirs and --extra-lib-dirs in the package's installedconf. So we need to set those to the correct values.
The check if the include/lib directory exists is easier to do in bash. Doing it in bash also means that we don't have to build the systemLibraries store paths just to evaluate the derivation (this fixes the tarball build).
Sorry if it is a stupid a question, but what changes, what opportunities are we getting? :) I really can't get it from the description. |
@jagajaga You don't need a separate |
@bennofs oh! got it. Looks nice. 👍 |
I implemented the same feature in bbb109c a while ago: instead of creating a custom The design goals I hoped to achieve were:
As it happens, the new code didn't meet those goals entirely. Regarding (1), the code did become simpler, but only marginally so, because some logic is still required to compute the proper set of Goal (2) came through, of course, but at a price: with the new builder, every Haskell build required an additional build to set up its compiler environment. In other words, an attempt to build 1 derivation actually built 2, littering Last but not least, goal (3) did work out, but it became apparent that there is trouble on the horizon. In my attempts writing the generic builder, I tried hard to leave
The new build description distinguishes nicely between Haskell library dependencies (that Now, the problem with regard to unifying At some point I began to wonder whether the fact that those two build styles had separate attributes (which allows the user to choose the one she prefers) is a good thing, actually. Furthermore, I have some ideas for the Now, your pull request chooses a slightly different path than my implementation, because it doesn't request the As far as the other pros and cons are concerned, both your and my implementation seem to be about the same. |
Thank you very much for this extremly detailed response! I see now why you choose to go the path of an So this PR can be closed then. |
This is an experiment to merge the
.env
and the normal build environment of packages by usingghcWithPackages
for building too. The duplication of store paths is avoided by building the wrapper in a temporary directory directly while building the derivation itself. The advantages of this approach are:nix-shell
on normal derivations and don't need to deal with the.env
attributeI've successfully build all packages from https://github.com/peti/ci/blob/master/haskell-nixpkgs.nix with
big = false
with the new builder. Of course this means that any changes to the wrapper also require recompilation of all haskell packages, but the wrapper doesn't change that often anyway. The wrapper for the old haskellPackages set was changed last in November 2013, for example, which is over a year ago./cc @peti and anyone else interrested in haskell nixpkgs packaging.