ihp/nix how to add wreq to dependencies without compile failing? - haskell

In an IHP project, I tried adding wreq to default.nix as described in https://ihp.digitallyinduced.com/Guide/recipes.html#making-a-http-request but I get
src/Codec/Crypto/RSA/Pure.hs:115:25: error:
• Could not deduce (MonadFail m) arising from a use of ‘fail’
when compiling. Similarly with the alternative req.
I've just used stackage before, I'm completely new to nix – is there some way to get a set of package versions that work together like with stackage? Or is there something obvious I'm missing?
Full output after adding wreq to default.nix and running make -B .envrc in nix-shell:
[nix-shell:~/src/foo]$ make -B .envrc
rm -f .envrc
echo "PATH_add $(nix-shell -j auto --cores 0 --pure --run 'printf %q $PATH')" > .envrc
direnv allow
these derivations will be built:
/nix/store/iamd2pmg0xhh67b9wx23pfq815v1rpg5-RSA-2.3.1.drv
/nix/store/b4s6rcqnxnd9nsx5123n1xb0p1d7lz7r-authenticate-oauth-1.6.0.1.drv
/nix/store/jhkbm2z39sfi94zfy93bw4ivay21k49p-simple-reflect-0.3.3.drv
/nix/store/n13kcx1m809a2prdqbvm6v4vsdkfayym-lens-4.19.drv
/nix/store/whv58hpwx2yqchv14mgjjr4j6zs5lmmr-lens-aeson-1.0.2.drv
/nix/store/wwn14fv4gmwh4p2w1516fwhc88bz7wdr-time-locale-compat-0.1.1.5.drv
/nix/store/mmpdshwkx498v4hd39d5qb82y4zjhvsx-wreq-0.5.3.2.drv
/nix/store/i1fqnspxpy7ikvbzbnr484dlggn98dpk-ghc-8.8.3-with-packages.drv
building '/nix/store/iamd2pmg0xhh67b9wx23pfq815v1rpg5-RSA-2.3.1.drv'...
building '/nix/store/wwn14fv4gmwh4p2w1516fwhc88bz7wdr-time-locale-compat-0.1.1.5.drv'...
building '/nix/store/jhkbm2z39sfi94zfy93bw4ivay21k49p-simple-reflect-0.3.3.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/z9hplpp91s3s8k8gsj5wvhnsqpvijz0p-ghc-8.8.3.
setupCompilerEnvironmentPhase
Build with /nix/store/z9hplpp91s3s8k8gsj5wvhnsqpvijz0p-ghc-8.8.3.
setupCompilerEnvironmentPhase
Build with /nix/store/z9hplpp91s3s8k8gsj5wvhnsqpvijz0p-ghc-8.8.3.
unpacking sources
unpacking source archive /nix/store/vbjq94k0fh92d2g1i5xl0bv0bj4kawyp-time-locale-compat-0.1.1.5.tar.gz
source root is time-locale-compat-0.1.1.5
setting SOURCE_DATE_EPOCH to timestamp 1535285808 of file time-locale-compat-0.1.1.5/time-locale-compat.cabal
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/setup-package.conf.d -j4 -threaded
unpacking sources
unpacking source archive /nix/store/7zj46nqh5hynrrc2vkniyymfryf8f8h3-simple-reflect-0.3.3.tar.gz
source root is simple-reflect-0.3.3
setting SOURCE_DATE_EPOCH to timestamp 1521050226 of file simple-reflect-0.3.3/simple-reflect.cabal
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/setup-package.conf.d -j4 -threaded
[1 of 1] Compiling Main ( Setup.hs, /build/Main.o )
[1 of 1] Compiling Main ( Setup.hs, /build/Main.o )
unpacking sources
unpacking source archive /nix/store/bv3lckj9fqlzw84xafipfnnv13lpigs4-RSA-2.3.1.tar.gz
source root is RSA-2.3.1
setting SOURCE_DATE_EPOCH to timestamp 1546300677 of file RSA-2.3.1/Test.hs
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/setup-package.conf.d -j4 -threaded
[1 of 1] Compiling Main ( Setup.hs, /build/Main.o )
Linking Setup ...
Linking Setup ...
Linking Setup ...
configuring
configureFlags: --verbose --prefix=/nix/store/5l41880hdczl2yhpxr4579vljmpr1lmj-time-locale-compat-0.1.1.5 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/wmnnz02rq2pxdxzadmm57m1wdq253mz6-time-locale-compat-0.1.1.5-doc/share/doc/time-locale-compat-0.1.1.5 --with-gcc=gcc --package-db=/build/package.conf.d --ghc-option=-j4 --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --extra-lib-dirs=/nix/store/kpw4kmc74djprg3bjc5rxblij46jdmnf-ncurses-6.1-20190112/lib --extra-lib-dirs=/nix/store/x6sc334nvkl7pr3yqiqs3dzhfsbsgqcd-libffi-3.3/lib --extra-lib-dirs=/nix/store/gldhjyzsj475ymgax9ycv8m1wf6rkc02-gmp-6.2.0/lib
configuring
configureFlags: --verbose --prefix=/nix/store/myldnlikwicwz054kycwx6gzpyp29sw6-simple-reflect-0.3.3 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/n4rqdqimm3rq1m2w3fhnmdxy9vj1srx7-simple-reflect-0.3.3-doc/share/doc/simple-reflect-0.3.3 --with-gcc=gcc --package-db=/build/package.conf.d --ghc-option=-j4 --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --extra-lib-dirs=/nix/store/kpw4kmc74djprg3bjc5rxblij46jdmnf-ncurses-6.1-20190112/lib --extra-lib-dirs=/nix/store/x6sc334nvkl7pr3yqiqs3dzhfsbsgqcd-libffi-3.3/lib --extra-lib-dirs=/nix/store/gldhjyzsj475ymgax9ycv8m1wf6rkc02-gmp-6.2.0/lib
configuring
configureFlags: --verbose --prefix=/nix/store/qa57n6w7772mq96gbhz1jf95aqz4ay2l-RSA-2.3.1 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/2mxz458lx9xfbracvz4icjjyi6s304kk-RSA-2.3.1-doc/share/doc/RSA-2.3.1 --with-gcc=gcc --package-db=/build/package.conf.d --ghc-option=-j4 --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --extra-lib-dirs=/nix/store/kpw4kmc74djprg3bjc5rxblij46jdmnf-ncurses-6.1-20190112/lib --extra-lib-dirs=/nix/store/x6sc334nvkl7pr3yqiqs3dzhfsbsgqcd-libffi-3.3/lib --extra-lib-dirs=/nix/store/gldhjyzsj475ymgax9ycv8m1wf6rkc02-gmp-6.2.0/lib
Using Parsec parser
Configuring time-locale-compat-0.1.1.5...
Flags chosen: old-locale=False
Dependency base <5: using base-4.13.0.0
Dependency time >=1.5: using time-1.9.3
Using Parsec parser
Configuring simple-reflect-0.3.3...
Dependency base >=2 && <5: using base-4.13.0.0
Source component graph: component lib
Configured component graph:
component time-locale-compat-0.1.1.5-3KeDjePLdJz63GzLtGEnjG
include base-4.13.0.0
include time-1.9.3
Linked component graph:
unit time-locale-compat-0.1.1.5-3KeDjePLdJz63GzLtGEnjG
include base-4.13.0.0
include time-1.9.3
Data.Time.Locale.Compat=time-locale-compat-0.1.1.5-3KeDjePLdJz63GzLtGEnjG:Data.Time.Locale.Compat
Ready component graph:
definite time-locale-compat-0.1.1.5-3KeDjePLdJz63GzLtGEnjG
depends base-4.13.0.0
depends time-1.9.3
Using Cabal-3.0.1.0 compiled by ghc-8.8
Using compiler: ghc-8.8.3
Using install prefix:
/nix/store/5l41880hdczl2yhpxr4579vljmpr1lmj-time-locale-compat-0.1.1.5
Executables installed in:
/nix/store/5l41880hdczl2yhpxr4579vljmpr1lmj-time-locale-compat-0.1.1.5/bin
Libraries installed in:
/nix/store/5l41880hdczl2yhpxr4579vljmpr1lmj-time-locale-compat-0.1.1.5/lib/ghc-8.8.3/x86_64-linux-ghc-8.8.3/time-locale-compat-0.1.1.5-3KeDjePLdJz63GzLtGEnjG
Dynamic Libraries installed in:
/nix/store/5l41880hdczl2yhpxr4579vljmpr1lmj-time-locale-compat-0.1.1.5/lib/ghc-8.8.3/x86_64-linux-ghc-8.8.3
Private executables installed in:
/nix/store/5l41880hdczl2yhpxr4579vljmpr1lmj-time-locale-compat-0.1.1.5/libexec/x86_64-linux-ghc-8.8.3/time-locale-compat-0.1.1.5
Data files installed in:
/nix/store/5l41880hdczl2yhpxr4579vljmpr1lmj-time-locale-compat-0.1.1.5/share/x86_64-linux-ghc-8.8.3/time-locale-compat-0.1.1.5
Documentation installed in:
/nix/store/wmnnz02rq2pxdxzadmm57m1wdq253mz6-time-locale-compat-0.1.1.5-doc/share/doc/time-locale-compat-0.1.1.5
Configuration files installed in:
/nix/store/5l41880hdczl2yhpxr4579vljmpr1lmj-time-locale-compat-0.1.1.5/etc
No alex found
Using ar found on system at:
/nix/store/1zf4cnaaidjajwb4gx4mnkqc5dypkcdy-binutils-2.31.1/bin/ar
No c2hs found
No cpphs found
No doctest found
Using gcc version 9.2.0 given by user at:
/nix/store/xh3bh8nir5d45zk45dz9xxfs2j95cby4-gcc-wrapper-9.2.0/bin/gcc
Using ghc version 8.8.3 found on system at:
/nix/store/z9hplpp91s3s8k8gsj5wvhnsqpvijz0p-ghc-8.8.3/bin/ghc
Using ghc-pkg version 8.8.3 found on system at:
/nix/store/z9hplpp91s3s8k8gsj5wvhnsqpvijz0p-ghc-8.8.3/bin/ghc-pkg
No ghcjs found
No ghcjs-pkg found
No greencard found
Using haddock version 2.23.0 found on system at:
/nix/store/z9hplpp91s3s8k8gsj5wvhnsqpvijz0p-ghc-8.8.3/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/z9hplpp91s3s8k8gsj5wvhnsqpvijz0p-ghc-8.8.3/bin/hpc
Using hsc2hs version 0.68.5 found on system at:
/nix/store/z9hplpp91s3s8k8gsj5wvhnsqpvijz0p-ghc-8.8.3/bin/hsc2hs
Using hscolour version 1.24 found on system at:
/nix/store/4kr0317ac62lw56yaygq2kfiqv96za9f-hscolour-1.24.4/bin/HsColour
No jhc found
Using ld found on system at:
/nix/store/axkkr27z9cjzxac1c9s6ngda73kbz063-binutils-wrapper-2.31.1/bin/ld.gold
No pkg-config found
Using runghc version 8.8.3 found on system at:
/nix/store/z9hplpp91s3s8k8gsj5wvhnsqpvijz0p-ghc-8.8.3/bin/runghc
Using strip version 2.31 found on system at:
/nix/store/1zf4cnaaidjajwb4gx4mnkqc5dypkcdy-binutils-2.31.1/bin/strip
Using tar found on system at:
/nix/store/c98k0shcp2yp69g81mqhbqw3xbxvnk0r-gnutar-1.32/bin/tar
No uhc found
building
Preprocessing library for time-locale-compat-0.1.1.5..
Building library for time-locale-compat-0.1.1.5..
Source component graph: component lib
Configured component graph:
component simple-reflect-0.3.3-7n1WmXGrTqW325T1Vh7H5M
include base-4.13.0.0
Linked component graph:
unit simple-reflect-0.3.3-7n1WmXGrTqW325T1Vh7H5M
include base-4.13.0.0
Debug.SimpleReflect=simple-reflect-0.3.3-7n1WmXGrTqW325T1Vh7H5M:Debug.SimpleReflect,Debug.SimpleReflect.Expr=simple-reflect-0.3.3-7n1WmXGrTqW325T1Vh7H5M:Debug.SimpleReflect.Expr,Debug.SimpleReflect.Vars=simple-reflect-0.3.3-7n1WmXGrTqW325T1Vh7H5M:Debug.SimpleReflect.Vars
Ready component graph:
definite simple-reflect-0.3.3-7n1WmXGrTqW325T1Vh7H5M
depends base-4.13.0.0
Using Cabal-3.0.1.0 compiled by ghc-8.8
Using compiler: ghc-8.8.3
Using install prefix:
/nix/store/myldnlikwicwz054kycwx6gzpyp29sw6-simple-reflect-0.3.3
Executables installed in:
/nix/store/myldnlikwicwz054kycwx6gzpyp29sw6-simple-reflect-0.3.3/bin
Libraries installed in:
/nix/store/myldnlikwicwz054kycwx6gzpyp29sw6-simple-reflect-0.3.3/lib/ghc-8.8.3/x86_64-linux-ghc-8.8.3/simple-reflect-0.3.3-7n1WmXGrTqW325T1Vh7H5M
Dynamic Libraries installed in:
/nix/store/myldnlikwicwz054kycwx6gzpyp29sw6-simple-reflect-0.3.3/lib/ghc-8.8.3/x86_64-linux-ghc-8.8.3
Private executables installed in:
/nix/store/myldnlikwicwz054kycwx6gzpyp29sw6-simple-reflect-0.3.3/libexec/x86_64-linux-ghc-8.8.3/simple-reflect-0.3.3
Data files installed in:
/nix/store/myldnlikwicwz054kycwx6gzpyp29sw6-simple-reflect-0.3.3/share/x86_64-linux-ghc-8.8.3/simple-reflect-0.3.3
Documentation installed in:
/nix/store/n4rqdqimm3rq1m2w3fhnmdxy9vj1srx7-simple-reflect-0.3.3-doc/share/doc/simple-reflect-0.3.3
Configuration files installed in:
/nix/store/myldnlikwicwz054kycwx6gzpyp29sw6-simple-reflect-0.3.3/etc
No alex found
Using ar found on system at:
/nix/store/1zf4cnaaidjajwb4gx4mnkqc5dypkcdy-binutils-2.31.1/bin/ar
No c2hs found
No cpphs found
No doctest found
Using gcc version 9.2.0 given by user at:
/nix/store/xh3bh8nir5d45zk45dz9xxfs2j95cby4-gcc-wrapper-9.2.0/bin/gcc
Using ghc version 8.8.3 found on system at:
/nix/store/z9hplpp91s3s8k8gsj5wvhnsqpvijz0p-ghc-8.8.3/bin/ghc
Using ghc-pkg version 8.8.3 found on system at:
/nix/store/z9hplpp91s3s8k8gsj5wvhnsqpvijz0p-ghc-8.8.3/bin/ghc-pkg
No ghcjs found
No ghcjs-pkg found
No greencard found
Using haddock version 2.23.0 found on system at:
/nix/store/z9hplpp91s3s8k8gsj5wvhnsqpvijz0p-ghc-8.8.3/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/z9hplpp91s3s8k8gsj5wvhnsqpvijz0p-ghc-8.8.3/bin/hpc
Using hsc2hs version 0.68.5 found on system at:
/nix/store/z9hplpp91s3s8k8gsj5wvhnsqpvijz0p-ghc-8.8.3/bin/hsc2hs
Using hscolour version 1.24 found on system at:
/nix/store/4kr0317ac62lw56yaygq2kfiqv96za9f-hscolour-1.24.4/bin/HsColour
No jhc found
Using ld found on system at:
/nix/store/axkkr27z9cjzxac1c9s6ngda73kbz063-binutils-wrapper-2.31.1/bin/ld.gold
No pkg-config found
Using runghc version 8.8.3 found on system at:
/nix/store/z9hplpp91s3s8k8gsj5wvhnsqpvijz0p-ghc-8.8.3/bin/runghc
Using strip version 2.31 found on system at:
/nix/store/1zf4cnaaidjajwb4gx4mnkqc5dypkcdy-binutils-2.31.1/bin/strip
Using tar found on system at:
/nix/store/c98k0shcp2yp69g81mqhbqw3xbxvnk0r-gnutar-1.32/bin/tar
No uhc found
[1 of 1] Compiling Data.Time.Locale.Compat ( src/Data/Time/Locale/Compat.hs, dist/build/Data/Time/Locale/Compat.o )
building
Preprocessing library for simple-reflect-0.3.3..
Building library for simple-reflect-0.3.3..
Using Parsec parser
Configuring RSA-2.3.1...
Dependency SHA >=1.6.4.1 && <2.0: using SHA-1.6.4.4
Dependency base >=4.6 && <7.0: using base-4.13.0.0
Dependency binary >0.7 && <1.0: using binary-0.8.7.0
Dependency bytestring >0.8 && <0.12: using bytestring-0.10.10.0
Dependency crypto-api >=0.10 && <0.14: using crypto-api-0.13.3
Dependency crypto-pubkey-types >=0.2 && <0.6: using crypto-pubkey-types-0.4.3
Dependency DRBG >=0.5.2 && <0.7: using DRBG-0.5.5
Dependency QuickCheck >=2.5 && <3: using QuickCheck-2.13.2
Dependency SHA >=1.6.4.1 && <2.0: using SHA-1.6.4.4
Dependency base >=4.6 && <7.0: using base-4.13.0.0
Dependency binary >0.7 && <1.0: using binary-0.8.7.0
Dependency bytestring >0.8 && <0.12: using bytestring-0.10.10.0
Dependency crypto-api >=0.10 && <0.14: using crypto-api-0.13.3
Dependency crypto-pubkey-types >=0.4 && <0.6: using crypto-pubkey-types-0.4.3
Dependency tagged >=0.2 && <0.9: using tagged-0.8.6
Dependency test-framework >=0.8.0.3 && <0.10: using test-framework-0.8.2.0
Dependency test-framework-quickcheck2 >=0.3.0.2 && <0.5: using
test-framework-quickcheck2-0.3.0.5
[1 of 3] Compiling Debug.SimpleReflect.Expr ( Debug/SimpleReflect/Expr.hs, dist/build/Debug/SimpleReflect/Expr.o )
[1 of 1] Compiling Data.Time.Locale.Compat ( src/Data/Time/Locale/Compat.hs, dist/build/Data/Time/Locale/Compat.p_o )
Source component graph:
component test:test-rsa
component lib
Configured component graph:
component RSA-2.3.1-JJYZ7HtptBX49F9kO59MAB-test-rsa
include DRBG-0.5.5-4enzLx907KB4ly1cvZ83Rj
include QuickCheck-2.13.2-9teeivRumd01cV6oeVrmWt
include SHA-1.6.4.4-HjVIktJeEh9Jm66vy0zsGC
include base-4.13.0.0
include binary-0.8.7.0
include bytestring-0.10.10.0
include crypto-api-0.13.3-5deppbfxVTTBecXOiXtKKK
include crypto-pubkey-types-0.4.3-HEZvEEbmspDBQkghRIQNcJ
include tagged-0.8.6-FYc8l1vwILF5OSKkSTSNII
include test-framework-0.8.2.0-5G7BFKLBjZC6YeudnlZJNp
include test-framework-quickcheck2-0.3.0.5-3rpDyIsNKye2cByAhaUbY6
component RSA-2.3.1-ET1TzkXBKSBHYmOWRgR5vO
include SHA-1.6.4.4-HjVIktJeEh9Jm66vy0zsGC
include base-4.13.0.0
include binary-0.8.7.0
include bytestring-0.10.10.0
include crypto-api-0.13.3-5deppbfxVTTBecXOiXtKKK
include crypto-pubkey-types-0.4.3-HEZvEEbmspDBQkghRIQNcJ
Linked component graph:
unit RSA-2.3.1-JJYZ7HtptBX49F9kO59MAB-test-rsa
include DRBG-0.5.5-4enzLx907KB4ly1cvZ83Rj
include QuickCheck-2.13.2-9teeivRumd01cV6oeVrmWt
include SHA-1.6.4.4-HjVIktJeEh9Jm66vy0zsGC
include base-4.13.0.0
include binary-0.8.7.0
include bytestring-0.10.10.0
include crypto-api-0.13.3-5deppbfxVTTBecXOiXtKKK
include crypto-pubkey-types-0.4.3-HEZvEEbmspDBQkghRIQNcJ
include tagged-0.8.6-FYc8l1vwILF5OSKkSTSNII
include test-framework-0.8.2.0-5G7BFKLBjZC6YeudnlZJNp
include test-framework-quickcheck2-0.3.0.5-3rpDyIsNKye2cByAhaUbY6
unit RSA-2.3.1-ET1TzkXBKSBHYmOWRgR5vO
include SHA-1.6.4.4-HjVIktJeEh9Jm66vy0zsGC
include base-4.13.0.0
include binary-0.8.7.0
include bytestring-0.10.10.0
include crypto-api-0.13.3-5deppbfxVTTBecXOiXtKKK
include crypto-pubkey-types-0.4.3-HEZvEEbmspDBQkghRIQNcJ
Codec.Crypto.RSA=RSA-2.3.1-ET1TzkXBKSBHYmOWRgR5vO:Codec.Crypto.RSA,Codec.Crypto.RSA.Exceptions=RSA-2.3.1-ET1TzkXBKSBHYmOWRgR5vO:Codec.Crypto.RSA.Exceptions,Codec.Crypto.RSA.Pure=RSA-2.3.1-ET1TzkXBKSBHYmOWRgR5vO:Codec.Crypto.RSA.Pure
Ready component graph:
definite RSA-2.3.1-JJYZ7HtptBX49F9kO59MAB-test-rsa
depends DRBG-0.5.5-4enzLx907KB4ly1cvZ83Rj
depends QuickCheck-2.13.2-9teeivRumd01cV6oeVrmWt
depends SHA-1.6.4.4-HjVIktJeEh9Jm66vy0zsGC
depends base-4.13.0.0
depends binary-0.8.7.0
depends bytestring-0.10.10.0
depends crypto-api-0.13.3-5deppbfxVTTBecXOiXtKKK
depends crypto-pubkey-types-0.4.3-HEZvEEbmspDBQkghRIQNcJ
depends tagged-0.8.6-FYc8l1vwILF5OSKkSTSNII
depends test-framework-0.8.2.0-5G7BFKLBjZC6YeudnlZJNp
depends test-framework-quickcheck2-0.3.0.5-3rpDyIsNKye2cByAhaUbY6
definite RSA-2.3.1-ET1TzkXBKSBHYmOWRgR5vO
depends SHA-1.6.4.4-HjVIktJeEh9Jm66vy0zsGC
depends base-4.13.0.0
depends binary-0.8.7.0
depends bytestring-0.10.10.0
depends crypto-api-0.13.3-5deppbfxVTTBecXOiXtKKK
depends crypto-pubkey-types-0.4.3-HEZvEEbmspDBQkghRIQNcJ
Using Cabal-3.0.1.0 compiled by ghc-8.8
Using compiler: ghc-8.8.3
Using install prefix: /nix/store/qa57n6w7772mq96gbhz1jf95aqz4ay2l-RSA-2.3.1
Executables installed in:
/nix/store/qa57n6w7772mq96gbhz1jf95aqz4ay2l-RSA-2.3.1/bin
Libraries installed in:
/nix/store/qa57n6w7772mq96gbhz1jf95aqz4ay2l-RSA-2.3.1/lib/ghc-8.8.3/x86_64-linux-ghc-8.8.3/RSA-2.3.1-ET1TzkXBKSBHYmOWRgR5vO
Dynamic Libraries installed in:
/nix/store/qa57n6w7772mq96gbhz1jf95aqz4ay2l-RSA-2.3.1/lib/ghc-8.8.3/x86_64-linux-ghc-8.8.3
Private executables installed in:
/nix/store/qa57n6w7772mq96gbhz1jf95aqz4ay2l-RSA-2.3.1/libexec/x86_64-linux-ghc-8.8.3/RSA-2.3.1
Data files installed in:
/nix/store/qa57n6w7772mq96gbhz1jf95aqz4ay2l-RSA-2.3.1/share/x86_64-linux-ghc-8.8.3/RSA-2.3.1
Documentation installed in:
/nix/store/2mxz458lx9xfbracvz4icjjyi6s304kk-RSA-2.3.1-doc/share/doc/RSA-2.3.1
Configuration files installed in:
/nix/store/qa57n6w7772mq96gbhz1jf95aqz4ay2l-RSA-2.3.1/etc
No alex found
Using ar found on system at:
/nix/store/1zf4cnaaidjajwb4gx4mnkqc5dypkcdy-binutils-2.31.1/bin/ar
No c2hs found
No cpphs found
No doctest found
Using gcc version 9.2.0 given by user at:
/nix/store/xh3bh8nir5d45zk45dz9xxfs2j95cby4-gcc-wrapper-9.2.0/bin/gcc
Using ghc version 8.8.3 found on system at:
/nix/store/z9hplpp91s3s8k8gsj5wvhnsqpvijz0p-ghc-8.8.3/bin/ghc
Using ghc-pkg version 8.8.3 found on system at:
/nix/store/z9hplpp91s3s8k8gsj5wvhnsqpvijz0p-ghc-8.8.3/bin/ghc-pkg
No ghcjs found
No ghcjs-pkg found
No greencard found
Using haddock version 2.23.0 found on system at:
/nix/store/z9hplpp91s3s8k8gsj5wvhnsqpvijz0p-ghc-8.8.3/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/z9hplpp91s3s8k8gsj5wvhnsqpvijz0p-ghc-8.8.3/bin/hpc
Using hsc2hs version 0.68.5 found on system at:
/nix/store/z9hplpp91s3s8k8gsj5wvhnsqpvijz0p-ghc-8.8.3/bin/hsc2hs
Using hscolour version 1.24 found on system at:
/nix/store/4kr0317ac62lw56yaygq2kfiqv96za9f-hscolour-1.24.4/bin/HsColour
No jhc found
Using ld found on system at:
/nix/store/axkkr27z9cjzxac1c9s6ngda73kbz063-binutils-wrapper-2.31.1/bin/ld.gold
No pkg-config found
Using runghc version 8.8.3 found on system at:
/nix/store/z9hplpp91s3s8k8gsj5wvhnsqpvijz0p-ghc-8.8.3/bin/runghc
Using strip version 2.31 found on system at:
/nix/store/1zf4cnaaidjajwb4gx4mnkqc5dypkcdy-binutils-2.31.1/bin/strip
Using tar found on system at:
/nix/store/c98k0shcp2yp69g81mqhbqw3xbxvnk0r-gnutar-1.32/bin/tar
No uhc found
building
Preprocessing test suite 'test-rsa' for RSA-2.3.1..
Building test suite 'test-rsa' for RSA-2.3.1..
[1 of 2] Compiling Codec.Crypto.RSA.Pure ( src/Codec/Crypto/RSA/Pure.hs, dist/build/test-rsa/test-rsa-tmp/Codec/Crypto/RSA/Pure.o )
running tests
src/Codec/Crypto/RSA/Pure.hs:115:25: error:
• Could not deduce (MonadFail m) arising from a use of ‘fail’
from the context: (Monad m, Show a)
bound by the type signature for:
failOnError :: forall (m :: * -> *) a b.
(Monad m, Show a) =>
Either a b -> m b
at src/Codec/Crypto/RSA/Pure.hs:114:1-53
Possible fix:
add (MonadFail m) to the context of
the type signature for:
failOnError :: forall (m :: * -> *) a b.
(Monad m, Show a) =>
Either a b -> m b
• In the expression: fail (show e)
In an equation for ‘failOnError’:
failOnError (Left e) = fail (show e)
|
115 | failOnError (Left e) = fail (show e)
| ^^^^^^^^^^^^^
Package has no test suites.
haddockPhase
builder for '/nix/store/iamd2pmg0xhh67b9wx23pfq815v1rpg5-RSA-2.3.1.drv' failed with exit code 1
cannot build derivation '/nix/store/i1fqnspxpy7ikvbzbnr484dlggn98dpk-ghc-8.8.3-with-packages.drv': 1 dependencies couldn't be built

This is a known issue. To fix the RSA package that causes the build failure, create a file Config/nix/haskell-packages/RSA.nix and paste in the following content:
{ mkDerivation, base, binary, bytestring, crypto-api
, crypto-pubkey-types, QuickCheck, SHA, stdenv, tagged
, test-framework, test-framework-quickcheck2
}:
mkDerivation {
pname = "RSA";
version = "2.4.1";
sha256 = "0hchsqrxpfw7mqrqwscfy8ig1w2di6w3nxpzi873w0gibv2diibj";
libraryHaskellDepends = [
base binary bytestring crypto-api crypto-pubkey-types SHA
];
testHaskellDepends = [
base binary bytestring crypto-api crypto-pubkey-types QuickCheck
SHA tagged test-framework test-framework-quickcheck2
];
description = "Implementation of RSA, using the padding schemes of PKCS#1 v2.1.";
license = stdenv.lib.licenses.bsd3;
}
This overrides the existing RSA package to use a newer version. After that make -B .envrc should work as expected.
In case you're curious how to update an existing package from the IHP nixpkgs version, take a look at https://ihp.digitallyinduced.com/Guide/package-management.html#using-a-different-version-of-a-haskell-package :)

Related

Cannot build project with z3-haskell on windows 10

I want to build the haskell bindings for z3 in a Cabal project, the following is the minimum (faulty) example:
Using a project initialized by cabal init:
test/
- Main.hs
- Setup.hs
- CHANGELOG.md
- test.cabal
With modified test.cabal:
cabal-version: 3.0
name: z3-test
version: 0.1.0.0
extra-source-files: CHANGELOG.md
executable test
main-is: Main.hs
build-depends: base >=4.14 && <4.15
, z3 ^>=408.2
default-language: Haskell2010
Z3 binaries are located at C:\z3-4.8.5-x86-win.
Z3-bindings are installed:
cabal v1-install z3 --extra-lib-dirs=C:/z3-4.8.5-x64-win/bin --extra-include-dirs=C:/z3-4.8.5-x64-win/include -v3
All the requested packages are already installed:
z3-408.2
Use --reinstall if you want to reinstall anyway.
Now building the project using:
cabal v2-build --extra-lib-dirs=C:/z3-4.8.5-x64-win/bin --extra-include-dirs=C:/z3-4.8.5-x64-win/include -v3
Results in the error:
Build profile: -w ghc-8.10.2 -O1
In order, the following will be built (use -v for more details):
- z3-408.2 (lib) (requires build)
- z3-test-0.1.0.0 (exe:test) (first run)
Starting z3-408.2 (lib)
Failed to build z3-408.2. The failure occurred during the configure step.
Build log (
C:\cabal\logs\ghc-8.10.2\z3-408.2-1722a25655334afbca91ac935f14ff0d20ccf8c4.log
):
Configuring library for z3-408.2..
cabal.exe: Missing dependency on a foreign library:
* Missing (or bad) header file: z3.h
* Missing (or bad) C library: z3
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.If the
library file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
If the header file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
cabal.exe: Failed to build z3-408.2 (which is required by exe:test from
z3-test-0.1.0.0). See the build log above for details.
How can I build a project with the z3 bindings?
Note that:
GHC version = 8.10.2
Cabal version = 3.2.0.0
I can only use cabal
Using cabal install ... or cabal v2-install ... results in Cannot build .. z3 because none of the components are available to build:

Leksah in NixOS 14.12 - fails to install, why?

Leksah in NixOS 14.12 - unstable channel fails to install, why ?
[demo#nixos:~]$ nix-channel --list
nixpkgs http://nixos.org/channels/nixpkgs-unstable
[demo#nixos:~]$ nix-env -i leksah
installing ‘leksah’
these derivations will be built:
/nix/store/69k8c7mvz64k08z9gabh7gmcn1i265rn-haskell-regex-tdfa-text-1.0.0.2.drv
/nix/store/h9dxxnab1sngr2d6g1q9qj0yv35iqyzs-haskell-leksah-0.15.0.1.drv
/nix/store/lfjh66d015dkh9kr51h5871c7gqji5na-ghc-7.10.1.drv
/nix/store/pdpsxp33mffmq72vhk5ig8bhrrdyq7p2-leksah.drv
building path(s) ‘/nix/store/53kxzd2apkijwib78gw4mdlpxs5vllpj-haskell-regex-tdfa-text-1.0.0.2’
setupCompilerEnvironmentPhase
Build with /nix/store/bc84hdk730zcdm1c9s5yf2ahpvm51lzp-ghc-7.10.1.
unpacking sources
unpacking source archive /nix/store/cmrcmadl401k7sjgqwj2dz4b9jqwxnck-regex-tdfa-text-1.0.0.2.tar.gz
source root is regex-tdfa-text-1.0.0.2
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/tmp/nix-build-haskell-regex-tdfa-text-1.0.0.2.drv-0/package.conf.d -j1 -threaded
[1 of 1] Compiling Main ( Setup.lhs, /tmp/nix-build-haskell-regex-tdfa-text-1.0.0.2.drv-0/Main.o )
Linking Setup ...
configuring
configureFlags: --verbose --prefix=/nix/store/53kxzd2apkijwib78gw4mdlpxs5vllpj-haskell-regex-tdfa-text-1.0.0.2 --libdir=$prefix/lib/$compiler --libsubdir=$pkgid --with-gcc=gcc --package-db=/tmp/nix-build-haskell-regex-tdfa-text-1.0.0.2.drv-0/package.conf.d --ghc-option=-optl=-Wl,-rpath=/nix/store/53kxzd2apkijwib78gw4mdlpxs5vllpj-haskell-regex-tdfa-text-1.0.0.2/lib/ghc-7.10.1/regex-tdfa-text-1.0.0.2 --ghc-option=-j1 --enable-split-objs --disable-library-profiling --enable-shared --enable-library-vanilla --enable-executable-dynamic --enable-tests
Configuring regex-tdfa-text-1.0.0.2...
Dependency array -any: using array-0.5.1.0
Dependency base >=3 && <5: using base-4.8.0.0
Dependency regex-base -any: using regex-base-0.93.2
Dependency regex-tdfa >=1.1.1: using regex-tdfa-1.2.0
Dependency text -any: using text-1.2.1.1
Using Cabal-1.22.2.0 compiled by ghc-7.10
Using compiler: ghc-7.10.1
Using install prefix:
/nix/store/53kxzd2apkijwib78gw4mdlpxs5vllpj-haskell-regex-tdfa-text-1.0.0.2
Binaries installed in:
/nix/store/53kxzd2apkijwib78gw4mdlpxs5vllpj-haskell-regex-tdfa-text-1.0.0.2/bin
Libraries installed in:
/nix/store/53kxzd2apkijwib78gw4mdlpxs5vllpj-haskell-regex-tdfa-text-1.0.0.2/lib/ghc-7.10.1/regex-tdfa-text-1.0.0.2
Private binaries installed in:
/nix/store/53kxzd2apkijwib78gw4mdlpxs5vllpj-haskell-regex-tdfa-text-1.0.0.2/libexec
Data files installed in:
/nix/store/53kxzd2apkijwib78gw4mdlpxs5vllpj-haskell-regex-tdfa-text-1.0.0.2/share/x86_64-linux-ghc-7.10.1/regex-tdfa-text-1.0.0.2
Documentation installed in:
/nix/store/53kxzd2apkijwib78gw4mdlpxs5vllpj-haskell-regex-tdfa-text-1.0.0.2/share/doc/x86_64-linux-ghc-7.10.1/regex-tdfa-text-1.0.0.2
Configuration files installed in:
/nix/store/53kxzd2apkijwib78gw4mdlpxs5vllpj-haskell-regex-tdfa-text-1.0.0.2/etc
No alex found
Using ar found on system at:
/nix/store/yxg5zsjxp1l16xk7r23rayyc18fkxynk-binutils-2.23.1/bin/ar
No c2hs found
No cpphs found
Using gcc version 4.8.4 given by user at:
/nix/store/ylj1q31a7x3pvcraxk60dyv9y4wmwcrc-gcc-wrapper-4.8.4/bin/gcc
Using ghc version 7.10.1 found on system at:
/nix/store/bc84hdk730zcdm1c9s5yf2ahpvm51lzp-ghc-7.10.1/bin/ghc
Using ghc-pkg version 7.10.1 found on system at:
/nix/store/bc84hdk730zcdm1c9s5yf2ahpvm51lzp-ghc-7.10.1/bin/ghc-pkg
No ghcjs found
No ghcjs-pkg found
No greencard found
Using haddock version 2.16.0 found on system at:
/nix/store/bc84hdk730zcdm1c9s5yf2ahpvm51lzp-ghc-7.10.1/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/bc84hdk730zcdm1c9s5yf2ahpvm51lzp-ghc-7.10.1/bin/hpc
Using hsc2hs version 0.67 found on system at:
/nix/store/bc84hdk730zcdm1c9s5yf2ahpvm51lzp-ghc-7.10.1/bin/hsc2hs
Using hscolour version 1.22 found on system at:
/nix/store/g6mfdhbmwm0499n88bnzd32y96gmnfn9-hscolour-1.23/bin/HsColour
No jhc found
Using ld found on system at:
/nix/store/ylj1q31a7x3pvcraxk60dyv9y4wmwcrc-gcc-wrapper-4.8.4/bin/ld
No lhc found
No lhc-pkg found
No pkg-config found
Using strip version 2.23 found on system at:
/nix/store/yxg5zsjxp1l16xk7r23rayyc18fkxynk-binutils-2.23.1/bin/strip
Using tar found on system at:
/nix/store/blyc5sprbm85ph2fmksyhrqislp9j0im-gnutar-1.28/bin/tar
No uhc found
building
Building regex-tdfa-text-1.0.0.2...
Preprocessing library regex-tdfa-text-1.0.0.2...
[1 of 2] Compiling Text.Regex.TDFA.Text.Lazy ( Text/Regex/TDFA/Text/Lazy.hs, dist/build/Text/Regex/TDFA/Text/Lazy.o )
Text/Regex/TDFA/Text/Lazy.hs:77:9:
Non type-variable argument
in the constraint: Data.Array.Base.IArray a (Int, Int)
(Use FlexibleContexts to permit this)
When checking that ‘go’ has the inferred type
go :: forall t (a :: * -> * -> *) i.
(Functor (a i), Num i, GHC.Arr.Ix i,
Data.Array.Base.IArray a (Int, Int), Extract t) =>
Int -> t -> [a i (Int, Int)] -> [a i (t, (Int, Int))]
In the expression:
let
go i _ _ | i `seq` False = undefined
go _i _t [] = []
go i t (x : xs)
= let ... in fmap trans x : seq t' (go (off0 + len0) t' xs)
in go 0 source (matchAll regex source)
In an equation for ‘matchAllText’:
matchAllText regex source
= let
go i _ _ | i `seq` False = undefined
go _i _t [] = ...
go i t (x : xs) = ...
in go 0 source (matchAll regex source)
builder for ‘/nix/store/69k8c7mvz64k08z9gabh7gmcn1i265rn-haskell-regex-tdfa-text-1.0.0.2.drv’ failed with exit code 1
cannot build derivation ‘/nix/store/lfjh66d015dkh9kr51h5871c7gqji5na-ghc-7.10.1.drv’: 1 dependencies couldn't be built
cannot build derivation ‘/nix/store/pdpsxp33mffmq72vhk5ig8bhrrdyq7p2-leksah.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/pdpsxp33mffmq72vhk5ig8bhrrdyq7p2-leksah.drv’ failed
Current versions of Leksah compile successfully in the Nixpkgs master branch, i.e. at http://hydra.cryp.to/build/1410084. The unstable channel will have these updates soon. There are still some problems left to figure out with regard to how to run Leksah successfully on NixOS: https://github.com/NixOS/nixpkgs/pull/10351 has more details.

Failed to install ghcjs-dom-0.0.7 - src/GHCJS/DOM.hs:3:14: Unsupported extension: JavaScriptFFI

I have problems installing Leksah, the depends on ghcjs-dom:
Here's what I precisely get when trying to install this precise package:
$ cabal install ghcjs-dom -v
Reading available packages...
Choosing modular solver.
Resolving dependencies...
Ready to install ghcjs-dom-0.0.7
Waiting for install task to finish...
Extracting
/Users/bastiengallay/Library/Haskell/repo-cache/hackage.haskell.org/ghcjs-dom/0.0.7/ghcjs-dom-0.0.7.tar.gz
to /var/folders/1s/mnr_nf9x1c3fr5v_bcrg712m0000gn/T/ghcjs-dom-0.0.7-24896...
Updating ghcjs-dom.cabal with the latest revision from the index.
Configuring ghcjs-dom-0.0.7...
Flags chosen: gtk3=True, jsc=False, webkit=False, jsffi=False, ghcjs=True
Dependency base ==4.6.0.1: using base-4.6.0.1
Dependency mtl ==2.2.0.1: using mtl-2.2.0.1
Using Cabal-1.20.0.0 compiled by ghc-7.6
Using compiler: ghc-7.6.3
Using install prefix:
/Users/bastiengallay/Library/Haskell/ghc-7.6.3/lib/ghcjs-dom-0.0.7
Binaries installed in:
/Users/bastiengallay/Library/Haskell/ghc-7.6.3/lib/ghcjs-dom-0.0.7/bin
Libraries installed in:
/Users/bastiengallay/Library/Haskell/ghc-7.6.3/lib/ghcjs-dom-0.0.7/lib
Private binaries installed in:
/Users/bastiengallay/Library/Haskell/ghc-7.6.3/lib/ghcjs-dom-0.0.7/libexec
Data files installed in:
/Users/bastiengallay/Library/Haskell/ghc-7.6.3/lib/ghcjs-dom-0.0.7/share
Documentation installed in:
/Users/bastiengallay/Library/Haskell/ghc-7.6.3/lib/ghcjs-dom-0.0.7/doc
Configuration files installed in:
/Users/bastiengallay/Library/Haskell/ghc-7.6.3/lib/ghcjs-dom-0.0.7/etc
Using alex version 3.1.3 found on system at:
/Users/bastiengallay/Library/Haskell/bin/alex
Using ar found on system at: /usr/bin/ar
No c2hs found
No cpphs found
No ffihugs found
Using gcc version 4.8.3 found on system at: /usr/local/bin/gcc
Using ghc version 7.6.3 found on system at: /usr/local/bin/ghc
Using ghc-pkg version 7.6.3 found on system at: /usr/local/bin/ghc-pkg
No greencard found
Using haddock version 2.13.2 found on system at: /usr/local/bin/haddock
Using happy version 1.19.3 found on system at:
/Users/bastiengallay/Library/Haskell/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.6 found on system at: /usr/local/bin/hpc
Using hsc2hs version 0.67 found on system at: /usr/local/bin/hsc2hs
No hscolour found
No hugs found
No jhc found
Using ld found on system at: /usr/bin/ld
No lhc found
No lhc-pkg found
No nhc98 found
Using pkg-config version 0.28 found on system at: /usr/local/bin/pkg-config
Using strip found on system at: /usr/bin/strip
Using tar found on system at: /usr/bin/tar
No uhc found
Component build order: library
creating dist/build
creating dist/build/autogen
Building ghcjs-dom-0.0.7...
Preprocessing library ghcjs-dom-0.0.7...
Building library...
creating dist/build
/usr/local/bin/ghc --make -fbuilding-cabal-package -O -outputdir dist/build -odir dist/build -hidir dist/build -stubdir dist/build -i -idist/build -isrc -idist/build/autogen -Idist/build/autogen -Idist/build -optP-include -optPdist/build/autogen/cabal_macros.h -package-name ghcjs-dom-0.0.7 -hide-all-packages -package-db dist/package.conf.inplace -package-id base-4.6.0.1-6c351d70a24d3e96f315cba68f3acf57 -package-id mtl-2.2.0.1-ef91e0abcf7a4fb581ecb7fe83cdcba1 -XHaskell2010 GHCJS.DOM GHCJS.DOM.Types GHCJS.DOM.Attr GHCJS.DOM.BarProp GHCJS.DOM.Blob GHCJS.DOM.CharacterData GHCJS.DOM.Console GHCJS.DOM.Css GHCJS.DOM.CSSRule GHCJS.DOM.CSSRuleList GHCJS.DOM.CSSStyleDeclaration GHCJS.DOM.CSSStyleSheet GHCJS.DOM.CSSValue GHCJS.DOM.Document GHCJS.DOM.DocumentType GHCJS.DOM.DOMApplicationCache GHCJS.DOM.DOMImplementation GHCJS.DOM.DOMMimeType GHCJS.DOM.DOMMimeTypeArray GHCJS.DOM.DOMNamedFlowCollection GHCJS.DOM.DOMPlugin GHCJS.DOM.DOMPluginArray GHCJS.DOM.DOMSelection GHCJS.DOM.DOMSettableTokenList GHCJS.DOM.DOMTokenList GHCJS.DOM.DOMWindow GHCJS.DOM.DOMWindowCSS GHCJS.DOM.Element GHCJS.DOM.Event GHCJS.DOM.EventM GHCJS.DOM.Events GHCJS.DOM.EventTargetClosures GHCJS.DOM.File GHCJS.DOM.FileList GHCJS.DOM.History GHCJS.DOM.HTMLAnchorElement GHCJS.DOM.HTMLAppletElement GHCJS.DOM.HTMLAreaElement GHCJS.DOM.HTMLBaseElement GHCJS.DOM.HTMLBaseFontElement GHCJS.DOM.HTMLBodyElement GHCJS.DOM.HTMLBRElement GHCJS.DOM.HTMLButtonElement GHCJS.DOM.HTMLCollection GHCJS.DOM.HTMLDirectoryElement GHCJS.DOM.HTMLDivElement GHCJS.DOM.HTMLDListElement GHCJS.DOM.HTMLDocument GHCJS.DOM.HTMLElement GHCJS.DOM.HTMLFieldSetElement GHCJS.DOM.HTMLFontElement GHCJS.DOM.HTMLFormElement GHCJS.DOM.HTMLFrameElement GHCJS.DOM.HTMLFrameSetElement GHCJS.DOM.HTMLHeadElement GHCJS.DOM.HTMLHeadingElement GHCJS.DOM.HTMLHRElement GHCJS.DOM.HTMLHtmlElement GHCJS.DOM.HTMLIFrameElement GHCJS.DOM.HTMLImageElement GHCJS.DOM.HTMLInputElement GHCJS.DOM.HTMLLabelElement GHCJS.DOM.HTMLLegendElement GHCJS.DOM.HTMLLIElement GHCJS.DOM.HTMLLinkElement GHCJS.DOM.HTMLMapElement GHCJS.DOM.HTMLMenuElement GHCJS.DOM.HTMLMetaElement GHCJS.DOM.HTMLModElement GHCJS.DOM.HTMLObjectElement GHCJS.DOM.HTMLOListElement GHCJS.DOM.HTMLOptGroupElement GHCJS.DOM.HTMLOptionElement GHCJS.DOM.HTMLOptionsCollection GHCJS.DOM.HTMLParagraphElement GHCJS.DOM.HTMLParamElement GHCJS.DOM.HTMLPreElement GHCJS.DOM.HTMLQuoteElement GHCJS.DOM.HTMLScriptElement GHCJS.DOM.HTMLSelectElement GHCJS.DOM.HTMLStyleElement GHCJS.DOM.HTMLTableCaptionElement GHCJS.DOM.HTMLTableCellElement GHCJS.DOM.HTMLTableColElement GHCJS.DOM.HTMLTableElement GHCJS.DOM.HTMLTableRowElement GHCJS.DOM.HTMLTableSectionElement GHCJS.DOM.HTMLTextAreaElement GHCJS.DOM.HTMLTitleElement GHCJS.DOM.HTMLUListElement GHCJS.DOM.KeyboardEvent GHCJS.DOM.Location GHCJS.DOM.MediaList GHCJS.DOM.MediaQueryList GHCJS.DOM.MouseEvent GHCJS.DOM.NamedNodeMap GHCJS.DOM.Navigator GHCJS.DOM.Node GHCJS.DOM.NodeFilter GHCJS.DOM.NodeIterator GHCJS.DOM.NodeList GHCJS.DOM.ProcessingInstruction GHCJS.DOM.Range GHCJS.DOM.Ranges GHCJS.DOM.Screen GHCJS.DOM.StyleMedia GHCJS.DOM.StyleSheet GHCJS.DOM.StyleSheetList GHCJS.DOM.Stylesheets GHCJS.DOM.Storage GHCJS.DOM.Text GHCJS.DOM.Traversal GHCJS.DOM.TreeWalker GHCJS.DOM.UIEvent GHCJS.DOM.ValidityState GHCJS.DOM.WebKitNamedFlow GHCJS.DOM.WebKitPoint GHCJS.DOM.XPathExpression GHCJS.DOM.XPathNSResolver GHCJS.DOM.XPathResult GHCJS.DOM.DOMSecurityPolicy GHCJS.DOM.DOMStringList GHCJS.DOM.Geolocation GHCJS.DOM.HTMLCanvasElement GHCJS.DOM.HTMLDetailsElement GHCJS.DOM.HTMLEmbedElement GHCJS.DOM.HTMLKeygenElement GHCJS.DOM.HTMLMarqueeElement GHCJS.DOM.HTMLMediaElement GHCJS.DOM.HTMLVideoElement GHCJS.DOM.MediaError GHCJS.DOM.StorageInfo GHCJS.DOM.TimeRanges
src/GHCJS/DOM.hs:3:14: Unsupported extension: JavaScriptFFI
Failed to install ghcjs-dom-0.0.7
World file is already up to date.
cabal: Error: some packages failed to install:
ghcjs-dom-0.0.7 failed during the building phase. The exception was:
ExitFailure 1
My config:
$ cabal --version
cabal-install version 1.20.0.2
using version 1.20.0.0 of the Cabal library
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3
Some patches seem to exist for GHC 7.8, but don't know how to use them.
ghcjs-dom is not designed to be installed with ghc, it is designed to be installed with ghc-js. To install packages for ghc-js, you need to run cabal install --ghcjs packageName
I noticed in the error messages that "c2hs" can't be found. This is often caused by not having ~/.cabal/bin in your path. Try typing "c2hs" at the prompt, this will tell you if it is set up.

cabal-install 1.20.0.0 fails to install on OS X

On OS X 10.9.2, I installed the GHC platform fresh. (There was a prior installation, but I believe I wiped it out by deleting /Library/Haskell and /Users/username/Library/Haskell.) The Platform came with Cabal 1.16. I wanted the latest Cabal with sandbox support, so I ran:
cabal update
cabal install cabal --reinstall
That went fine. But then I tried to upgrade cabal-install as well:
cabal install cabal-install -v
It failed with the following output:
Reading available packages...
Choosing modular solver.
Resolving dependencies...
Ready to install cabal-install-1.20.0.0
Waiting for install task to finish...
Extracting
/Users/username/Library/Haskell/repo-cache/hackage.haskell.org/cabal-install/1.20.0.0/cabal-install-1.20.0.0.tar.gz
to
/var/folders/jt/ywln8_hn75q1yfkhnpcs1bzh0000gn/T/cabal-install-1.20.0.0-51744...
Updating cabal-install.cabal with the latest revision from the index.
Configuring cabal-install-1.20.0.0...
Flags chosen: old-directory=False
Dependency Cabal ==1.20.0.0: using Cabal-1.20.0.0
Dependency HTTP ==4000.2.8: using HTTP-4000.2.8
Dependency array ==0.4.0.1: using array-0.4.0.1
Dependency base ==4.6.0.1: using base-4.6.0.1
Dependency bytestring ==0.10.0.2: using bytestring-0.10.0.2
Dependency containers ==0.5.0.0: using containers-0.5.0.0
Dependency directory ==1.2.0.1: using directory-1.2.0.1
Dependency filepath ==1.3.0.1: using filepath-1.3.0.1
Dependency mtl ==2.1.2: using mtl-2.1.2
Dependency network ==2.4.1.2: using network-2.4.1.2
Dependency pretty ==1.1.1.0: using pretty-1.1.1.0
Dependency process ==1.1.0.2: using process-1.1.0.2
Dependency random ==1.0.1.1: using random-1.0.1.1
Dependency stm ==2.4.2: using stm-2.4.2
Dependency time ==1.4.0.1: using time-1.4.0.1
Dependency unix ==2.6.0.1: using unix-2.6.0.1
Dependency zlib ==0.5.4.1: using zlib-0.5.4.1
/var/folders/jt/ywln8_hn75q1yfkhnpcs1bzh0000gn/T/51744.c:1:12:
warning: control reaches end of non-void function [-Wreturn-type]
int foo() {}
^
1 warning generated.
Using Cabal-1.16.0 compiled by ghc-7.6
Using compiler: ghc-7.6.3
Using install prefix:
/Users/username/Library/Haskell/ghc-7.6.3/lib/cabal-install-1.20.0.0
Binaries installed in:
/Users/username/Library/Haskell/ghc-7.6.3/lib/cabal-install-1.20.0.0/bin
Libraries installed in:
/Users/username/Library/Haskell/ghc-7.6.3/lib/cabal-install-1.20.0.0/lib
Private binaries installed in:
/Users/username/Library/Haskell/ghc-7.6.3/lib/cabal-install-1.20.0.0/libexec
Data files installed in:
/Users/username/Library/Haskell/ghc-7.6.3/lib/cabal-install-1.20.0.0/share
Documentation installed in:
/Users/username/Library/Haskell/ghc-7.6.3/lib/cabal-install-1.20.0.0/doc
Using alex version 3.0.5 found on system at: /usr/bin/alex
Using ar found on system at: /usr/bin/ar
No c2hs found
No cpphs found
No ffihugs found
Using gcc version 4.2.1 found on system at: /usr/bin/gcc
Using ghc version 7.6.3 found on system at: /usr/bin/ghc
Using ghc-pkg version 7.6.3 found on system at: /usr/bin/ghc-pkg
No greencard found
Using haddock version 2.13.2 found on system at: /usr/bin/haddock
Using happy version 1.18.10 found on system at: /usr/bin/happy
No hmake found
Using hpc version 0.6 found on system at: /usr/bin/hpc
Using hsc2hs version 0.67 found on system at: /usr/bin/hsc2hs
No hscolour found
No hugs found
No jhc found
Using ld found on system at: /usr/bin/ld
No lhc found
No lhc-pkg found
No nhc98 found
Using pkg-config version 0.28 found on system at: /usr/local/bin/pkg-config
Using ranlib found on system at: /usr/bin/ranlib
Using strip found on system at: /usr/bin/strip
Using tar found on system at: /usr/bin/tar
No uhc found
creating dist/build
creating dist/build/autogen
Building cabal-install-1.20.0.0...
Preprocessing executable 'cabal' for cabal-install-1.20.0.0...
Building executable cabal...
creating dist/build/cabal
creating dist/build/cabal/cabal-tmp
Building C Sources.
creating dist/build/cabal/cabal-tmp
/usr/bin/ghc -c -odir dist/build/cabal/cabal-tmp -Idist/build/cabal/cabal-tmp -optc-O2 -package-db dist/package.conf.inplace -package-id Cabal-1.20.0.0-ed0a7e0a5adc8ca1f9e6d405d3a3d56c -package-id HTTP-4000.2.8-cdf033f9d7051824f52cd5101df67509 -package-id array-0.4.0.1-3b78425c10ff2dad7acf7e8c8ae014c3 -package-id base-4.6.0.1-6c351d70a24d3e96f315cba68f3acf57 -package-id bytestring-0.10.0.2-bf7aaeef3f644374cd7d5a9066cd9017 -package-id containers-0.5.0.0-ab1dae9a94cd3cc84e7b2805636ebfa2 -package-id directory-1.2.0.1-b2c415ae3fe3357f80678150b6da5a3c -package-id filepath-1.3.0.1-b12cbe18566fe1532a1fda4c85e31cbe -package-id mtl-2.1.2-94c72af955e94b8d7b2f359dadd0cb62 -package-id network-2.4.1.2-28b12b2ed8a678ffb29bc07483d3d363 -package-id pretty-1.1.1.0-66181c695e6a2e173ba2088cf55cc396 -package-id process-1.1.0.2-d20d01635195e5ac2ebee73032c7fe84 -package-id random-1.0.1.1-ecb94a9408452ed74f22425077442903 -package-id stm-2.4.2-b5d718b1a5f1fbcdb61a336aef0c2130 -package-id time-1.4.0.1-10dc4804a19dc0000fab79908f1a9f50 -package-id unix-2.6.0.1-1b262a42f35f597365016088e0cde399 -package-id zlib-0.5.4.1-13ba81ac0d7e6f3bdf1ee5ddce4e9aab cbits/getnumcores.c
<command line>: cannot satisfy -package-id HTTP-4000.2.8-cdf033f9d7051824f52cd5101df67509
(use -v for more information)
Failed to install cabal-install-1.20.0.0
World file is already up to date.
cabal: Error: some packages failed to install:
cabal-install-1.20.0.0 failed during the building phase. The exception was:
ExitFailure 1
I'm not especially familiar with Haskell packaging. The error seems to be saying it can't find the package HTTP-4000.2.8-cdf033f9d7051824f52cd5101df67509. I don't know about the checksum, but it's clear from the docs that version 4000.2.8 does exist.
How might I clear this error and get the latest cabal-install?
Edit: Here's the output from ghc-pkg describe HTTP, as requested in the comments:
WARNING: cache is out of date: /Library/Frameworks/GHC.framework/Versions/7.6.3-x86_64/usr/lib/ghc-7.6.3/package.conf.d/package.cache
use 'ghc-pkg recache' to fix.
name: HTTP
version: 4000.2.8
id: HTTP-4000.2.8-cdf033f9d7051824f52cd5101df67509
license: BSD3
copyright:
maintainer: Ganesh Sittampalam <http#projects.haskell.org>
stability:
homepage: https://github.com/haskell/HTTP
package-url:
synopsis: A library for client-side HTTP
description: The HTTP package supports client-side web programming in Haskell. It lets you set up
HTTP connections, transmitting requests and processing the responses coming back, all
from within the comforts of Haskell. It's dependent on the network package to operate,
but other than that, the implementation is all written in Haskell.
.
A basic API for issuing single HTTP requests + receiving responses is provided. On top
of that, a session-level abstraction is also on offer (the #BrowserAction# monad);
it taking care of handling the management of persistent connections, proxies,
state (cookies) and authentication credentials required to handle multi-step
interactions with a web server.
.
The representation of the bytes flowing across is extensible via the use of a type class,
letting you pick the representation of requests and responses that best fits your use.
Some pre-packaged, common instances are provided for you (#ByteString#, #String#.)
.
Here's an example use:
.
>
> do
> rsp <- Network.HTTP.simpleHTTP (getRequest "http://www.haskell.org/")
> -- fetch document and return it (as a 'String'.)
> fmap (take 100) (getResponseBody rsp)
>
> do
> (_, rsp)
> <- Network.Browser.browse $ do
> setAllowRedirects True -- handle HTTP redirects
> request $ getRequest "http://www.haskell.org/"
> return (take 100 (rspBody rsp))
category: Network
author: Warrick Gray <warrick.gray#hotmail.com>
exposed: True
exposed-modules: Network.BufferType Network.Stream
Network.StreamDebugger Network.StreamSocket Network.TCP
Network.HTTP Network.HTTP.Headers Network.HTTP.Base
Network.HTTP.Stream Network.HTTP.Auth Network.HTTP.Cookie
Network.HTTP.Proxy Network.HTTP.HandleStream Network.Browser
hidden-modules: Network.HTTP.Base64 Network.HTTP.MD5Aux
Network.HTTP.Utils Paths_HTTP
trusted: False
import-dirs: /Library/Haskell/ghc-7.6.3/lib/HTTP-4000.2.8/lib
library-dirs: /Library/Haskell/ghc-7.6.3/lib/HTTP-4000.2.8/lib
hs-libraries: HSHTTP-4000.2.8
extra-libraries:
extra-ghci-libraries:
include-dirs:
includes:
depends: array-0.4.0.1-3b78425c10ff2dad7acf7e8c8ae014c3
base-4.6.0.1-6c351d70a24d3e96f315cba68f3acf57
bytestring-0.10.0.2-bf7aaeef3f644374cd7d5a9066cd9017
mtl-2.1.2-94c72af955e94b8d7b2f359dadd0cb62
network-2.4.1.2-28b12b2ed8a678ffb29bc07483d3d363
old-time-1.1.0.1-4096e5c0be1f1ff8883115216d1bc5d1
parsec-3.1.3-a8edfa168176dff038c6dcd45a539942
hugs-options:
cc-options:
ld-options:
framework-dirs:
frameworks:
haddock-interfaces: /Library/Haskell/ghc-7.6.3/lib/HTTP-4000.2.8/doc/html/HTTP.haddock
haddock-html: /Library/Haskell/ghc-7.6.3/lib/HTTP-4000.2.8/doc/html
pkgroot: "/Library/Frameworks/GHC.framework/Versions/7.6.3-x86_64/usr/lib/ghc-7.6.3"
There are two parts to the solution.
First, I had to do ghc-pkg recache. Then, I had to explicitly request the latest version of cabal-install by running cabal install cabal-install-1.20.0.0. It's not clear to me why either of these steps would be necessary just to get the latest version of something as basic as cabal-install. But there's the solution, at least for now.

Cabal: cabal configure fails

This question is only yak-shaving to try and troubleshoot another problem.
So, in an attempt to diagnose another problem of mine, I was advised to try:
cabal unpack base
cd base-4.3.1.0
cabal haddock
To see what that did.
Only, when I did cabal unpack base, it unpacked base-3.0.3.2. Then cabal haddock complained that I needed to run cabal configure first then that failed (lost the exact error, sadly).
So I decided to install base-4.3.1.0, just so I could reenact the instructions exactly.
Even after install, cabal unpack base unpacks base-3.0.3.2, though cabal unpack base-4.3.1.0 unpacks base-4.3.1.0.
Now I'm can't get either to configure:
% cabal unpack base
Unpacking to base-3.0.3.2/
% cd base-3.0.3.2
% cabal haddock
cabal: Run the 'configure' command first.
% cabal configure
Resolving dependencies...
Configuring base-3.0.3.2...
cabal: At least the following dependencies are missing:
base >=4.0 && <4.3, syb ==0.1.*
% cd ..
%
% cabal unpack base-4.3.1.0
Unpacking to base-4.3.1.0/
% cd base-4.3.1.0
% cabal haddock
cabal: Run the 'configure' command first.
% cabal configure
Resolving dependencies...
Configuring base-4.3.1.0...
configure: WARNING: unrecognized options: --with-compiler, --with-gcc
checking for gcc... gcc
checking whether the C compiler works... yes
...
checking for library containing iconv... -liconv
checking for library containing locale_charset... none required
configure: creating ./config.status
config.status: error: cannot find input file: `base.buildinfo.in'
% cd ..
Also, I can't revert to base-3.0.3.2, because it depends on having
base version >=4.0 <4.3 (WTF?), and I can't install base-4.2.0.2 b/c it fails
b/c it can't find base.buildinfo.in.
% cabal --version
cabal-install version 0.10.2
using version 1.10.1.0 of the Cabal library
% cabal info base
* base (library)
Synopsis: Basic libraries (backwards-compatibility version)
Versions available: 3.0.3.1, 3.0.3.2, (4.0.0.0), (4.1.0.0), (4.2.0.0),
(4.2.0.1), (4.2.0.2), (4.3.0.0), (4.3.1.0)
Versions installed: (4.3.1.0)
Homepage: [ Not specified ]
Bug reports: http://hackage.haskell.org/trac/ghc/newticket?component=libraries/base
Description: This is a backwards-compatible version of the base package.
It depends on a later version of base, and was probably
supplied with your compiler when it was installed.
License: BSD3
Maintainer: libraries#haskell.org
Source repo: http://darcs.haskell.org/packages/base3-compat
Dependencies: base >=4.0 && <4.3, syb ==0.1.*
Documentation: /usr/local/share/doc/ghc/html/libraries/base-4.3.1.0
Cached: Yes
Modules:
...
%
What am I doing wrong and how can I fix it?
Nobody is meant to self-compile base. It's tied to a particular ghc installation, so you couldn't use any other base package if you built it. I'm not surprised that the base package doesn't build from hackage; most likely nobody ever tries to build it.
Anyway, I'd try checking out the ghc source. The base.buildinfo.in file will be in the base package repo. You could copy the file from the repo to your unpacked distribution, but it's probably better to just build from the checked-out source.
Just be sure to only install the docs and not the library.

Resources