Skip to content

Add the ability to cache stack projects#334

Merged
angerman merged 1 commit intoinput-output-hk:masterfrom
serokell:cache-fixes
Dec 4, 2019
Merged

Add the ability to cache stack projects#334
angerman merged 1 commit intoinput-output-hk:masterfrom
serokell:cache-fixes

Conversation

@balsoft
Copy link
Contributor

@balsoft balsoft commented Nov 27, 2019

This PR allows one to pass type as one of the attributes in any attrset of cache list in stackProject/cabalProject. If omitted, it's set to cabal and the behavious is as was before. Otherwise, it can be set to stack and then the dependency will be callStackToNixed instead of callCabalToNix.

Also fixes the problem where stack.yaml can't set resolver to a local file.

Copy link
Collaborator

@angerman angerman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with the overlay/haskell.nix changes. The changes to lib/call-stack-to-nix.nix seem to try to paper over a defect in stack-to-nix. I'd rather we solve that in stack-to-nix.

I believe that was fixed in input-output-hk/nix-tools#69

cp ${mkCacheFile cache} $out/.stack-to-nix.cache
'' + ''
(cd $out && stack-to-nix ${stackToNixArgs})
(cd ${src} && stack-to-nix ${stackToNixArgs})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the .stack-to-nix.cache file is in $out not $src.

@balsoft
Copy link
Contributor Author

balsoft commented Dec 4, 2019

@angerman Yes, you are right. The second fix is mostly wrong.

@balsoft balsoft requested a review from angerman December 4, 2019 06:21
Copy link
Collaborator

@angerman angerman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants