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

Build failure (GHC 8 related?) #4

Closed
deepfire opened this issue Feb 28, 2016 · 4 comments
Closed

Build failure (GHC 8 related?) #4

deepfire opened this issue Feb 28, 2016 · 4 comments

Comments

@deepfire
Copy link

I get this:

[deepfire@andromedae:~/src/mood]$ nsr /nix/store/cj70b7igg91yq9i9ykmd3993qb20a9j5-optparse-generic-1.0.0.drv
these derivations will be built:
  /nix/store/cj70b7igg91yq9i9ykmd3993qb20a9j5-optparse-generic-1.0.0.drv
building path(s) ‘/nix/store/5rj6r04lx5c3s7v6bq1k4bghbshsr4ih-optparse-generic-1.0.0’
setupCompilerEnvironmentPhase
Build with /nix/store/mkbzdx2nsdcskfrak51r7faiaxqrlcrk-ghc-8.0.0.20160204.
unpacking sources
unpacking source archive /nix/store/fc6m7v05dws00vqyj0sk6yznpb46m0na-Haskell-Optparse-Generic-Library-682b606
source root is Haskell-Optparse-Generic-Library-682b606
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/tmp/nix-build-optparse-generic-1.0.0.drv-0/package.conf.d -j1 -threaded
[1 of 1] Compiling Main             ( Setup.hs, /tmp/nix-build-optparse-generic-1.0.0.drv-0/Main.o )
Linking Setup ...
configuring
configureFlags: --verbose --prefix=/nix/store/5rj6r04lx5c3s7v6bq1k4bghbshsr4ih-optparse-generic-1.0.0 --libdir=$prefix/lib/$compiler --libsubdir=$pkgid --with-gcc=gcc --package-db=/tmp/nix-build-optparse-generic-1.0.0.drv-0/package.conf.d --ghc-option=-optl=-Wl,-rpath=/nix/store/5rj6r04lx5c3s7v6bq1k4bghbshsr4ih-optparse-generic-1.0.0/lib/ghc-8.0.0.20160204/optparse-generic-1.0.0 --enable-split-objs --disable-library-profiling --disable-profiling --enable-shared --enable-library-vanilla --enable-executable-dynamic --enable-tests
Configuring optparse-generic-1.0.0...
Dependency base >=4.6 && <5: using base-4.9.0.0
Dependency optparse-applicative >=0.11.0 && <0.13: using
optparse-applicative-0.12.1.0
Dependency system-filepath >=0.3.1 && <0.5: using system-filepath-0.4.13.4
Dependency text <1.3: using text-1.2.2.0
Dependency transformers >=0.2.0.0 && <0.6: using transformers-0.5.1.0
Dependency void <0.8: using void-0.7.1
Using Cabal-1.23.1.0 compiled by ghc-8.0
Using compiler: ghc-8.0.0.20160204
Using install prefix:
/nix/store/5rj6r04lx5c3s7v6bq1k4bghbshsr4ih-optparse-generic-1.0.0
Binaries installed in:
/nix/store/5rj6r04lx5c3s7v6bq1k4bghbshsr4ih-optparse-generic-1.0.0/bin
Libraries installed in:
/nix/store/5rj6r04lx5c3s7v6bq1k4bghbshsr4ih-optparse-generic-1.0.0/lib/ghc-8.0.0.20160204/optparse-generic-1.0.0
Private binaries installed in:
/nix/store/5rj6r04lx5c3s7v6bq1k4bghbshsr4ih-optparse-generic-1.0.0/libexec
Data files installed in:
/nix/store/5rj6r04lx5c3s7v6bq1k4bghbshsr4ih-optparse-generic-1.0.0/share/x86_64-linux-ghc-8.0.0.20160204/optparse-generic-1.0.0
Documentation installed in:
/nix/store/5rj6r04lx5c3s7v6bq1k4bghbshsr4ih-optparse-generic-1.0.0/share/doc/x86_64-linux-ghc-8.0.0.20160204/optparse-generic-1.0.0
Configuration files installed in:
/nix/store/5rj6r04lx5c3s7v6bq1k4bghbshsr4ih-optparse-generic-1.0.0/etc
No alex found
Using ar found on system at:
/nix/store/ana1gqsb6v9y45fhj8wjmmk8w13dc3v5-binutils-2.23.1-dev/bin/ar
No c2hs found
No cpphs found
Using gcc version 4.9.3 given by user at:
/nix/store/sihykq4gh9g13ky34yx6ffdfmlw8j8pn-gcc-wrapper-4.9.3/bin/gcc
Using ghc version 8.0.0.20160204 found on system at:
/nix/store/mkbzdx2nsdcskfrak51r7faiaxqrlcrk-ghc-8.0.0.20160204/bin/ghc
Using ghc-pkg version 8.0.0.20160204 found on system at:
/nix/store/mkbzdx2nsdcskfrak51r7faiaxqrlcrk-ghc-8.0.0.20160204/bin/ghc-pkg
No ghcjs found
No ghcjs-pkg found
No greencard found
Using haddock version 2.17.0 found on system at:
/nix/store/mkbzdx2nsdcskfrak51r7faiaxqrlcrk-ghc-8.0.0.20160204/bin/haddock
No happy found
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/mkbzdx2nsdcskfrak51r7faiaxqrlcrk-ghc-8.0.0.20160204/bin/hpc
Using hsc2hs version 0.67 found on system at:
/nix/store/mkbzdx2nsdcskfrak51r7faiaxqrlcrk-ghc-8.0.0.20160204/bin/hsc2hs
Using hscolour version 1.24 found on system at:
/nix/store/ikqj8r54aqxq3srfj92d3ihkp0dn7hw2-hscolour-1.24/bin/HsColour
No jhc found
Using ld found on system at:
/nix/store/sihykq4gh9g13ky34yx6ffdfmlw8j8pn-gcc-wrapper-4.9.3/bin/ld
No lhc found
No lhc-pkg found
No pkg-config found
Using strip version 2.23 found on system at:
/nix/store/ana1gqsb6v9y45fhj8wjmmk8w13dc3v5-binutils-2.23.1-dev/bin/strip
Using tar found on system at:
/nix/store/88s1bhymbdgv7s98ql4x486710pff29v-gnutar-1.28/bin/tar
No uhc found
building
Building optparse-generic-1.0.0...
Preprocessing library optparse-generic-1.0.0...
[1 of 1] Compiling Options.Generic  ( src/Options/Generic.hs, dist/build/Options/Generic.o )

src/Options/Generic.hs:398:10: error:
    • No instance for (Generic Char)
        arising from a use of ‘Options.Generic.$dmparseRecord’
    • In the expression: Options.Generic.$dmparseRecord
      In an equation for ‘parseRecord’:
          parseRecord = Options.Generic.$dmparseRecord
      In the instance declaration for ‘ParseRecord Char’

src/Options/Generic.hs:399:10: error:
    • No instance for (Generic Double)
        arising from a use of ‘Options.Generic.$dmparseRecord’
    • In the expression: Options.Generic.$dmparseRecord
      In an equation for ‘parseRecord’:
          parseRecord = Options.Generic.$dmparseRecord
      In the instance declaration for ‘ParseRecord Double’

src/Options/Generic.hs:400:10: error:
    • No instance for (Generic Float)
        arising from a use of ‘Options.Generic.$dmparseRecord’
    • In the expression: Options.Generic.$dmparseRecord
      In an equation for ‘parseRecord’:
          parseRecord = Options.Generic.$dmparseRecord
      In the instance declaration for ‘ParseRecord Float’

src/Options/Generic.hs:401:10: error:
    • No instance for (Generic Int)
        arising from a use of ‘Options.Generic.$dmparseRecord’
    • In the expression: Options.Generic.$dmparseRecord
      In an equation for ‘parseRecord’:
          parseRecord = Options.Generic.$dmparseRecord
      In the instance declaration for ‘ParseRecord Int’
builder for ‘/nix/store/cj70b7igg91yq9i9ykmd3993qb20a9j5-optparse-generic-1.0.0.drv’ failed with exit code 1
error: build of ‘/nix/store/cj70b7igg91yq9i9ykmd3993qb20a9j5-optparse-generic-1.0.0.drv’ failed
@Gabriella439
Copy link
Owner

Fortunately, there is a pretty simple workaround here, which is to just change those four instances like this:

-- Before
instance ParseRecord Int

-- After
instance ParseRecord Int where
    parseRecord = fmap getOnly parseRecord

However, it's still troubling that ghc-8 is missing those instances. I'm going to open a ticket against ghc to see what happened there.

In the meantime, could you try to check out the ghc8_workaround branch, which contains the above workaround, and see if you can build that:

https://github.com/Gabriel439/Haskell-Optparse-Generic-Library/tree/ghc8_workaround

@deepfire
Copy link
Author

@Gabriel439, just checked -- it builds fine. Thank you!

@Gabriella439
Copy link
Owner

Alright, I merged the workaround into master and this is fixed by 7fc59e0

@Gabriella439
Copy link
Owner

So actually I did a bit more research and it looks like this removal of Generic instances for base types was intentional, according to this GHC Trac thread:

https://ghc.haskell.org/trac/ghc/ticket/10512

... so in this case the workaround is in fact the appropriate solution that the GHC devs had in mind for this sort of thing. The Generic instances were intended more for complex types and not for primitive types.

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

2 participants