Closed nh2 closed 6 years ago
That said, I'm not sure stack2nix
uses even the location
git entries correctly. It seems to not create cabal2nix entries on those (they seem to be skipped).
Stack is used as a lib, so it's parsed correctly, but it could be interpreted incorrectly. I think it actually does work, but cabal2nix uses a heuristic to guess if something is a local path vs git vs bazar.
btw @nh2 this works for me, maybe try using https for git urls?
@domenkozar Doesn't seem to work for me.
Here is exactly what I'm running:
When changing the stack.yaml
file to the old syntax (in my branch https://github.com/nh2/intray/blob/wip-old-extra-deps-git-syntax/stack.yaml), I get this output:
No error reported.
On 0841d5e
unmodified I get:
There are many weird things going on here, including a new shell prompt [nix-shell:~/src/haskell/intray]$
in the middle of the output, suggesting that stack2nix
forked a child process, and then exited itself, so we have a reparented process running around.
Applying the diff
diff --cc stack.yaml
index f577b94,f577b94..83a0fb3
--- a/stack.yaml
+++ b/stack.yaml
@@@ -21,7 -21,7 +21,7 @@@ extra-deps
- servant-auth-server-0.3.2.0
- servant-flatten-0.2
- servant-options-0.1.0.0
--- git: git@github.com:NorfairKing/validity.git
++- git: https://github.com/NorfairKing/validity.git
commit: a86dd3e4830c14c056a0d5d8712864d395d25b2a
subdirs:
- validity
@@@ -46,6 -46,6 +46,6 @@@
subdirs:
- typed-uuid
- genvalidity-typed-uuid
--- git: git@github.com:NorfairKing/pretty-relative-time.git
++- git: https://github.com/NorfairKing/pretty-relative-time.git
commit: 9a670db25ac68974045c75da364486c10970824f
resolver: lts-11.9
to change git URLs to https, I get this output (which is similar bus when sorted shows that it actually has some different packages being passed to cabal2nix
, for example it doesn't have pretty-show
in the output):
Could you try using https://github.com/input-output-hk/stack2nix/pull/108 - it seems like Nix 1.0 is picked from old nixpkgs commit and you're running Nix 2.0 on your machine. That's fixed now in there.
Tried again now on commit 9070f91
. It ran throught without issue. Great!
Now building the result (stack
itself). I'll reopen if I see another issue related to this.
Current stack allows to write this new syntax:
the old syntax for this was to put it in
packages
:See https://www.fpcomplete.com/blog/2017/07/stacks-new-extensible-snapshots:
If you use the new
extra-deps
syntax, then you get a lot of confusing and fancy errors fromcabal2nix
:Stack still supports the old syntax so using that is a workaround, but
stack2nix
should ideally learn the new syntax as well. I suppose that shouldn't be too hard because it's semantically identical to the other one as far as I know.