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

callCabal2nix: Don't rebuild unchanged cabal file #23880

Merged

Conversation

ElvishJerricco
Copy link
Contributor

It can be quite annoying that callCabal2nix will build a new derivation if anything in the source has changed, even if the cabal file hasn't. In particular, you can trick Stack and Intero to work with a Nix based setup by using Stack's Nix integration and throwing away the ghc it gives you, but Intero freaks out when it sees building path(s) ... unexpectedly.

This patch uses cabal2nix on a filtered source that only includes the cabal file, then restores the src in the resulting derivation. This way the cabal2nix-<name> derivations will be cached between builds where non-cabal-files were changed.

It can be quite annoying that callCabal2nix will build a new derivation
if anything in the source has changed, even if the cabal file hasn't.
@mention-bot
Copy link

@ElvishJerricco, thanks for your PR! By analyzing the history of the files in this pull request, we identified @peti, @oxij and @3noch to be potential reviewers.

@3noch
Copy link
Contributor

3noch commented Mar 14, 2017

Very interesting approach! I'm glad it works!

@3noch
Copy link
Contributor

3noch commented Mar 14, 2017

I ignorantly wonder if this will have issues when a build requires that you copy a closure to a remote machine. I doubt it, but it's an edge case to consider.

@peti peti merged commit 1d58781 into NixOS:master Mar 14, 2017
@domenkozar
Copy link
Member

See #24245

ElvishJerricco added a commit to ElvishJerricco/nixpkgs that referenced this pull request Oct 24, 2017
peti added a commit that referenced this pull request Oct 24, 2017
…ild-cabalfile

callCabal2nix: Don't rebuild unchanged cabal file (Fixed #23880)
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