Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to build on Windows with GHC 8.6.3 #3

Closed
ygale opened this issue Jan 22, 2019 · 8 comments
Closed

Fails to build on Windows with GHC 8.6.3 #3

ygale opened this issue Jan 22, 2019 · 8 comments

Comments

@ygale
Copy link

ygale commented Jan 22, 2019

When compiling 0.6 on Windows with GHC 8.6.3, the compilation hangs while trying to compile Database.PostgreSQL.Simple.FromField.

It compiles fine with GHC 8.6.2.

The module where it fails contains TH splices. So we suspect this might be caused by GHC bug #16057, which was introduced in GHC 8.6.3 and will be fixed in 8.6.4. This behavior is similar to what happens with other packages that are affected by this bug, such as yesodweb/shakespeare#233.

@phadej
Copy link
Collaborator

phadej commented Jan 22, 2019

@ygale is there something I could do besides setting up Windows CI and waiting for GHC-8.6.4?

@ygale
Copy link
Author

ygale commented Jan 22, 2019

@phadej Not that I know of. If you (or anyone else) happen to have a GHC HEAD on Windows, it would be great to verify that postgresql-simple builds there.

I am mainly reporting here so that other people who run into trouble will understand what is happening and know what to do - stick with 8.6.2 or some other earlier GHC version for now. Or go with GHC HEAD if you dare.

We're a yesod shop using stackage LTS by policy, so we're stuck on 8.4.4 for now. Which is a problem, due to a different TH bug (not just on Windows) that was only fixed in 8.6. But at least we have a (somewhat annoying) work-around for that one by this time.

@phadej
Copy link
Collaborator

phadej commented Jan 22, 2019

@ygale could you try a branch in #4

I simply removed TemplateHaskell from the library itself.

@ygale
Copy link
Author

ygale commented Jan 23, 2019

The library itself builds. Compilation of the test suite segfaults though:

Build profile: -w ghc-8.6.3 -O1
In order, the following will be built:
 - postgresql-simple-0.6 (test:inspection) (first run)
 - postgresql-simple-0.6 (test:test) (first run)
creating C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build
creating C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\tmp
creating
C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\inspection
creating
C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\test
creating
C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\inspection\cache
creating
C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\test\cache
Using self-exec internal setup method with build-type Simple and args:
["act-as-setup","--build-type=Simple","--","build","--verbose=2","--builddir=C:\\projects\\temp\\ghc863-bug\\postgresql-simple\\dist-newstyle\\build\\x86_64-windows\\ghc-8.6.3\\postgresql-simple-0.6\\t\\inspection"]
Using self-exec internal setup method with build-type Simple and args:
["act-as-setup","--build-type=Simple","--","build","--verbose=2","--builddir=C:\\projects\\temp\\ghc863-bug\\postgresql-simple\\dist-newstyle\\build\\x86_64-windows\\ghc-8.6.3\\postgresql-simple-0.6\\t\\test"]
C:\Users\YitzchakGale\AppData\Roaming\local\bin\cabal.exe act-as-setup
--build-type=Simple -- build --verbose=2
C:\Users\YitzchakGale\AppData\Roaming\local\bin\cabal.exe act-as-setup
--builddir=C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\inspection
--build-type=Simple -- build --verbose=2
--builddir=C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\test
Component build order: test suite 'inspection'
"C:\Users\YitzchakGale\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.3\bin\ghc-pkg.exe" "init" "C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\inspection\package.conf.inplace"
Component build order: test suite 'test'
"C:\Users\YitzchakGale\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.3\bin\ghc-pkg.exe" "init" "C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\test\package.conf.inplace"
creating
C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\inspection\build\inspection
creating
creating
C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\test\build\test
C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\inspection\build\inspection\autogen
creating
C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\test\build\test\autogen
creating
C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\inspection\build\inspection\autogen
creating
C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\test\build\test\autogen
Preprocessing test suite 'inspection' for postgresql-simple-0.6..
Preprocessing test suite 'test' for postgresql-simple-0.6..
Building test suite 'inspection' for postgresql-simple-0.6..
creating
C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\inspection\build\inspection
creating
C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\inspection\build\inspection\inspection-tmp
"C:\Users\YitzchakGale\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.3\bin\ghc.exe" "--make" "-no-link" "-fbuilding-cabal-package" "-O" "-static" "-outputdir" "C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\inspection\build\inspection\inspection-tmp" "-odir" "C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\inspection\build\inspection\inspection-tmp" "-hidir" "C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\inspection\build\inspection\inspection-tmp" "-stubdir" "C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\inspection\build\inspection\inspection-tmp" "-i" "-iC:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\inspection\build\inspection\inspection-tmp" "-itest" "-iC:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\inspection\build\inspection\autogen" "-iC:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\inspection\build\global-autogen" "-IC:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\inspection\build\inspection\autogen" "-IC:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\inspection\build\global-autogen" "-IC:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\inspection\build\inspection\inspection-tmp" "-optP-include" "-optPC:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\inspection\build\inspection\autogen\cabal_macros.h" "-hide-all-packages" "-Wmissing-home-modules" "-no-user-package-db" "-package-db" "C:\Users\YitzchakGale\AppData\Roaming\cabal\store\ghc-8.6.3\package.db" "-package-db" "C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\packagedb\ghc-8.6.3" "-package-db" "C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\inspection\package.conf.inplace" "-package-id" "base-4.12.0.0" "-package-id" "inspection-te_-0.4.1.1-6eadbc8aacf8e2d78de83999ba86e8d3b7fc501d" "-package-id" "postgresql-simple-0.6-inplace" "-package-id" "postgresql-li_-0.9.4.2-bd633db2d2c12505182e027f4796634d78eedafb" "-package-id" "tasty-1.2-989c92a954cd5c8de418c1ae94e72d46699bf220" "-package-id" "tasty-hunit-0.10.0.1-4fd6c2da59e8a867590164e8b8306160e8eaf4ba" "-XHaskell2010" "test\Inspection.hs" "-hide-all-packages"
Building test suite 'test' for postgresql-simple-0.6..
creating
C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\test\build\test
creating
C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\test\build\test\test-tmp
"C:\Users\YitzchakGale\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.3\bin\ghc.exe" "--make" "-no-link" "-fbuilding-cabal-package" "-O" "-static" "-outputdir" "C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\test\build\test\test-tmp" "-odir" "C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\test\build\test\test-tmp" "-hidir" "C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\test\build\test\test-tmp" "-stubdir" "C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\test\build\test\test-tmp" "-i" "-iC:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\test\build\test\test-tmp" "-itest" "-iC:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\test\build\test\autogen" "-iC:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\test\build\global-autogen" "-IC:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\test\build\test\autogen" "-IC:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\test\build\global-autogen" "-IC:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\test\build\test\test-tmp" "-optP-include" "-optPC:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\test\build\test\autogen\cabal_macros.h" "-hide-all-packages" "-Wmissing-home-modules" "-no-user-package-db" "-package-db" "C:\Users\YitzchakGale\AppData\Roaming\cabal\store\ghc-8.6.3\package.db" "-package-db" "C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\packagedb\ghc-8.6.3" "-package-db" "C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\test\package.conf.inplace" "-package-id" "base-4.12.0.0" "-package-id" "aeson-1.4.2.0-d9165f9f865a55b80d8a7bfec5637ae224cf4894" "-package-id" "base16-bytest_-0.1.1.6-07ee18fbcfbb6cf9e83c7fda643c7af2461be0a5" "-package-id" "bytestring-0.10.8.2" "-package-id" "containers-0.6.0.1" "-package-id" "cryptohash-md5-0.11.10_-b9ca87733846ca202627a634114b4e0ec52a9709" "-package-id" "filepath-1.4.2.1" "-package-id" "tasty-1.2-989c92a954cd5c8de418c1ae94e72d46699bf220" "-package-id" "tasty-hunit-0.10.0.1-4fd6c2da59e8a867590164e8b8306160e8eaf4ba" "-package-id" "tasty-golden-2.3.2-27add3581afd17f8225ed339d8f708efef7923b6" "-package-id" "HUnit-1.6.0.0-8c4812a91a3ab484da8a774ae8f95b7481be7904" "-package-id" "postgresql-simple-0.6-inplace" "-package-id" "text-1.2.3.1" "-package-id" "time-1.8.0.2" "-package-id" "vector-0.12.0.2-6b222e88e924d650f6a50b57b267e19f9a20644b" "-package-id" "case-insensit_-1.2.0.11-53cd350d0c160f2dc0d54c3c4c66d8865e0cc8fa" "-XHaskell2010" "-XNamedFieldPuns" "-XOverloadedStrings" "-XRank2Types" "-XRecordWildCards" "-XPatternGuards" "-XScopedTypeVariables" "Common" "Notify" "Serializable" "Time" "test\Main.hs" "-Wall" "-fno-warn-name-shadowing" "-fno-warn-unused-do-bind" "-hide-all-packages"
[4 of 5] Compiling Time             ( test\Time.hs, C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\test\build\test\test-tmp\Time.o )

Access violation in generated code when reading 0x14421d1d00

 Attempting to reconstruct a stack trace...

   Frame        Code address
 * 0x4cddae0    0x3d78d85 C:\Users\YitzchakGale\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.3\bin\ghc.exe+0x3978d85

[1 of 1] Compiling Main             ( test\Inspection.hs, C:\projects\temp\ghc863-bug\postgresql-simple\dist-newstyle\build\x86_64-windows\ghc-8.6.3\postgresql-simple-0.6\t\inspection\build\inspection\inspection-tmp\Main.o )

Access violation in generated code when reading 0x15422c8200

 Attempting to reconstruct a stack trace...

   Frame        Code address
 * 0x4cddae0    0x3d7df89 C:\Users\YitzchakGale\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.3\bin\ghc.exe+0x397df89

CallStack (from HasCallStack):
  die', called at .\\Distribution\\Client\\ProjectOrchestration.hs:917:8 in cabal-install-2.2.0.0-8WGwHgnhIVJHm63PvWcOgs:Distribution.Client.ProjectOrchestration
cabal: Failed to build postgresql-simple-0.6-inplace-inspection. The build
process terminated with exit code 11
Failed to build postgresql-simple-0.6-inplace-test. The build process
terminated with exit code 11

@phadej
Copy link
Collaborator

phadej commented Jan 23, 2019

@ygale oh yes, the inspection test suite uses TemplateHaskell to verify that we don't need template haskell were it was previously. Could you comment out that test-suite and run the other one (which actually speaks with the DB)

@ruomad
Copy link

ruomad commented Feb 4, 2019

I got the same problem which forces me to stick to ghc 8.6.2

@ruomad
Copy link

ruomad commented Feb 4, 2019

I can confirm that using the no-th branch last commits I can compile with ghc 8.6.3 and everything looks OK

@phadej
Copy link
Collaborator

phadej commented Mar 3, 2019

@phadej phadej closed this as completed Mar 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants