nh2 / static-haskell-nix

easily build most Haskell programs into fully static Linux executables
388 stars 36 forks source link

Building arbitrary stack project failed: stack2nix: <stdout>: commitBuffer: invalid argument (invalid character) #82

Closed thautwarm closed 3 years ago

thautwarm commented 4 years ago

I'm trying to build static executable from my stack project here.

It uses lts-13.26 so the this line shall not change:

https://github.com/nh2/static-haskell-nix/blob/95fa110091dff2bf6dace3921c18a26c264d776e/static-stack2nix-builder-example/default.nix#L9

And my only change is this line, by filling cabalPackageName with purescript-python.

https://github.com/nh2/static-haskell-nix/blob/95fa110091dff2bf6dace3921c18a26c264d776e/static-stack2nix-builder-example/default.nix#L8

It seems due to this:

extra-deps:
- github: purescript/purescript
  commit: ed130c78b708ff55cf4a80b126a1bd3ba5d80eb9

I got genNixFile: No support for archive package locations, so I change it to

extra-deps:
- purescript-0.13.6

which is the version closest to their master branch.

Finally I got this error and cannot work it out after a while:

+ cabal2nix --subpath . --system x86_64-linux --compiler ghc-8.6.5 /home/redy/+ cabal2nix --subpath . --system x86_64-linux --compiler ghc-8.6.5 cabal://pushbullet-types-0.4.1.0
+ cabal2nix --subpath . --system x86_64-linux --compiler ghc-8.6.5 cabal://pusher-http-haskell-1.5.1.9
stack2nix: <stderr>: commitBuffer: invalid argument (invalid character)

This is strange, because this seems to be a solved issue: https://github.com/input-output-hk/stack2nix/issues/150 .

I also tried adding export LC_ALL=en_US.UTF-8 before building.

Before each building I cleanup things and retry $(nix-build ...)

nh2 commented 3 years ago

I believe this is fiixed with current stack2nix updated in PR #98, please re-open or ping me if you find it to happen still.