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

Compilation failure for postgresql-simple #267

Open
ocharles opened this issue Nov 9, 2014 · 19 comments
Open

Compilation failure for postgresql-simple #267

ocharles opened this issue Nov 9, 2014 · 19 comments

Comments

@ocharles
Copy link

ocharles commented Nov 9, 2014

building path(s) `/nix/store/2qb6s2r270aili3mib92j2g8zyn9hl1i-haskell-postgresql-simple-ghcjs0.1.0-0.4.4.1'
building /nix/store/2qb6s2r270aili3mib92j2g8zyn9hl1i-haskell-postgresql-simple-ghcjs0.1.0-0.4.4.1
unpacking sources
unpacking source archive /nix/store/ip2mm4ad6nhghc0kd08iysq9gk0byv8j-postgresql-simple-0.4.4.1.tar.gz
source root is postgresql-simple-0.4.4.1
patching sources
configuring
[1 of 1] Compiling Main             ( Setup.hs, /tmp/nix-build-haskell-postgresql-simple-ghcjs0.1.0-0.4.4.1.drv-0/Main.o )
Linking Setup ...
configure flags: --disable-split-objs --disable-library-profiling --enable-shared  --package-db=/nix/store/q940zfvd2gq5q9fzysjciliky6c62zfx-haskell-blaze-builder-ghcjs0.1.0-0.3.3.4/lib/ghcjs-0.1.0_ghc-7.8.3/package.conf.d --package-db=/nix/store/j2l8fdf933v6wiq5sc6zc6dxnwazybr2-haskell-blaze-textual-ghcjs0.1.0-0.2.0.9/lib/ghcjs-0.1.0_ghc-7.8.3/package.conf.d --package-db=/nix/store/jid2g2nrbiwr1pxc31517nf7rqdzplfd-haskell-postgresql-libpq-ghcjs0.1.0-0.9.0.1/lib/ghcjs-0.1.0_ghc-7.8.3/package.conf.d --package-db=/nix/store/0rzb1mcakq2kxiglk1v09r5zddwdrak8-haskell-uuid-ghcjs0.1.0-1.3.4/lib/ghcjs-0.1.0_ghc-7.8.3/package.conf.d  --package-db=/nix/store/7f6dhlmc9qzsq4msbyaw2k1f20znk8rf-haskell-ghcjs-ghc7.8.3-0.1.0-shared/share/ghcjs/x86_64-linux-0.1.0-7.8.3/ghcjs/package.conf.d
Configuring postgresql-simple-0.4.4.1...
Dependency aeson >=0.6: using aeson-0.8.0.0
Dependency attoparsec >=0.10.3: using attoparsec-0.12.1.0
Dependency base <5: using base-4.7.0.1
Dependency blaze-builder -any: using blaze-builder-0.3.3.4
Dependency blaze-textual -any: using blaze-textual-0.2.0.9
Dependency bytestring >=0.9: using bytestring-0.10.4.1
Dependency containers -any: using containers-0.5.5.1
Dependency hashable -any: using hashable-1.2.2.0
Dependency postgresql-libpq >=0.9: using postgresql-libpq-0.9.0.1
Dependency scientific -any: using scientific-0.3.3.0
Dependency template-haskell -any: using template-haskell-2.9.0.0
Dependency text >=0.11.1: using text-1.1.1.3
Dependency time -any: using time-1.4.2
Dependency transformers -any: using transformers-0.4.1.0
Dependency uuid >=1.3.1: using uuid-1.3.4
Dependency vector -any: using vector-0.10.11.0
Using Cabal-1.21.0.0 compiled by ghc-7.8
Using compiler: ghcjs-0.1.0_ghc-7.8.3
Using install prefix:
/nix/store/2qb6s2r270aili3mib92j2g8zyn9hl1i-haskell-postgresql-simple-ghcjs0.1.0-0.4.4.1
Binaries installed in:
/nix/store/2qb6s2r270aili3mib92j2g8zyn9hl1i-haskell-postgresql-simple-ghcjs0.1.0-0.4.4.1/bin
Libraries installed in:
/nix/store/2qb6s2r270aili3mib92j2g8zyn9hl1i-haskell-postgresql-simple-ghcjs0.1.0-0.4.4.1/lib/ghcjs-0.1.0_ghc-7.8.3/postgresql-simple-0.4.4.1
Private binaries installed in:
/nix/store/2qb6s2r270aili3mib92j2g8zyn9hl1i-haskell-postgresql-simple-ghcjs0.1.0-0.4.4.1/libexec
Data files installed in:
/nix/store/2qb6s2r270aili3mib92j2g8zyn9hl1i-haskell-postgresql-simple-ghcjs0.1.0-0.4.4.1/share/x86_64-linux-ghcjs-0.1.0_ghc-7.8.3/postgresql-simple-0.4.4.1
Documentation installed in:
/nix/store/2qb6s2r270aili3mib92j2g8zyn9hl1i-haskell-postgresql-simple-ghcjs0.1.0-0.4.4.1/share/doc/x86_64-linux-ghcjs-0.1.0_ghc-7.8.3/postgresql-simple-0.4.4.1
Configuration files installed in:
/nix/store/2qb6s2r270aili3mib92j2g8zyn9hl1i-haskell-postgresql-simple-ghcjs0.1.0-0.4.4.1/etc
Using alex version 3.1.3 found on system at:
/nix/store/mdfmy05y2bnffd6lrxid8x3pprhlqlfx-alex-3.1.3/bin/alex
Using ar found on system at:
/nix/store/ycmsiznf2484vbjwmj57jdy2ncyrj7fj-binutils-2.23.1/bin/ar
No c2hs found
Using cpphs version 1.18.5 found on system at:
/nix/store/i3341idwmxwyzvhx82p64l3y4wqchki4-haskell-cpphs-ghc7.8.3-1.18.5-shared/bin/cpphs
No ffihugs found
Using gcc version 4.8.3 found on system at:
/nix/store/12k2cnlgppwzgwar7ipzpr9i6pv27rl0-gcc-wrapper-4.8.3/bin/gcc
Using ghc version 7.8.3 found on system at:
/nix/store/xbxwhrir23gdjk7hb3qrdqg0bdwc8pml-ghc-7.8.3-wrapper/bin/ghc
Using ghc-pkg version 7.8.3 found on system at:
/nix/store/xbxwhrir23gdjk7hb3qrdqg0bdwc8pml-ghc-7.8.3-wrapper/bin/ghc-pkg
Using ghcjs version 0.1.0 found on system at:
/nix/store/1kz14g3whndz8y5c3xzllcck1xjcgzdc-ghcjs-ghc7.8.3-0.1.0-wrapper/bin/ghcjs
Using ghcjs-pkg version 0.1.0 found on system at:
/nix/store/1kz14g3whndz8y5c3xzllcck1xjcgzdc-ghcjs-ghc7.8.3-0.1.0-wrapper/bin/ghcjs-pkg
No greencard found
Using haddock version 2.15.0 found on system at:
/nix/store/v307hqhbk29g2gp318bfrqxxy8vqaa3g-haddock-2.15.0/bin/haddock
Using happy version 1.19.4 found on system at:
/nix/store/fsr2hssgwggvcdy57b2lh63916i011fk-happy-1.19.4/bin/happy
Using haskell-suite found on system at: haskell-suite-dummy-location
Using haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location
No hmake found
Using hpc version 0.67 found on system at:
/nix/store/xbxwhrir23gdjk7hb3qrdqg0bdwc8pml-ghc-7.8.3-wrapper/bin/hpc
Using hsc2hs version 0.67 found on system at:
/nix/store/xbxwhrir23gdjk7hb3qrdqg0bdwc8pml-ghc-7.8.3-wrapper/bin/hsc2hs
No hscolour found
No hugs found
No jhc found
Using ld found on system at:
/nix/store/12k2cnlgppwzgwar7ipzpr9i6pv27rl0-gcc-wrapper-4.8.3/bin/ld
No lhc found
No lhc-pkg found
No nhc98 found
No pkg-config found
Using strip found on system at:
/nix/store/ycmsiznf2484vbjwmj57jdy2ncyrj7fj-binutils-2.23.1/bin/strip
Using tar found on system at:
/nix/store/vjkl65bpzl39nfskl31x43x4bwipfqg3-gnutar-1.27.1/bin/tar
No uhc found
building
Building postgresql-simple-0.4.4.1...
Preprocessing library postgresql-simple-0.4.4.1...
[ 1 of 32] Compiling Database.PostgreSQL.Simple.TypeInfo.Types ( src/Database/PostgreSQL/Simple/TypeInfo/Types.hs, dist/build/Database/PostgreSQL/Simple/TypeInfo/Types.js_o )
[ 2 of 32] Compiling Database.PostgreSQL.Simple.Time.Implementation ( src/Database/PostgreSQL/Simple/Time/Implementation.hs, dist/build/Database/PostgreSQL/Simple/Time/Implementation.js_o )

src/Database/PostgreSQL/Simple/Time/Implementation.hs:28:1: Warning:
    Module ‘Data.Attoparsec.Char8’ is deprecated:
      This module will be removed in the next major release.
[ 3 of 32] Compiling Database.PostgreSQL.Simple.Time.Internal ( src/Database/PostgreSQL/Simple/Time/Internal.hs, dist/build/Database/PostgreSQL/Simple/Time/Internal.js_o )
[ 4 of 32] Compiling Database.PostgreSQL.Simple.SqlQQ ( src/Database/PostgreSQL/Simple/SqlQQ.hs, dist/build/Database/PostgreSQL/Simple/SqlQQ.js_o )
[ 5 of 32] Compiling Database.PostgreSQL.Simple.Time ( src/Database/PostgreSQL/Simple/Time.hs, dist/build/Database/PostgreSQL/Simple/Time.js_o )
[ 6 of 32] Compiling Database.PostgreSQL.Simple.TypeInfo.Static ( src/Database/PostgreSQL/Simple/TypeInfo/Static.hs, dist/build/Database/PostgreSQL/Simple/TypeInfo/Static.js_o )
[ 7 of 32] Compiling Database.PostgreSQL.Simple.BuiltinTypes ( src/Database/PostgreSQL/Simple/BuiltinTypes.hs, dist/build/Database/PostgreSQL/Simple/BuiltinTypes.js_o )
[ 8 of 32] Compiling Database.PostgreSQL.Simple.Arrays ( src/Database/PostgreSQL/Simple/Arrays.hs, dist/build/Database/PostgreSQL/Simple/Arrays.js_o )

src/Database/PostgreSQL/Simple/Arrays.hs:20:1: Warning:
    Module ‘Data.Attoparsec.Char8’ is deprecated:
      This module will be removed in the next major release.
[ 9 of 32] Compiling Database.PostgreSQL.Simple.Types ( src/Database/PostgreSQL/Simple/Types.hs, dist/build/Database/PostgreSQL/Simple/Types.js_o )
[10 of 32] Compiling Database.PostgreSQL.Simple.TypeInfo.Macro ( src/Database/PostgreSQL/Simple/TypeInfo/Macro.hs, dist/build/Database/PostgreSQL/Simple/TypeInfo/Macro.js_o )
[11 of 32] Compiling Database.PostgreSQL.Simple.ToField[boot] ( src/Database/PostgreSQL/Simple/ToField.hs-boot, dist/build/Database/PostgreSQL/Simple/ToField.js_o-boot )
[12 of 32] Compiling Database.PostgreSQL.Simple.ToRow[boot] ( src/Database/PostgreSQL/Simple/ToRow.hs-boot, dist/build/Database/PostgreSQL/Simple/ToRow.js_o-boot )
[13 of 32] Compiling Database.PostgreSQL.Simple.ToField ( src/Database/PostgreSQL/Simple/ToField.hs, dist/build/Database/PostgreSQL/Simple/ToField.js_o )
[14 of 32] Compiling Database.PostgreSQL.Simple.ToRow ( src/Database/PostgreSQL/Simple/ToRow.hs, dist/build/Database/PostgreSQL/Simple/ToRow.js_o )
[15 of 32] Compiling Database.PostgreSQL.Simple.Ok ( src/Database/PostgreSQL/Simple/Ok.hs, dist/build/Database/PostgreSQL/Simple/Ok.js_o )
[16 of 32] Compiling Database.PostgreSQL.Simple.Internal ( src/Database/PostgreSQL/Simple/Internal.hs, dist/build/Database/PostgreSQL/Simple/Internal.js_o )
[17 of 32] Compiling Database.PostgreSQL.Simple.LargeObjects ( src/Database/PostgreSQL/Simple/LargeObjects.hs, dist/build/Database/PostgreSQL/Simple/LargeObjects.js_o )
[18 of 32] Compiling Database.PostgreSQL.Simple.Notification ( src/Database/PostgreSQL/Simple/Notification.hs, dist/build/Database/PostgreSQL/Simple/Notification.js_o )
[19 of 32] Compiling Database.PostgreSQL.Simple.Errors ( src/Database/PostgreSQL/Simple/Errors.hs, dist/build/Database/PostgreSQL/Simple/Errors.js_o )

src/Database/PostgreSQL/Simple/Errors.hs:31:1: Warning:
    Module ‘Data.Attoparsec.Char8’ is deprecated:
      This module will be removed in the next major release.
[20 of 32] Compiling Database.PostgreSQL.Simple.FromField[boot] ( src/Database/PostgreSQL/Simple/FromField.hs-boot, dist/build/Database/PostgreSQL/Simple/FromField.js_o-boot )
[21 of 32] Compiling Database.PostgreSQL.Simple.FromRow[boot] ( src/Database/PostgreSQL/Simple/FromRow.hs-boot, dist/build/Database/PostgreSQL/Simple/FromRow.js_o-boot )
[22 of 32] Compiling Database.PostgreSQL.Simple.Compat ( src/Database/PostgreSQL/Simple/Compat.hs, dist/build/Database/PostgreSQL/Simple/Compat.js_o )
[23 of 32] Compiling Database.PostgreSQL.Simple.Transaction ( src/Database/PostgreSQL/Simple/Transaction.hs, dist/build/Database/PostgreSQL/Simple/Transaction.js_o )
[24 of 32] Compiling Database.PostgreSQL.Simple[boot] ( src/Database/PostgreSQL/Simple.hs-boot, dist/build/Database/PostgreSQL/Simple.js_o-boot )
[25 of 32] Compiling Database.PostgreSQL.Simple.TypeInfo ( src/Database/PostgreSQL/Simple/TypeInfo.hs, dist/build/Database/PostgreSQL/Simple/TypeInfo.js_o )
[26 of 32] Compiling Database.PostgreSQL.Simple.FromField ( src/Database/PostgreSQL/Simple/FromField.hs, dist/build/Database/PostgreSQL/Simple/FromField.js_o )
Linking template haskell ()

src/Database/PostgreSQL/Simple/FromField.hs:542:15:
    Exception when trying to run compile-time code:
      expectJust link
    Code: mkCompats [TI.name, TI.text, TI.char, TI.bpchar, ....]
    In the splice: $(mkCompats [TI.name, TI.text, TI.char, ....])
builder for `/nix/store/vr8hj0bk7pdgyq0rrqf0y4zxyjrcmdsn-haskell-postgresql-simple-ghcjs0.1.0-0.4.4.1.drv' failed with exit code 1
error: build of `/nix/store/vr8hj0bk7pdgyq0rrqf0y4zxyjrcmdsn-haskell-postgresql-simple-ghcjs0.1.0-0.4.4.1.drv' failed
@pmlodawski
Copy link

I have the same problem, but with my own package... Any thoughts why this error occurs?

@luite
Copy link
Member

luite commented Jul 14, 2015

Can you share the code of your package, or preferably a minimal example that reproduces this with as few dependencies as possible?

@pmlodawski
Copy link

Project is rather big and close sourced, it use lens and dynamic linking. It is strange, but when I tried to compile it with -v3 it finally worked. Maybe it is some race condition? I tried to prepare minimal example using same calls and template haskell splices but it works. Maybe project must be big enough to error occur or I'm missing something.

@drwebb
Copy link

drwebb commented Nov 12, 2015

I'm getting this error as well with a project that depends on postgres-simple.

@luite
Copy link
Member

luite commented Nov 14, 2015

hmm, I'm getting expectJust link when compiling agda, perhaps I can find a way to reproduce it. It might have something to do with boot files here.

@luite
Copy link
Member

luite commented Nov 14, 2015

It's indeed a problem with boot modules. The hm_linkable field for these is Nothing in the HomePackageTable, but when linking TH, the boot object modulename.js_o-boot should actually be loaded by the linker.

@luite
Copy link
Member

luite commented Nov 14, 2015

Hmm, I'm not sure if I can fix this with the current GHC. GHCJS should probably generate the code for .hs-boot files and save it to a .js_o-boot, in case TH needs any of the generated defs. Unfortunately the pipeline stops after writing the interface file to disk.

@luite
Copy link
Member

luite commented Nov 14, 2015

adding a hook for compileOne may be the best way to solve this.

@benjamin-hodgson
Copy link

Has there been any progress on this issue?

@geraldus
Copy link

Hi!

Has there been any progress on this issue?

… or is there a workaround? I'm trying to compile database model and stuck with this.

@rubenmoor
Copy link

Same problem here with custom code and also interested in any workaround. I have two commits of which one causes the error, but even by looking on the diff between the commits I can't figure out what piece of code exactly produces the error. It's devilish.

@rubenmoor
Copy link

rubenmoor commented Oct 14, 2016

I found a workaround in my code by changing my internal module structure.

This one triggers the compilation failure: ( <- means "imports"). All those modules are internal ones.

Store <- Auth <- Base64
Store <- References       <- AesonBson
      <- Column       <- AesonBson
      <- Cell         <- AesonBson
      <- Dependencies <- AesonBson
AesonBson <- Base64 

I removed the last dependency: AesonBson doesn't import Base64 anymore and it compiles now.

@themoritz
Copy link

Same problem here.

@fisx
Copy link
Contributor

fisx commented Oct 8, 2017

Same here. It was easy to resolve, though: after I found this issue I just removed my latest hs-boot file and shuffled the code a little.

@ruhatch
Copy link

ruhatch commented Oct 10, 2017

Anyone had any luck with getting this working for postgresql-simple?

@fisx
Copy link
Contributor

fisx commented Oct 11, 2017

One thing you could do:

  • fork postgresql-simple and use the fork for your project for the time being.
  • copy all code from all modules into Database.PostgreSQL.Simple

This is a bit sillly, but it will almost certainly work, and from what @luite says above I suspect that the proper fix will involve upstream changes in ghc and take a long time.

@ruhatch
Copy link

ruhatch commented Oct 11, 2017

@fisx Do you think it would work to replace TH declarations with their generated code by hand?

There a lot of code there so putting it all into one file and getting it compiling is a little daunting (and indeed silly ;)

Edit: That worked a treat - only one file actually used TH, so it wasn't too much effort

@fisx
Copy link
Contributor

fisx commented Oct 12, 2017

@ruhatch not sure. i know very little about how this problem works; i just ran into it once and resolved it by eliminating {-# SOURCE #-} imports.

if you find that running TH with GHC, then running GHCJS on the TH-free code solves the problem too i'd be interested to know.

@dmjio
Copy link

dmjio commented Mar 1, 2019

Still getting this with GHCJS 8.6

[27 of 38] Compiling Database.PostgreSQL.Simple.FromField ( src/Database/PostgreSQL/Simple/FromField.hs, dist/build/Database/PostgreSQL/Simple/FromField.js_o )
Linking Template Haskell ()
expectJust link
CallStack (from HasCallStack):
  error, called at compiler/utils/Maybes.hs:55:27 in ghc-api-ghcjs-8.6.2-6uWaTo3exIc7WmeNhoOnB3:Maybes
  expectJust, called at src/Gen2/TH.hs:270:24 in ghcjs-8.6.0.1-8OuBFc0ja283EU7wql4g74:Gen2.TH
builder for '/nix/store/4ba7r11nib5mqyh8kwnf2f1kbnzd6c6g-postgresql-simple-0.6.drv' failed with exit code

@luite, any progress here?

EDIT: seems to not be a problem in master

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