Like https://github.com/commercialhaskell/stack/issues/4195 stack haddock fails with an error Error: While constructing the build plan, the following exceptions were encountered: ... when the resolver is lts-13.13 or lts-13.11, whose compiler version is GHC 8.6.3 or later.
stack new barcd barstack haddock (or stack --resolver=lts-13.11 haddock)Include any .yaml configuration if relevant.
stack haddock runs successfully to generate the document.
(Edit: replaced the command output with --verbose option)
> stack --resolver=lts-13.11 --verbose haddock
Version 1.9.3, Git revision 40cf7b37526b86d1676da82167ea8758a854953b (6211 commits) x86_64 hpack-0.31.1
2019-03-18 14:32:12.176841: [debug] Checking for project config at: C:\Users\yuji-yamamoto\Downloads\bar\stack.yaml
2019-03-18 14:32:12.176841: [debug] Loading project config file stack.yaml
2019-03-18 14:32:12.176841: [debug] Using resolver: lts-13.11 specified on command line
2019-03-18 14:32:12.176841: [debug] Decoding build plan from: C:\sr\build-plan\lts-13.11.yaml
2019-03-18 14:32:12.176841: [debug] Trying to decode C:\sr\build-plan-cache\lts-13.11.cache
2019-03-18 14:32:12.192468: [debug] Success decoding C:\sr\build-plan-cache\lts-13.11.cache
2019-03-18 14:32:12.192468: [debug] Potential GHC builds: standard
2019-03-18 14:32:12.192468: [debug] Found already installed GHC builds: standard
2019-03-18 14:32:12.192468: [debug] Asking GHC for its version
2019-03-18 14:32:12.192468: [debug] Getting Cabal package version
2019-03-18 14:32:12.208087: [debug] Getting global package database location
2019-03-18 14:32:12.208087: [debug] Run process: C:\Users\yuji-yamamoto\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.4\bin\ghc.EXE --numeric-version
2019-03-18 14:32:12.208087: [debug] Run process: C:\Users\yuji-yamamoto\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.4\bin\ghc-pkg.EXE --no-user-package-db field --simple-output Cabal version
2019-03-18 14:32:12.223715: [debug] Run process: C:\Users\yuji-yamamoto\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.4\bin\ghc-pkg.EXE --no-user-package-db list --global
2019-03-18 14:32:12.239336: [debug] Process finished in 41ms: C:\Users\yuji-yamamoto\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.4\bin\ghc.EXE --numeric-version
2019-03-18 14:32:12.239336: [debug] GHC version is: ghc-8.6.4
2019-03-18 14:32:12.270569: [debug] Process finished in 44ms: C:\Users\yuji-yamamoto\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.4\bin\ghc-pkg.EXE --no-user-package-db list --global
2019-03-18 14:32:12.288560: [debug] Process finished in 69ms: C:\Users\yuji-yamamoto\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.4\bin\ghc-pkg.EXE --no-user-package-db field --simple-output Cabal version
2019-03-18 14:32:12.288560: [debug] Resolving package entries
2019-03-18 14:32:12.288560: [debug] Trying to decode C:\sr\loaded-snapshot-cache\x86_64-windows\ghc-8.6.4\lts-13.11.cache
2019-03-18 14:32:12.319814: [debug] Success decoding C:\sr\loaded-snapshot-cache\x86_64-windows\ghc-8.6.4\lts-13.11.cache
2019-03-18 14:32:12.319814: [debug] Starting to execute command inside EnvConfig
2019-03-18 14:32:12.319814: [debug] Parsing the targets
2019-03-18 14:32:12.319814: [debug] Running hpack on C:\Users\yuji-yamamoto\Downloads\bar\package.yaml
2019-03-18 14:32:12.319814: [debug] hpack output unchanged in C:\Users\yuji-yamamoto\Downloads\bar\bar.cabal
2019-03-18 14:32:12.335440: [debug] Start: getPackageFiles C:\Users\yuji-yamamoto\Downloads\bar\bar.cabal
2019-03-18 14:32:12.351063: [debug] Finished in 9ms: getPackageFiles C:\Users\yuji-yamamoto\Downloads\bar\bar.cabal
2019-03-18 14:32:12.351063: [debug] Exception ignored when attempting to load C:\Users\yuji-yamamoto\Downloads\bar\.stack-work\dist\e626a42b\stack-build-caches\lib: C:\Users\yuji-yamamoto\Downloads\bar\.stack-work\dist\e626a42b\stack-build-caches\lib: openBinaryFile: does not exist (No such file or directory)
2019-03-18 14:32:12.351063: [debug] Exception ignored when attempting to load C:\Users\yuji-yamamoto\Downloads\bar\.stack-work\dist\e626a42b\stack-build-caches\exe-bar-exe: C:\Users\yuji-yamamoto\Downloads\bar\.stack-work\dist\e626a42b\stack-build-caches\exe-bar-exe: openBinaryFile: does not exist (No such file or directory)
2019-03-18 14:32:12.351063: [debug] Finding out which packages are already installed
2019-03-18 14:32:12.351063: [debug] Trying to decode C:\Users\yuji-yamamoto\Downloads\bar\.stack-work\installed-cache.bin
2019-03-18 14:32:12.351063: [debug] Success decoding C:\Users\yuji-yamamoto\Downloads\bar\.stack-work\installed-cache.bin
2019-03-18 14:32:12.351063: [debug] Run process: C:\Users\yuji-yamamoto\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.4\bin\ghc-pkg.EXE --global --no-user-package-db dump --expand-pkgroot
2019-03-18 14:32:12.434716: [debug] Process finished in 69ms: C:\Users\yuji-yamamoto\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.4\bin\ghc-pkg.EXE --global --no-user-package-db dump --expand-pkgroot
2019-03-18 14:32:12.436744: [debug] Ignoring package Win32 due to it needing haddocks.
2019-03-18 14:32:12.436744: [debug] Ignoring package transformers due to it needing haddocks.
2019-03-18 14:32:12.437758: [debug] Ignoring package time due to it needing haddocks.
2019-03-18 14:32:12.437758: [debug] Ignoring package text due to it needing haddocks.
2019-03-18 14:32:12.438771: [debug] Ignoring package template-haskell due to it needing haddocks.
2019-03-18 14:32:12.439785: [debug] Ignoring package stm due to it needing haddocks.
2019-03-18 14:32:12.439785: [debug] Ignoring package process due to it needing haddocks.
2019-03-18 14:32:12.440800: [debug] Ignoring package pretty due to it needing haddocks.
2019-03-18 14:32:12.441813: [debug] Ignoring package parsec due to it needing haddocks.
2019-03-18 14:32:12.441813: [debug] Ignoring package mtl due to it needing haddocks.
2019-03-18 14:32:12.442824: [debug] Ignoring package libiserv due to it needing haddocks.
2019-03-18 14:32:12.443838: [debug] Ignoring package integer-gmp due to it needing haddocks.
2019-03-18 14:32:12.443838: [debug] Ignoring package hpc due to it needing haddocks.
2019-03-18 14:32:12.444851: [debug] Ignoring package haskeline due to it needing haddocks.
2019-03-18 14:32:12.444851: [debug] Ignoring package ghci due to it needing haddocks.
2019-03-18 14:32:12.445863: [debug] Ignoring package ghc-prim due to it needing haddocks.
2019-03-18 14:32:12.446876: [debug] Ignoring package ghc-heap due to it needing haddocks.
2019-03-18 14:32:12.446876: [debug] Ignoring package ghc-compact due to it needing haddocks.
2019-03-18 14:32:12.447919: [debug] Ignoring package ghc-boot-th due to it needing haddocks.
2019-03-18 14:32:12.448927: [debug] Ignoring package ghc-boot due to it needing haddocks.
2019-03-18 14:32:12.448927: [debug] Ignoring package ghc due to it needing haddocks.
2019-03-18 14:32:12.448927: [debug] Ignoring package filepath due to it needing haddocks.
2019-03-18 14:32:12.448927: [debug] Ignoring package directory due to it needing haddocks.
2019-03-18 14:32:12.448927: [debug] Ignoring package deepseq due to it needing haddocks.
2019-03-18 14:32:12.448927: [debug] Ignoring package containers due to it needing haddocks.
2019-03-18 14:32:12.448927: [debug] Ignoring package Cabal due to it needing haddocks.
2019-03-18 14:32:12.448927: [debug] Ignoring package bytestring due to it needing haddocks.
2019-03-18 14:32:12.448927: [debug] Ignoring package binary due to it needing haddocks.
2019-03-18 14:32:12.448927: [debug] Ignoring package base due to it needing haddocks.
2019-03-18 14:32:12.448927: [debug] Ignoring package array due to it needing haddocks.
2019-03-18 14:32:12.448927: [debug] Run process: C:\Users\yuji-yamamoto\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.4\bin\ghc-pkg.EXE --user --no-user-package-db --package-db C:\sr\snapshots\ff388501\pkgdb dump --expand-pkgroot
2019-03-18 14:32:12.513323: [debug] Process finished in 58ms: C:\Users\yuji-yamamoto\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.4\bin\ghc-pkg.EXE --user --no-user-package-db --package-db C:\sr\snapshots\ff388501\pkgdb dump --expand-pkgroot
2019-03-18 14:32:12.513323: [debug] Run process: C:\Users\yuji-yamamoto\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.4\bin\ghc-pkg.EXE --user --no-user-package-db --package-db C:\Users\yuji-yamamoto\Downloads\bar\.stack-work\install\a3f23259\pkgdb dump --expand-pkgroot
2019-03-18 14:32:12.572897: [debug] Process finished in 57ms: C:\Users\yuji-yamamoto\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.4\bin\ghc-pkg.EXE --user --no-user-package-db --package-db C:\Users\yuji-yamamoto\Downloads\bar\.stack-work\install\a3f23259\pkgdb dump --expand-pkgroot
2019-03-18 14:32:12.572897: [debug] Encoding C:\Users\yuji-yamamoto\Downloads\bar\.stack-work\installed-cache.bin
2019-03-18 14:32:12.572897: [debug] Finished writing C:\Users\yuji-yamamoto\Downloads\bar\.stack-work\installed-cache.bin
2019-03-18 14:32:12.572897: [debug] Constructing the build plan
2019-03-18 14:32:12.572897: [debug] Trying to decode C:\sr\indices\Hackage\01-index.cache
2019-03-18 14:32:12.713578: [debug] Success decoding C:\sr\indices\Hackage\01-index.cache
2019-03-18 14:32:12.729156: [error]
Error: While constructing the build plan, the following exceptions were encountered:
In the dependencies for bar-0.1.0.0:
base must match >=4.7 && <5, but the stack configuration has no specified version (latest
matching version is 4.12.0.0)
needed since bar is a build target.
Some different approaches to resolving this:
* Consider trying 'stack solver', which uses the cabal-install solver to attempt to find some
working build configuration. This can be convenient when dealing with many complicated
constraint errors, but results may be unpredictable.
* Build requires unattainable version of base. Since base is a part of GHC, you most likely need
to use a different GHC version with the matching base.
Plan construction failed.
> stack --version
Version 1.9.3, Git revision 40cf7b37526b86d1676da82167ea8758a854953b (6211 commits) x86_64 hpack-0.31.1
stack upgrade. Originally from ChocolateyI think there's a problem with the Windows build of GHC 8.6.4, which I noticed on some of my CI jobs. It seems that it does not ship with the haddock.exe executable or, apparently, the Haddocks for these packages. That should probably be filed upstream with GHC.
In the meanwhile, can you confirm if stack haddock --no-haddock-deps works?
Looks like this is a known upstream issue already:
In the meanwhile, can you confirm if stack haddock --no-haddock-deps works?
The error message chaged!
> stack haddock --no-haddock-deps
Building all executables for `bar' once. After a successful build of all of them, only specified executables will be rebuilt.
bar-0.1.0.0: configure (lib + exe)
Configuring bar-0.1.0.0...
bar-0.1.0.0: build (lib + exe)
Preprocessing library for bar-0.1.0.0..
Building library for bar-0.1.0.0..
[1 of 2] Compiling Lib ( src\Lib.hs, .stack-work\dist\e626a42b\build\Lib.o )
[2 of 2] Compiling Paths_bar ( .stack-work\dist\e626a42b\build\autogen\Paths_bar.hs, .stack-work\dist\e626a42b\build\Paths_bar.o )
Preprocessing executable 'bar-exe' for bar-0.1.0.0..
Building executable 'bar-exe' for bar-0.1.0.0..
[1 of 2] Compiling Main ( app\Main.hs, .stack-work\dist\e626a42b\build\bar-exe\bar-exe-tmp\Main.o )
[2 of 2] Compiling Paths_bar ( .stack-work\dist\e626a42b\build\bar-exe\autogen\Paths_bar.hs, .stack-work\dist\e626a42b\build\bar-exe\bar-exe-tmp\Paths_bar.o )
Linking .stack-work\dist\e626a42b\build\bar-exe\bar-exe.exe ...
bar-0.1.0.0: haddock
Cabal-simple_Z6RU0evB_2.4.0.1_ghc-8.6.4.exe: Haddock's internal GHC version
must match the configured GHC version.
The GHC version is 8.6.4 but haddock is using GHC version 8.6.2
-- While building package bar-0.1.0.0 using:
C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.4.0.1_ghc-8.6.4.exe --builddir=.stack-work\dist\e626a42b haddock --html --hoogle --html-location=../$pkg-$version/ --haddock-option=--hyperlinked-source --haddock-option=--quickjump
Process exited with code: ExitFailure 1
This is the same upstream issue: GHC 8.6.4 on Windows is simply not providing a working haddock.exe.
So should I close this now? Or close after fixing the GHC's bug?
It's better to close now, thanks!
Most helpful comment
Looks like this is a known upstream issue already: