Skip to content

Fix using local stack snapshots#338

Merged
angerman merged 1 commit intoinput-output-hk:masterfrom
serokell:balsoft/snapshot-yaml
Dec 4, 2019
Merged

Fix using local stack snapshots#338
angerman merged 1 commit intoinput-output-hk:masterfrom
serokell:balsoft/snapshot-yaml

Conversation

@kirelagin
Copy link
Contributor

@kirelagin kirelagin commented Nov 28, 2019

Used to be part of #334. I added a test for this and made a bunch of little tweaks here and there to make sure that it actually works 🙄.

The newly added test now passes, but, for some reason, it produces the following warnings, I have no clue why:

substituteStream(): WARNING: pattern '/nix/store/<hash>-stack-local-resolver' doesn't match anything in file '/nix/store/<hash>-stack-to-nix-pkgs/stack-local-resolver.nix'
substituteStream(): WARNING: pattern '/nix/store/<hash>-stack-local-resolver' doesn't match anything in file '/nix/store/<hash>-stack-to-nix-pkgs/default.nix'
substituteStream(): WARNING: pattern '/nix/store/<hash>-stack-local-resolver' doesn't match anything in file '/nix/store/<hash.-stack-to-nix-pkgs/pkgs.nix'

cc @balsoft

@kirelagin
Copy link
Contributor Author

builder for '/nix/store/zbq43r5jdbb4i48j8n15cd0b1yg1488l-stack-simple-0.1.0.0-lib-stack-simple.drv' failed with exit code 1; last 4 log lines:
  unpacking sources
  unpacking source archive /
  cp: '/' and '/' are the same file
  do not know how to unpack source archive /

cool story

@kirelagin kirelagin force-pushed the balsoft/snapshot-yaml branch from 69bd646 to 7c2c364 Compare November 28, 2019 18:37
@kirelagin
Copy link
Contributor Author

The problem was that stack-to-nix sets src to path to stack.yaml relative to out and the previous version of the change set stack-yaml=stack.yaml, that is relative. Now it is absolute again, so src gets set correctly, but... it still doesn’t quite work 🤔.

@kirelagin
Copy link
Contributor Author

Ok, got it, scratch these changes. The correct fix is to make stack-to-yaml mimic stack’s behaviour in that local snapshot is resolved relative to the location of stack.yaml.

@kirelagin
Copy link
Contributor Author

So I removed the “fix” commit from this PR, but the test is still useful (merge it after bumping the version of nix-tools used by haskell.nix).

@kirelagin kirelagin force-pushed the balsoft/snapshot-yaml branch from 48c6f32 to d6008a4 Compare November 28, 2019 21:11
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.

awesome! A test case 🎉 !

@angerman angerman merged commit a3b3e0e into input-output-hk:master Dec 4, 2019
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