From ac23235050bb6689078d9d4c15bcf93eddeff828 Mon Sep 17 00:00:00 2001 From: Ryan Scott Date: Tue, 10 Dec 2024 09:06:53 -0500 Subject: [PATCH] CI: Work around cabal issues This adds a Haskell-CI patch file containing workarounds for the following `cabal` issues when building with `head.hackage` + GHC 9.12: * https://github.com/haskell/cabal/issues/6522: Remove the use of `head.hackage.ghc.haskell.org:override` in the `cabal` configuration file so that `ghc-paths`' custom `Setup.hs` script can find a suitable `Cabal` version. * https://github.com/haskell/cabal/issues/10500: Remove the use of `allow-newer: *:Cabal *:Cabal-syntax` in the generated `cabal.project` file. We should be able to remove this patch file once we no longer depend on the use of `head.hackage`, as well as when Haskell-CI upgrades to use `cabal-install-3.14`. --- .github/workflows/haskell-ci.yml | 4 ++-- cabal.haskell-ci | 3 +++ github.yml.patch | 22 ++++++++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 github.yml.patch diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 55fb206b..c9db9096 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -184,7 +184,7 @@ jobs: 26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329 f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89 key-threshold: 3 - active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override + active-repositories: hackage.haskell.org EOF fi cat >> $CABAL_CONFIG <> cabal.project + echo "$($HCPKG list --simple-output | xargs -d' ' -n 1 | grep -v "^Cabal" | sed -E 's/([a-zA-Z-]+)-[0-9.]+/allow\-newer\: *:\1/g')" >> cabal.project fi $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(Cabal|Cabal-syntax|singletons|singletons-base|singletons-base-code-generator|singletons-th)$/; }' >> cabal.project.local cat cabal.project diff --git a/cabal.haskell-ci b/cabal.haskell-ci index b9e157b4..23161777 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -6,3 +6,6 @@ jobs-selection: any haddock-components: libs -- Needed to avoid https://github.com/haskell/cabal/issues/9917 installed: +all -Cabal -Cabal-syntax +-- Needed to work around https://github.com/haskell/cabal/issues/6522 and +-- https://github.com/haskell/cabal/issues/10500 +github-patches: github.yml.patch diff --git a/github.yml.patch b/github.yml.patch new file mode 100644 index 00000000..38a9a6bc --- /dev/null +++ b/github.yml.patch @@ -0,0 +1,22 @@ +diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml +index 55fb206..c9db909 100644 +--- a/.github/workflows/haskell-ci.yml ++++ b/.github/workflows/haskell-ci.yml +@@ -184,7 +184,7 @@ jobs: + 26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329 + f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89 + key-threshold: 3 +- active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override ++ active-repositories: hackage.haskell.org + EOF + fi + cat >> $CABAL_CONFIG <> cabal.project ++ echo "$($HCPKG list --simple-output | xargs -d' ' -n 1 | grep -v "^Cabal" | sed -E 's/([a-zA-Z-]+)-[0-9.]+/allow\-newer\: *:\1/g')" >> cabal.project + fi + $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(Cabal|Cabal-syntax|singletons|singletons-base|singletons-base-code-generator|singletons-th)$/; }' >> cabal.project.local + cat cabal.project