haskell.packages.*.Cabal-syntax: expose dummy packages for GHC < 9.4

Before Cabal >= 3.8, Cabal-syntax did not exist, but there is a dummy
package Cabal-syntax-3.6.0.0 which can be used to prevent the constraint
solver from picking mutually incompatible versions of Cabal and
Cabal-syntax. Since we are now solving flags with Cabal >= 3.8, many
packages have a dependency on Cabal-syntax they did not have before,
requiring us to have a matching attribute in every package set. Using
the dummy package is the safest solution, although it is not required in
every case.

Fixes eval of jailbreak-cabal for GHC < 9.4.
This commit is contained in:
sternenseemann 2023-07-01 13:10:07 +02:00
parent 20d2845ce6
commit 4c2f247e11
7 changed files with 32 additions and 3 deletions

View file

@ -48,6 +48,9 @@ self: super: {
# still the case when updating: https://gitlab.haskell.org/ghc/ghc/-/blob/0198841877f6f04269d6050892b98b5c3807ce4c/ghc.mk#L463
xhtml = if self.ghc.hasHaddock or true then null else self.xhtml_3000_2_2_1;
# Need the Cabal-syntax-3.6.0.0 fake package for Cabal < 3.8 to allow callPackage and the constraint solver to work
Cabal-syntax = self.Cabal-syntax_3_6_0_0;
# Additionally depends on OneTuple for GHC < 9.0
base-compat-batteries = addBuildDepend self.OneTuple super.base-compat-batteries;

View file

@ -47,8 +47,11 @@ self: super: {
# still the case when updating: https://gitlab.haskell.org/ghc/ghc/-/blob/0198841877f6f04269d6050892b98b5c3807ce4c/ghc.mk#L463
xhtml = if self.ghc.hasHaddock or true then null else self.xhtml_3000_2_2_1;
# Need the Cabal-syntax-3.6.0.0 fake package for Cabal < 3.8 to allow callPackage and the constraint solver to work
Cabal-syntax = self.Cabal-syntax_3_6_0_0;
# Needs Cabal 3.0.x.
jailbreak-cabal = super.jailbreak-cabal.override { Cabal = self.Cabal_3_2_1_0; };
jailbreak-cabal = super.jailbreak-cabal.overrideScope (cself: _: { Cabal = cself.Cabal_3_2_1_0; });
# https://github.com/tibbe/unordered-containers/issues/214
unordered-containers = dontCheck super.unordered-containers;

View file

@ -47,6 +47,9 @@ self: super: {
# still the case when updating: https://gitlab.haskell.org/ghc/ghc/-/blob/0198841877f6f04269d6050892b98b5c3807ce4c/ghc.mk#L463
xhtml = if self.ghc.hasHaddock or true then null else self.xhtml_3000_2_2_1;
# Need the Cabal-syntax-3.6.0.0 fake package for Cabal < 3.8 to allow callPackage and the constraint solver to work
Cabal-syntax = self.Cabal-syntax_3_6_0_0;
# GHC 8.8.x can build haddock version 2.23.*
haddock = self.haddock_2_23_1;
haddock-api = self.haddock-api_2_23_1;

View file

@ -49,6 +49,9 @@ self: super: {
# still the case when updating: https://gitlab.haskell.org/ghc/ghc/-/blob/0198841877f6f04269d6050892b98b5c3807ce4c/ghc.mk#L463
xhtml = if self.ghc.hasHaddock or true then null else self.xhtml_3000_2_2_1;
# Need the Cabal-syntax-3.6.0.0 fake package for Cabal < 3.8 to allow callPackage and the constraint solver to work
Cabal-syntax = self.Cabal-syntax_3_6_0_0;
# Jailbreaks & Version Updates
# This `doJailbreak` can be removed once the following PR is released to Hackage:

View file

@ -49,6 +49,9 @@ self: super: {
# still the case when updating: https://gitlab.haskell.org/ghc/ghc/-/blob/0198841877f6f04269d6050892b98b5c3807ce4c/ghc.mk#L463
xhtml = if self.ghc.hasHaddock or true then null else self.xhtml_3000_2_2_1;
# Need the Cabal-syntax-3.6.0.0 fake package for Cabal < 3.8 to allow callPackage and the constraint solver to work
Cabal-syntax = self.Cabal-syntax_3_6_0_0;
# weeder == 2.5.* requires GHC 9.4
weeder = doDistribute self.weeder_2_4_1;

View file

@ -57,8 +57,9 @@ default-package-overrides:
- lsp-test == 0.14.*
extra-packages:
- Cabal == 3.2.* # required as newer version on ghc 8.6 and 8.8
- Cabal == 3.6.* # required as newer version on ghc 8.10 and 9.0
- Cabal-syntax == 3.6.* # Dummy package that ensures packages depending on Cabal-syntax can work for Cabal < 3.8
- Cabal == 3.2.*
- Cabal == 3.6.*
- Cabal-syntax == 3.10.* # newest version required for cabal-install and other packages
- cachix < 1.4 # 2023-04-02: cachix 1.4{,.1} have known on multi-user Nix systems
- directory == 1.3.7.* # required to build cabal-install 3.10.* with GHC 9.2

View file

@ -2861,6 +2861,19 @@ self: {
broken = true;
}) {};
"Cabal-syntax_3_6_0_0" = callPackage
({ mkDerivation, Cabal }:
mkDerivation {
pname = "Cabal-syntax";
version = "3.6.0.0";
sha256 = "0lcj4g55sj5iv727g7k57pscgyj0fx3smwapm1gmd5qkc3yfa9fa";
libraryHaskellDepends = [ Cabal ];
doHaddock = false;
description = "A library for working with .cabal files";
license = lib.licenses.bsd3;
hydraPlatforms = lib.platforms.none;
}) {};
"Cabal-syntax_3_10_1_0" = callPackage
({ mkDerivation, array, base, binary, bytestring, containers
, deepseq, directory, filepath, mtl, parsec, pretty, text, time