Open swt2c opened 11 months ago
I can replicate by:
cabal get clash-lib-1.8.1
cd clash-lib-1.8.1
cabal test
using:
> cabal --version
cabal-install version 3.8.1.0
compiled using version 3.8.1.0 of the Cabal library
> ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.4.7
> uname -a
Linux glanerbrug 6.6.1-1-default #1 SMP PREEMPT_DYNAMIC Thu Nov 9 05:27:56 UTC 2023 (1fcc265) x86_64 x86_64 x86_64 GNU/Linux
As a work-around we have to do:
cabal get clash-lib-1.8.1
cd clash-lib-1.8.1
cabal build --enable-tests --write-ghc-environment-files=always
cabal test
So the problem is that the created doctest
binary depends on the existence of a .ghc.environment.xyz
file to get a package database. Perhaps we can find a way to "hardcode" a package database into the generated test binary? @martijnbastiaan any ideas on that?
This is https://github.com/martijnbastiaan/doctest-parallel/issues/22.
I don't know of a way to get it from TemplateHaskell
. I'm more inclined to look at Cabal's new code-generators
feature (see this comment too).
As a work-around we have to do:
cabal get clash-lib-1.8.1 cd clash-lib-1.8.1 cabal build --enable-tests --write-ghc-environment-files=always cabal test
There isn't a way to use this workaround when doing a Setup.hs build, is there?
I got the same issue on GHC 9.2.
@swt2c In case you are still searching for a workaround, the Arch package manually creates that file like this: https://gitlab.archlinux.org/archlinux/packaging/packages/haskell-doctest-parallel/-/blob/main/PKGBUILD?ref_type=heads#L38-44
Note that you have to manually adjust the GHC version (it's 9.0.2 on Arch) and potentially need to install expac
(or replace that call with the version manually).
We are also reliant on a Setup.hs
build.
I'm trying to build clash-lib 1.8.1 on Debian with GHC 9.4.7. The build phase completes successfully, but when running the doctests test suite, I'm running into the below errors. There are lots more of them, all related to
MIN_VERSION_ghc
. Any ideas what might be going wrong?