input-output-hk/stack2nix

Cannot build with nixpkgs 18.03, fails on yaml-0.8.32

Closed this issue · 5 comments

$ nix-channel --list
nixpkgs https://nixos.org/channels/nixos-18.03
$ nix-build https://github.com/input-output-hk/stack2nix/archive/master.tar.gz
...
No uhc found
building
Preprocessing library for yaml-0.8.32..
Building library for yaml-0.8.32..
[ 1 of 11] Compiling Paths_yaml       ( dist/build/autogen/Paths_yaml.hs, dist/build/Paths_yaml.o )
[ 2 of 11] Compiling Text.Libyaml     ( src/Text/Libyaml.hs, dist/build/Text/Libyaml.o )
[ 3 of 11] Compiling Data.Yaml.Parser ( src/Data/Yaml/Parser.hs, dist/build/Data/Yaml/Parser.o )
[ 4 of 11] Compiling Data.Yaml.Internal ( src/Data/Yaml/Internal.hs, dist/build/Data/Yaml/Internal.o )
[ 5 of 11] Compiling Data.Yaml.Include ( src/Data/Yaml/Include.hs, dist/build/Data/Yaml/Include.o )
[ 6 of 11] Compiling Data.Yaml.Builder ( src/Data/Yaml/Builder.hs, dist/build/Data/Yaml/Builder.o )
[ 7 of 11] Compiling Data.Yaml.Pretty ( src/Data/Yaml/Pretty.hs, dist/build/Data/Yaml/Pretty.o )
[ 8 of 11] Compiling Data.Yaml        ( src/Data/Yaml.hs, dist/build/Data/Yaml.o )
[ 9 of 11] Compiling Data.Yaml.TH     ( src/Data/Yaml/TH.hs, dist/build/Data/Yaml/TH.o )
[10 of 11] Compiling Data.Yaml.Config ( src/Data/Yaml/Config.hs, dist/build/Data/Yaml/Config.o )
[11 of 11] Compiling Data.Yaml.Aeson  ( src/Data/Yaml/Aeson.hs, dist/build/Data/Yaml/Aeson.o )
[ 1 of 11] Compiling Paths_yaml       ( dist/build/autogen/Paths_yaml.hs, dist/build/Paths_yaml.p_o )
[ 2 of 11] Compiling Text.Libyaml     ( src/Text/Libyaml.hs, dist/build/Text/Libyaml.p_o )
[ 3 of 11] Compiling Data.Yaml.Parser ( src/Data/Yaml/Parser.hs, dist/build/Data/Yaml/Parser.p_o )
[ 4 of 11] Compiling Data.Yaml.Internal ( src/Data/Yaml/Internal.hs, dist/build/Data/Yaml/Internal.p_o )
[ 5 of 11] Compiling Data.Yaml.Include ( src/Data/Yaml/Include.hs, dist/build/Data/Yaml/Include.p_o )
[ 6 of 11] Compiling Data.Yaml.Builder ( src/Data/Yaml/Builder.hs, dist/build/Data/Yaml/Builder.p_o )
[ 7 of 11] Compiling Data.Yaml.Pretty ( src/Data/Yaml/Pretty.hs, dist/build/Data/Yaml/Pretty.p_o )
[ 8 of 11] Compiling Data.Yaml        ( src/Data/Yaml.hs, dist/build/Data/Yaml.p_o )
[ 9 of 11] Compiling Data.Yaml.TH     ( src/Data/Yaml/TH.hs, dist/build/Data/Yaml/TH.p_o )
[10 of 11] Compiling Data.Yaml.Config ( src/Data/Yaml/Config.hs, dist/build/Data/Yaml/Config.p_o )
[11 of 11] Compiling Data.Yaml.Aeson  ( src/Data/Yaml/Aeson.hs, dist/build/Data/Yaml/Aeson.p_o )

In file included from c/helper.c:4:0: error: 

c/helper.h:4:10: error:
     fatal error: yaml.h: No such file or directory
     #include <yaml.h>
              ^~~~~~~~
  |
4 | #include <yaml.h>
  |          ^
compilation terminated.
`cc' failed in phase `C Compiler'. (Exit code: 1)
builder for '/nix/store/5mkx89jx7y5bpz4l7l4vassld3m3xn2b-yaml-0.8.32.drv' failed with exit code 1
cannot build derivation '/nix/store/qlgkipxxzh1asvfyi4j7fw3m5ag1k93x-cabal2nix-2.10.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/93flmxzr2493lz7vndia9byfagfa6l91-stack-1.7.1.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/mskszwahk8d532ivsj2zjqp8mddir6ix-stack2nix-0.1.3.1.drv': 1 dependencies couldn't be built
error: build of '/nix/store/mskszwahk8d532ivsj2zjqp8mddir6ix-stack2nix-0.1.3.1.drv' failed

Hm; ok, I see this is the same as #112, but I still don't understand what should I do to make it work now :(

I would suggest using nixpkgs master and just nix-build -A stack2nix <nixpkgs>. I'll fix this for now in the repo.

Fixed in master.

For a bit more background: I actually tried stack2nix from nixpkgs-unstable as well as from nixos-18.03 (that were the first things I tried). The former failed to build (but I assumed that's an inherent risk of trying unstable); the latter failed to parse the stack.yml I had. So I tried to use this repo's master, again with no luck (as above). All this work took me already 2+ days and I didn't know what else I could try. I'm kinda between noob and intermediate in Nix, so there are still a lot of areas and failure modes I don't understand well. I just thought I can at least report this issue and maybe hopefully start a discussion that could help me, and/or maybe other people in similar situation, resolve this.

From your reply above, I understand I can now take 46a6736 or later and try again, right? Thanks for the tweak!

edit: Yep, it built — thanks again! 😄

Fixed also nixpkgs: NixOS/nixpkgs@d2c55eb - thanks for the report!