This is a dependency of cabal-install and builds by virtue of its
overrideScope. We also want to make sure it builds independently, so
that it doesn't get marked as broken at the very least.
GHC's cross build flavours disable the terminfo package, so it will
never be included if we are cross-compiling – setting it to null thus
breaks all builds depending on the package.
To fix this problem, we use the versioned attribute generated by
hackage2nix, just like we do for xhtml.
Closes#182785.
The xhtml library is only built as part of the GHC build process if GHC
is disabled. This means that no GHC cross compiler has xhtml bundled,
since haddock can't be built if GHC is a cross compiler (see relevant
notes in the GHC nix expressions). This means that all packages
depending on xhtml would currently fail to build when cross-compiled, as
haskellPackages would assume it'd be provided by GHC. This is fixed by
this commit.
pkgsStatic hits this case, so we test compilation of xhtml for these
package sets which will remind us to update the attribute name whenever
its version changes.
Luckily, all build failures where just related to type checking changes
in GHC 9.0 (and maybe base changes?), so we can just use GHC 8.10.7 with
the Stackage version of packages and keep Yi working. I feel like we
dodged a bullet here, as upstream maintenance doesn't seem to be too
proactive these days.
We need to manually simulate the following conditional in the cabal
file:
if impl(ghc >=9.0)
build-depends: ghc-prim
else
build-depends: hashable >=1.3.5.0 && <1.5
This means we only have to update the llvmPackages attribute in one
place now and should prevent situations like with 8.6.5 where different
versions would be used in the package set compared to the compiler
build.
Drop comments in the configuration-ghc-X.Y.x.nix files as well, since
LLVM version isn't tied to the compiler minor version at
all (e. g. 8.10.2 and 8.10.7 have different support ranges).
* no released version of hackage2nix does support distribution-nixpkgs yet.
* hackage-db 2.1.2 fixes an annoying bug introduced in 2.1.1 and also supports
Cabal 3.4: https://github.com/NixOS/cabal2nix/issues/501
Stackage Nighly recently upgraded their version of hackage-db from 2.1.0
to 2.1.1. 2.1.1 had a compatibility fix for Cabal 3.4 [1]. However it
did not increase the version bound on Cabal nor fails to compile with
Cabal 3.2, so Stackage was able to update it.
Unfortunately hackage-db with Cabal 3.2 causes observable issues [2]
in cabal2nix, so we need to downgrade it for all compilers that still
ship a Cabal version < 3.4.
Also ideally we should update the constraints for hackage-db 2.1.0 and
hackage-db 2.1.1 on hackage. See also [3].
[1]: https://github.com/peti/hackage-db/pull/12
[2]: https://github.com/NixOS/cabal2nix/issues/501
[3]: https://github.com/peti/hackage-db/pull/14
They are not an exposed part of haskellPackages per se, so we shouldn't
list them in nix-env. Additionally this should prevent the failed lldb
build from cluttering our jobset output.
Commit 1998b95adc “haskellPackages:
update default compiler from ghc 8.10.2 to version 8.10.3” broke Agda
because Agda.cabal incorrectly declares a transformers dependency only
for ghc < 8.10.3:
if impl(ghc >= 8.6.4) && impl(ghc < 8.10.3)
build-depends: transformers == 0.5.6.2
if impl(ghc >= 8.4) && impl(ghc < 8.6.4)
build-depends: transformers == 0.5.5.0
if impl(ghc < 8.4)
build-depends: transformers == 0.5.2.0
leading to this error:
src/full/Agda/Utils/Maybe.hs:13:1: error:
Could not load module ‘Control.Monad.Trans.Maybe’
It is a member of the hidden package ‘transformers-0.5.6.2’.
Perhaps you need to add ‘transformers’ to the build-depends in your .cabal file.
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
|
13 | import Control.Monad.Trans.Maybe
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Signed-off-by: Anders Kaseorg <andersk@mit.edu>