the-real-blackh / hexpat

A general purpose Haskell XML library using Expat to do its parsing
BSD 3-Clause "New" or "Revised" License
2 stars 7 forks source link

build error with stack for hexpat 0.20.13 #9

Open pjljvandelaar opened 7 years ago

pjljvandelaar commented 7 years ago

When I use stack test --resolver=lts-8.20 on the project https://github.com/TorXakis/TorXakis/tree/develop/test/environment I get:

Downloaded lts-8.20 build plan.
List-0.6.0: using precompiled package
call-stack-0.1.0: using precompiled package
utf8-string-1.0.1.1: using precompiled package
HUnit-1.5.0.0: using precompiled package
text-1.2.2.1: configure
text-1.2.2.1: build
text-1.2.2.1: copy/register
hexpat-0.20.13: configure
Progress: 6/8
--  While building package hexpat-0.20.13 using:
      C:\sr\setup-exe-cache\x86_64-windows-integersimple\Cabal-simple_Z6RU0evB_1.24.2.0_ghc-8.0.2.exe --builddir=.stack-work\dist\1f7101f2 configure --with-ghc=C:\Users\laarpjljvd\AppData\Local\Programs\stack\x86_64-windows\ghc-integersimple-8.0.2\bin\ghc.EXE --with-ghc-pkg=C:\Users\laarpjljvd\AppData\Local\Programs\stack\x86_64-windows\ghc-integersimple-8.0.2\bin\ghc-pkg.EXE --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\3ba65e50\pkgdb --package-db=C:\TorXakisSandbox\TorXakis.git\test\environment\.stack-work\install\9d8bd90b\pkgdb --libdir=C:\TorXakisSandbox\TorXakis.git\test\environment\.stack-work\install\9d8bd90b\lib --bindir=C:\TorXakisSandbox\TorXakis.git\test\environment\.stack-work\install\9d8bd90b\bin --datadir=C:\TorXakisSandbox\TorXakis.git\test\environment\.stack-work\install\9d8bd90b\share --libexecdir=C:\TorXakisSandbox\TorXakis.git\test\environment\.stack-work\install\9d8bd90b\libexec --sysconfdir=C:\TorXakisSandbox\TorXakis.git\test\environment\.stack-work\install\9d8bd90b\etc --docdir=C:\TorXakisSandbox\TorXakis.git\test\environment\.stack-work\install\9d8bd90b\doc\hexpat-0.20.13 --htmldir=C:\TorXakisSandbox\TorXakis.git\test\environment\.stack-work\install\9d8bd90b\doc\hexpat-0.20.13 --haddockdir=C:\TorXakisSandbox\TorXakis.git\test\environment\.stack-work\install\9d8bd90b\doc\hexpat-0.20.13 --dependency=List=List-0.6.0-DSUjtMs8rH1JPyUMelwlu3 --dependency=base=base-4.9.1.0 --dependency=bytestring=bytestring-0.10.8.1 --dependency=containers=containers-0.5.7.1 --dependency=deepseq=deepseq-1.4.2.0 --dependency=text=text-1.2.2.1-I6zEsjh52lXKMQ9HHtqap1 --dependency=transformers=transformers-0.5.2.0 --dependency=utf8-string=utf8-string-1.0.1.1-1DpjxLeTvGg7ttZZojxJR5 --extra-include-dirs=C:\Users\laarpjljvd\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\include --extra-lib-dirs=C:\Users\laarpjljvd\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\bin --extra-lib-dirs=C:\Users\laarpjljvd\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib
    Process exited with code: ExitFailure 1
    Logs have been written to: C:\TorXakisSandbox\TorXakis.git\test\environment\.stack-work\logs\hexpat-0.20.13.log

    Configuring hexpat-0.20.13...
    Cabal-simple_Z6RU0evB_1.24.2.0_ghc-8.0.2.exe: Missing dependency on a foreign
    library:
    * Missing C library: expat
    This problem can usually be solved by installing the system package that
    provides this library (you may need the "-dev" version). If the library is
    already installed but in a non-standard location then you can use the flags
    --extra-include-dirs= and --extra-lib-dirs= to specify where it is.```

Same behavior observed for lts-9.1

When I use stack test --resolver=lts-8.18 everything goes ok

Downloaded lts-8.18 build plan.
List-0.6.0: using precompiled package
call-stack-0.1.0: using precompiled package
utf8-string-1.0.1.1: using precompiled package
HUnit-1.5.0.0: using precompiled package
text-1.2.2.1: configure
text-1.2.2.1: build
text-1.2.2.1: copy/register
hexpat-0.20.10: configure
hexpat-0.20.10: build
hexpat-0.20.10: copy/register
environment-0.2.1.0: configure (test)
Configuring environment-0.2.1.0...
environment-0.2.1.0: build (test)
Preprocessing test suite 'environment' for environment-0.2.1.0...
[1 of 3] Compiling TestTextXMLExpatTree ( TestTextXMLExpatTree.hs, .stack-work\dist\1f7101f2\build\environment\environment-tmp\TestTextXMLExpatTree.o )
[2 of 3] Compiling TestPreludeRead  ( TestPreludeRead.hs, .stack-work\dist\1f7101f2\build\environment\environment-tmp\TestPreludeRead.o )
[3 of 3] Compiling Main             ( TestMain.hs, .stack-work\dist\1f7101f2\build\environment\environment-tmp\Main.o )
Linking .stack-work\dist\1f7101f2\build\environment\environment.exe ...
environment-0.2.1.0: test (suite: environment)

Cases: 15  Tried: 15  Errors: 0  Failures: 0

Completed 8 action(s).

Same holds for lts 8.19....

the-real-blackh commented 7 years ago

You need to either install the libexpat-dev library on your operating system, or add the compile-time flag

cabal install -f bundle hexpat

not sure exactly how you do this on stack. See this issue for an explanation of why it's like this:

https://github.com/the-real-blackh/hexpat/issues/8

pjljvandelaar commented 7 years ago

Got it working with stack. I added to my *.yaml file

extra-deps:
- hexpat-0.20.13
flags: 
  hexpat:
    bundle: true

Yet, to me the default feels wrong: