ekmett / distributive

Dual Traversable
http://hackage.haskell.org/package/distributive
Other
41 stars 25 forks source link

distributive-0.5.3 doesn't build on ghc-8.4.1 with stack-1.6.5 #44

Closed recursion-ninja closed 6 years ago

recursion-ninja commented 6 years ago

See the incomprehensible build error below:

distributive-0.5.3: configure
Progress: 1/17
--  While building custom Setup.hs for package distributive-0.5.3 using:
      /tmp/stack6220/distributive-0.5.3/.stack-work/dist/x86_64-linux-nopie/Cabal-2.2.0.0/setup/setup --builddir=.stack-work/dist/x86_64-linux-nopie/Cabal-2.2.0.0 configure --with-ghc=/home/stackuser/.stack/programs/x86_64-linux/ghc-nopie-8.4.1/bin/ghc --with-ghc-pkg=/home/stackuser/.stack/programs/x86_64-linux/ghc-nopie-8.4.1/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/stackuser/.stack/snapshots/x86_64-linux-nopie/lts-11.5/8.4.1/pkgdb --libdir=/home/stackuser/.stack/snapshots/x86_64-linux-nopie/lts-11.5/8.4.1/lib --bindir=/home/stackuser/.stack/snapshots/x86_64-linux-nopie/lts-11.5/8.4.1/bin --datadir=/home/stackuser/.stack/snapshots/x86_64-linux-nopie/lts-11.5/8.4.1/share --libexecdir=/home/stackuser/.stack/snapshots/x86_64-linux-nopie/lts-11.5/8.4.1/libexec --sysconfdir=/home/stackuser/.stack/snapshots/x86_64-linux-nopie/lts-11.5/8.4.1/etc --docdir=/home/stackuser/.stack/snapshots/x86_64-linux-nopie/lts-11.5/8.4.1/doc/distributive-0.5.3 --htmldir=/home/stackuser/.stack/snapshots/x86_64-linux-nopie/lts-11.5/8.4.1/doc/distributive-0.5.3 --haddockdir=/home/stackuser/.stack/snapshots/x86_64-linux-nopie/lts-11.5/8.4.1/doc/distributive-0.5.3 --dependency=Cabal=Cabal-2.0.1.1-9pQUxuTSyRnJ2EkHvaEEuD --dependency=base=base-4.11.0.0 --dependency=base-orphans=base-orphans-0.7-BhQxOsSKeJK5cMS8lLemv --dependency=cabal-doctest=cabal-doctest-1.0.6-6gUTNdRMGSz5CXLFNXHGgV --dependency=tagged=tagged-0.8.5-371pj6rkHKSEEI7NF5OoiS --dependency=transformers=transformers-0.5.5.0 --dependency=transformers-compat=transformers-compat-0.5.1.4-HHZVQ6XWexxI2uS4d7h1kE -fsemigroups -ftagged --ghc-options -j --ghc-options -fdiagnostics-color=always --exact-configuration
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/stackuser/Code/PCG/.stack-work/logs/distributive-0.5.3.log

    [1 of 2] Compiling Main             ( /tmp/stack6220/distributive-0.5.3/Setup.lhs, /tmp/stack6220/distributive-0.5.3/.stack-work/dist/x86_64-linux-nopie/Cabal-2.2.0.0/setup/Main.o )
    [2 of 2] Compiling StackSetupShim   ( /home/stackuser/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /tmp/stack6220/distributive-0.5.3/.stack-work/dist/x86_64-linux-nopie/Cabal-2.2.0.0/setup/StackSetupShim.o )
    Linking /tmp/stack6220/distributive-0.5.3/.stack-work/dist/x86_64-linux-nopie/Cabal-2.2.0.0/setup/setup ...
    Configuring distributive-0.5.3...
    setup: failed to parse output of 'ghc-pkg dump'

I'm guessing this has something to do with the custom Setup.hs. Is this necessary to build the package?

RyanGlScott commented 6 years ago

I'm afraid I've never seen this error before, so I can't speculate on what is going on here.

@phadej, have you seen this happen before?

recursion-ninja commented 6 years ago

You can replicate by:

git clone https://github.com/amnh/PCG/commit/88fed266bfc033641c0f76fa2e148e9ea1fd2217
cd PCG
make
phadej commented 6 years ago

Please try with stack-1.7.0.1 https://github.com/commercialhaskell/stack/releases/tag/v1.7.0.1, I suspect there are old Cabal-2.0 (GHC-8.0 / stack-1.6.5) trying to read something produced by Cabal-2.2 (GHC-8.4)

Also you use:

LTS-11 which is GHC-8.0, so includes Cabal-2.0 - that's probably the cause, 1.6.5 might work too, if you add Cabal-2.2.0.1 to extra-deps.

recursion-ninja commented 6 years ago

I tried rebuilding the repository that depends on distributive-0.5.3 with nightly-2018-04-18 and stack v1.6.5 and that appears to have worked. distributive-0.5.3 didn't fail while the project dependencies were being built. I'm confused as to why switching the resolver from lts-11.5 to nightly-2018-04-18 would resolve this, given that the ghc-8.4.1 compiler was explicitly stated in the stack.yaml file in both cases.

Regardless, this isn't a problem with distributive-0.5.3. Rather it's a problem with stack's predictability, documentation, and user facing error messages.