add build target support#120249
Conversation
|
/rebase haskell-updates (we generally like to have Haskell related changes based on the |
|
/rebase haskell-updates |
|
Okay well I have no idea why this rebase action is not working. @Fresheyeball could you rebase this onto the |
|
Rebased, please reopen the pull request to restart CI |
cdepillabout
left a comment
There was a problem hiding this comment.
Oh, uhh, I guess the rebase action ended up working!
Just some other comments / questions.
There was a problem hiding this comment.
Do install and copy do the exact same thing here? Is there no difference in the output derivation?
Would you be able to provide some proof that this doesn't actually break anything?
I'm imagining taking a bunch of popular Haskell packages (where isLibrary is set to false), compiling them both with this PR and without, and showing that the output derivations are identical.
I'm somewhat surprised that this would cause so many rebuilds, especially since it should only affect non-library Haskell executables. I thought we just didn't have too many of those in nixpkgs.
There was a problem hiding this comment.
Do install and copy do the exact same thing here? Is there no difference in the output derivation?
If there is a difference, I didn't find it.
Would you be able to provide some proof that this doesn't actually break anything?
I did this:
nix-build ./. -A haskellPackages.pandoc
./result/bin/pandoc --helpand it worked. Not sure what more to do here.
I'm imagining taking a bunch of popular Haskell packages (where isLibrary is set to false), compiling them both with this PR and without, and showing that the output derivations are identical.
With the new version I pushed, these libraries should be uneffected. In fact, I think that there are no packages currently that use the buildTarget parameter and have isLibrary == false because they would not build today anyway.
|
@ofborg build haskellPackages.git-annex haskellPackages.wstunnel haskellPackages.spacecookie |
|
@ofborg eval |
61e8ec0 to
0163af1
Compare
|
@cdepillabout @sternenseemann I completely re-did the code. Now has comments and the requested tests as well. I also made a change to prevent so much of the ecosystem from needing recompilation. |
There was a problem hiding this comment.
@cdepillabout This line is what should preserve existing packages without rebuilds.
ae10f39 to
33f61ec
Compare
|
I rebased this on the current Originally, ofborg had run this against a branch that did not evaluate. This PR should now evaluate, so hopefully ofborg will update this with how many changes this will cause. Above, Fresheyeball was careful to write this in a way that should cause no changes. @GrahamcOfBorg build tests.haskell-setBuildTarget |
There was a problem hiding this comment.
Ah, sorry I didn't catch this earlier. callCabal2nix actually won't work here because it does IFD. This won't work on Hydra.
I think ofborg catches this, since evaluation still fails (https://gist.github.com/GrahamcOfBorg/4c5ca9d702aead273a0b8cedf6cb9fe1), but from the error message it is not clear what is going on.
@Fresheyeball could you rewrite this so it doesn't use IFD? Inlining the output from cabal2nix would probably be the easiest way to get this working.
There was a problem hiding this comment.
The error message is an import failure of a store path, so that's precisely the ifd failure :)
There was a problem hiding this comment.
@cdepillabout I admit I am dependant on callCabal2nix and don't know how to do what you ask.
There was a problem hiding this comment.
callCabal2nix just runs cabal2nix and uses imports the resulting .nix source file. You can just generate that file once by running the program manually.
There was a problem hiding this comment.
@Fresheyeball I added commit a77475b that shows what I was trying to say.
If you take a look at this and agree this looks alright, I think this should be okay to be merged in.
|
@GrahamcOfBorg eval @GrahamcOfBorg build tests.haskell-setBuildTarget |
|
Oh good, ofborg re-did the labels. Now it is clear this won't cause any rebuilds. |
There was a problem hiding this comment.
Replacing buildTarget with a list parameter called buildTargets would be nice, but I'm not sure to what extent buildTarget may be considered public API?
There was a problem hiding this comment.
Ah, yeah, that is a good idea. Although I'd argue that it shouldn't block this PR getting merged in as it currently as.
As for whether it would be considered a public API, I'm not sure. I've wondered about that as well. We have the functions in pkgs/development/haskell-modules/lib.nix that allow us to set the arguments in generic-builder.nix, but we don't have a function in pkgs/development/haskell-modules/lib.nix for every argument in generic-builder.nix, so sometimes you have to set them directly. It is also more convenient to set the arguments directly sometimes rather than going through the functions in pkgs/development/haskell-modules/lib.nix.
There was a problem hiding this comment.
As this hasn't been working properly until now, we probably can change stuff about it without to much problems, right?
There was a problem hiding this comment.
Ah, I see what you're saying. Since buildTarget hasn't actually been working correctly, then we don't really need to consider it part of the public API.
I think that makes sense, and it sounds like it makes sense to make that change.
Although I don't think it should necessarily stop this PR from being merged in.
There was a problem hiding this comment.
It has been working correctly for libraries
a77475b to
88d9f24
Compare
|
There was a merge conflict due to the tests slightly changing on the I'm going to go ahead and merge this in when ofborg finishes. @sternenseemann if we'd like to change the @Fresheyeball Thanks for getting this started and doing most of the work here. |
Motivation for this change
We may wish to build a single executable from a haskell package, instead of all executables in the package.
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)