Install of pandoc-placetable fails with error:
Setup: Encountered missing dependencies:
pandoc >=2.1
This is happening since the inlineMardown flag was activated which in turn adds pandoc as a dependency while pandoc is not needed without that flag.
https://github.com/NixOS/nixpkgs/pull/67464
To Reproduce
Either execute:
nix-env -iA nixpkgs.haskellPackages.pandoc-placetable
Or see on hydra:
https://hydra.nixos.org/build/99504747
Expected behavior
Install pandoc-placetable.
Screenshots
setupCompilerEnvironmentPhase
Build with /nix/store/42ikjm2msdg8awxvlljr0h4lkldibdbb-ghc-8.6.5.
unpacking sources
unpacking source archive /nix/store/gyq97askd9q0yrl9bqpr2r59z0r8nlkw-pandoc-placetable-0.5.1.tar.gz
source root is pandoc-placetable-0.5.1
setting SOURCE_DATE_EPOCH to timestamp 1537618669 of file pandoc-placetable-0.5.1/pandoc-placetable.cabal
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 ...
configuring
configureFlags: --verbose --prefix=/nix/store/nhcpqyi4pgpx11g1cxf98ajr6khdhdgd-pandoc-placetable-0.5.1 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --datadir=/nix/store/wlph8d8vl2z8cj5mif7x131jhgpvhmax-pandoc-placetable-0.5.1-data/share/ghc-8.6.5 --docdir=/nix/store/vqdrl8ngpq2470qgdfalbzm9ip671cy2-pandoc-placetable-0.5.1-doc/share/doc/pandoc-placetable-0.5.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 -finlineMarkdown --extra-lib-dirs=/nix/store/vwcrxiwxr294b7iargxcqbda0nr89vfn-ncurses-6.1-20190112/lib --extra-lib-dirs=/nix/store/8pivgdaciz2add2wv7ff13gbz0rijs3f-libffi-3.2.1/lib --extra-lib-dirs=/nix/store/yq9lngyw980m5xdavkzb275xp50nx4my-gmp-6.1.2/lib
Using Parsec parser
Configuring pandoc-placetable-0.5.1...
CallStack (from HasCallStack):
die', called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:950:20 in Cabal-2.4.0.1:Distribution.Simple.Configure
configureFinalizedPackage, called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:460:12 in Cabal-2.4.0.1:Distribution.Simple.Configure
configure, called at libraries/Cabal/Cabal/Distribution/Simple.hs:596:20 in Cabal-2.4.0.1:Distribution.Simple
confHook, called at libraries/Cabal/Cabal/Distribution/Simple/UserHooks.hs:67:5 in Cabal-2.4.0.1:Distribution.Simple.UserHooks
configureAction, called at libraries/Cabal/Cabal/Distribution/Simple.hs:178:19 in Cabal-2.4.0.1:Distribution.Simple
defaultMainHelper, called at libraries/Cabal/Cabal/Distribution/Simple.hs:115:27 in Cabal-2.4.0.1:Distribution.Simple
defaultMain, called at Setup.hs:2:8 in main:Main
Setup: Encountered missing dependencies:
pandoc >=2.1
builder for '/nix/store/kxz9z6b1wh1dawah43b2d81hshqvhfcx-pandoc-placetable-0.5.1.drv' failed with exit code 1
Maintainer information:
cc @unode (created the pull request that introduced the error)
cc @peti (merged the request)
Thank you!
@durgaBahadur Thanks for reporting this.
The problem here is that pandoc-placetable conditionally includes a dependency on pandoc when the inlineMarkdown flag is enabled:
Unfortunately cabal2nix is not smart enough to pick this up.
@durgaBahadur Could you send a PR to cabal2nix forcing pandoc-placetable to have a dependency on pandoc?
You should be able to add it this list:
It should look something like this:
(("pandoc-placetable", set (libraryDepends . haskell . contains (self "pandoc")) True)
I didn't actually try compiling this, so you may have to play around with it.
Also, there is the possibility that when you send the PR, @peti will tell you it should actually be solved differently.
```
In the original pull request, pandoc was added to executableHaskellDepends.
I take it this isn't enough?
Pull request opened.
In the original pull request, pandoc was added to executableHaskellDepends
@unode Which PR are you talking about?
In https://github.com/NixOS/cabal2nix/pull/426, it doesn't appear that pandoc is added to executableHaskellDepends.
@unode Which PR are you talking about?
https://github.com/NixOS/nixpkgs/pull/67464 but this didn't get merged, so not relevant actually.
Unfortunately
cabal2nixis not smart enough to pick this up.
cabal2nix should have been smart enough, but wasn't due to a strange design decision in Cabal. I've pushed a fix in https://github.com/NixOS/cabal2nix/commit/650d5300c6bb5632bbab6fcb2d939fb476e469c5 and re-generated the package set with that version. I believe that the package should compile fine now, but couldn't actually test it because the current master branch has no binaries for ghc right now and thus compiling pandoc-placetable would take a looong time.
@unode @durgaBahadur It looks like pandoc-placetable is now getting generated correctly in pkgs/development/haskell-modules/hackage-packages.nix thanks to the fix from peti.
However, it is still marked broken. Could you send a PR marking it unbroken?
Here's a video explaining how to do this:
https://discourse.nixos.org/t/video-tutorial-how-to-fix-broken-haskell-packages-in-nix/3968
Installation works fine now.
Most helpful comment
cabal2nixshould have been smart enough, but wasn't due to a strange design decision inCabal. I've pushed a fix in https://github.com/NixOS/cabal2nix/commit/650d5300c6bb5632bbab6fcb2d939fb476e469c5 and re-generated the package set with that version. I believe that the package should compile fine now, but couldn't actually test it because the currentmasterbranch has no binaries forghcright now and thus compilingpandoc-placetablewould take a looong time.