Open hasufell opened 4 years ago
That is odd. That error usually appears when stuff is not in this list:
https://github.com/nh2/stack2nix/blob/c009e33af30c76b8fe94388382d816079fb5ac4e/pkg_versions.txt#L92
But libiserv/8.6.3
is in there.
A minimal repro is:
index c113006..473da42 100644
--- a/static-stack2nix-builder-example/stack.yaml
+++ b/static-stack2nix-builder-example/stack.yaml
@@ -1,3 +1,5 @@
resolver: lts-14.7
packages:
- .
+extra-deps:
+ - time-1.9.3
Edit: When trying this with plain stack
, we also need to use the dependency to make stack put it into the build plan, e.g.:
--- a/static-stack2nix-builder-example/package.yaml
+++ b/static-stack2nix-builder-example/package.yaml
@@ -6,6 +6,7 @@ maintainer: "mail@nh2.me"
dependencies:
- base >= 4.7 && < 5
+- time
library:
source-dirs: src
Then after stack build
will the newer time
version show up in stack exec -- ghc-pkg list time
.
I think I have the solution:
We need the same as https://github.com/nh2/stack2nix/commit/6b29a9efc4f8d4326983321e2a7cec94e02a8623 but for libiserv
.
That makes it run through for me locally.
I haven't figured out yet though why it happens only when you put that time
into extra-deps
.
It looks like some problem in old Stack adding libiserv into build plan, I couldn't find why that happens yet :-\
@nh2 I have found the reason this happens. It's another occurrence of the same problem Michael wrote about in https://www.snoyman.com/blog/2019/01/mismatched-global-packages . Overriding time
triggers rebuild for any dependent packages and in this case libserv is one of such libraries, see https://github.com/commercialhaskell/core-cabal-files/blob/master/libiserv-8.6.3.cabal . The dependency is not direct - libserv
depends on unix
which depends on time
.
default.nix:
stack.yaml:
https://github.com/input-output-hk/haskell.nix/commit/14615173c2adf03fdaad8ee010c47732d609cd01 and https://github.com/input-output-hk/haskell.nix/issues/269 seem related