haskell: build Setup.hs with a separate pkgdb#39735
haskell: build Setup.hs with a separate pkgdb#39735kirelagin wants to merge 3 commits intoNixOS:masterfrom
Conversation
|
Yes, now, everything works. I can compile not only |
|
Thanks @mpickering for the ping! Right, this looks a bit more sophisticated than the hack I have in #37254. #37598 also does some improvements in this area. In general--and what @shlevy also mentioned--we likely really want to encode the I haven't looked into that much, as an alternative haskell infra[1,2,3,4], does expose the -- |
Yes, this will allow us to reuse Setups for standard build types, as what I don’t like currently is that the number of derivations built increased twofold and the output of |
|
@kirelagin I like this :). I, like @angerman, want more more derivations, but as #39646 shows @peti isn't yet on board either. This should be less controversial, yet also be a path towards more derivations as the same helpers can be reused in e.g. per-component derivations. So yeah, I think this is a net improvement while leaving all the doors open. Nice work :). |
|
@peti what do you say to this? I'll happily volunteer to fix the eval errors if @kirelagin doesn't beat me to it, but we need approval on the concept. |
|
So what’s the plan? |
|
#40996 has landed in |
This decreases complexity and ensures setup dependencies are properly specified with `setup-depends` as they should be. Testing will say if this is a reasonable change.
ed9b51c to
d416624
Compare
|
What is the status of this pull request? |
|
There is interesting stuff here but I tht the proximate issue is fixed? |
I guess this can be closed then. If anyone is looking for something that takes the path of turning more things into separate derivations, |
This is my current attempt at fixing #39646.
As outlined in that issue, I turned
Setup.hsof each project into a separate derivation. This makes sense in the context of cross-compilation generally, as the host architecture for./Setupis that of the builder, not of the host which we are building for.I have tested the first commit by building
pandoc,git-annexandqtah-generator(which ships a less trivialSetup.hs). Then I faced an issue with derivations produced bystack2nixand realised that it was caused by the fact that I ignoredpostUnpackhooks, thus second commit, which, hopefully, addresses it (I am building it at the moment to see if it worked).In general I am not very happy about doing all this unpacking and patching twice, it would be great if someone hinted me at how this could be done better.
I am sharing this now to get some advice on whether this direction is the right one in general.