Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jammy is not compatible with GHC versions <= 8.8 #729

Closed
BinderDavid opened this issue Jun 7, 2024 · 3 comments · Fixed by #730
Closed

Jammy is not compatible with GHC versions <= 8.8 #729

BinderDavid opened this issue Jun 7, 2024 · 3 comments · Fixed by #730

Comments

@BinderDavid
Copy link

I just used the current version from master to generate a new CI config for ghc-events in this pull request: haskell/ghc-events#105

The generated CI configuration doesn't seem to work for GHC versions <= 8.8. The build failure in the logs looks like this:

E: The repository 'https://ppa.launchpadcontent.net/hvr/ghc/ubuntu jammy Release' does not have a Release file.
Repository: 'deb https://ppa.launchpadcontent.net/hvr/ghc/ubuntu/ jammy main'
@phadej
Copy link
Collaborator

phadej commented Jun 7, 2024

I'm confused. The haskell-ci uses ghcup by default on jammy, see e.g. https://github.com/haskell-unordered-containers/hashable/blob/7837d1d54799a03794d0868cff49f99663048256/.github/workflows/haskell-ci.yml which doesn't has any particular configuration related which installed method to use.

In particular, when distribution is jammy, we force to use ghcup for all fjobs:

| cfgUbuntu cfg >= Jammy = cfg { cfgGhcupJobs = anyVersion }

As the linked issue moved to use a haskell-ci fork (so I cannot see what they did, why the issue failed), I'll close this as invalid if no further information is provided.

@BinderDavid
Copy link
Author

BinderDavid commented Jun 7, 2024

Sorry, I forgot that force-pushing on that branch prohibits you from seeing the last version.

Here are the steps to reproduce:

  • Use the haskell-ci binary compiled from the master branch of github.com/haskell-CI/haskell-ci/
  • Checkout the latest commit from the master-branch of github.com/haskell/ghc-events
  • run haskell-ci regenerate

This results in the following output on the command line:

No haskell-ci.sh, skipping bash regeneration
*INFO* Generating GitHub config for testing for GHC versions: 8.0.2 8.2.2 8.4.4 8.6.5 8.8.4 8.10.7 9.0.2 9.2.4 9.4.2 9.6.1 9.8.1

And the following diff:

--- a/.github/workflows/haskell-ci.yml
+++ b/.github/workflows/haskell-ci.yml
@@ -8,9 +8,9 @@
 #
 # For more information, see https://github.com/haskell-CI/haskell-ci
 #
-# version: 0.17.20231203
+# version: 0.19.20240514
 #
-# REGENDATA ("0.17.20231203",["github","ghc-events.cabal"])
+# REGENDATA ("0.19.20240514",["github","ghc-events.cabal"])
 #
 name: Haskell-CI
 on:
@@ -23,7 +23,7 @@ jobs:
     timeout-minutes:
       60
     container:
-      image: buildpack-deps:bionic
+      image: buildpack-deps:jammy
     continue-on-error: ${{ matrix.allow-failure }}
     strategy:
       matrix:
@@ -187,7 +187,7 @@ jobs:
           chmod a+x $HOME/.cabal/bin/cabal-plan
           cabal-plan --version
       - name: checkout
-        uses: actions/checkout@v3
+        uses: actions/checkout@v4
         with:
           path: source
       - name: initial cabal.project for sdist
@@ -215,7 +215,7 @@ jobs:
           if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "    ghc-options: -Werror=missing-methods" >> cabal.project ; fi
           cat >> cabal.project <<EOF
           EOF
-          $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(ghc-events)$/; }' >> cabal.project.local
+          $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(ghc-events)$/; }' >> cabal.project.local
           cat cabal.project
           cat cabal.project.local
       - name: dump install plan
@@ -223,7 +223,7 @@ jobs:
           $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
           cabal-plan
       - name: restore cache
-        uses: actions/cache/restore@v3
+        uses: actions/cache/restore@v4
         with:
           key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
           path: ~/.cabal/store
@@ -253,7 +253,7 @@ jobs:
           rm -f cabal.project.local
           $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
       - name: save cache
-        uses: actions/cache/save@v3
+        uses: actions/cache/save@v4
         if: always()
         with:
           key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}

The previous version of the script already used the setup-method: hvr-ppa option. Using haskell-ci regenerate then replaced the image by jammy, but didn't change the setup-method to ghcup. This leaves the regenerated build script in a state which doesn't work.

@phadej
Copy link
Collaborator

phadej commented Jun 7, 2024

Ok. I see, the bug is that the code i linked is not run if cabal.haskell-ci config file doesn't exist. If you add (even an empty cabal.haskell-ci file), the diff will have things like

@@ -61,49 +61,39 @@ jobs:
           - compiler: ghc-8.8.4
             compilerKind: ghc
             compilerVersion: 8.8.4
-            setup-method: hvr-ppa
+            setup-method: ghcup
             allow-failure: false

I have to investigate why the no-config file and config file case differs; but the "workaround" isn't too bad for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants