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

Add GHC 9.6 CI to the 3.10 branch #8901

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
213 changes: 40 additions & 173 deletions .github/workflows/validate.yml
Copy link
Member Author

@Kleidukos Kleidukos May 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# This job needs an older ubuntu (16.04) cause
# the required old ghcs using the `-dyn` flavour
# are not installable from ppa/hvr in newer ones
# see https://github.com/haskell/cabal/issues/8011
container:
  image: phadej/ghc:8.8.4-xenial

@phadej I'm not sure I see a corresponding image in your dockerhub profile for 9.6.1-xenial. What can we do to remedy to this? Also, are you still willing to maintain such images?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, there will be no new images.

Copy link
Collaborator

@ulysses4ever ulysses4ever May 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there needs to be new images to achieve what it's supposed to achieve. Also, I don't think this part of the code should have been touched as a part of the backport.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to toy with it, I'm out of ideas personally :/

Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ on:
env:
# We choose a stable ghc version across all os's
# which will be used to do the next release
GHC_FOR_RELEASE: '9.2.3'
GHC_FOR_RELEASE: '9.6.1'
# Ideally we should use the version about to be released for hackage tests and benchmarks
GHC_FOR_SOLVER_BENCHMARKS: '9.2.3'
GHC_FOR_COMPLETE_HACKAGE_TESTS: '9.2.3'
GHC_FOR_SOLVER_BENCHMARKS: '9.6.1'
GHC_FOR_COMPLETE_HACKAGE_TESTS: '9.6.1'
COMMON_FLAGS: '-j 2 -v'

jobs:
Expand All @@ -38,7 +38,7 @@ jobs:
strategy:
matrix:
os: ["ubuntu-20.04", "macos-latest", "windows-latest"]
ghc: ["9.4.2", "9.2.3", "9.0.2", "8.10.7", "8.8.4", "8.6.5", "8.4.4"]
ghc: ["9.6.1", "9.4.4", "9.2.7", "9.0.2", "8.10.7", "8.8.4", "8.6.5", "8.4.4"]
exclude:
# corrupts GHA cache or the fabric of reality itself, see https://github.com/haskell/cabal/issues/8356
- os: "windows-latest"
Expand All @@ -57,35 +57,21 @@ jobs:

- uses: actions/checkout@v3

# See https://github.com/haskell/cabal/pull/8739
- name: Sudo chmod to permit ghcup to update its cache
run: |
if [[ "${{ runner.os }}" == "Linux" ]]; then
sudo ls -lah /usr/local/.ghcup/cache
sudo mkdir -p /usr/local/.ghcup/cache
sudo ls -lah /usr/local/.ghcup/cache
sudo chown -R $USER /usr/local/.ghcup
sudo chmod -R 777 /usr/local/.ghcup
fi
- uses: haskell/actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: '3.8.1.0'

# See the following link for a breakdown of the following step
# https://github.com/haskell/actions/issues/7#issuecomment-745697160
#
# See https://github.com/haskell/cabal/pull/8739 for why Windows is excluded
- if: ${{ runner.os != 'Windows' }}
uses: actions/cache@v3
- uses: actions/cache@v3
with:
# validate.sh uses a special build dir
path: |
${{ steps.setup-haskell.outputs.cabal-store }}
dist-*
key: ${{ runner.os }}-${{ matrix.ghc }}-20220419-${{ github.sha }}
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-20220419-
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }}
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-

- uses: haskell/actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: '3.10.1.0'


- name: Work around git problem https://bugs.launchpad.net/ubuntu/+source/git/+bug/1993586 (cabal PR #8546)
run: |
Expand All @@ -97,7 +83,7 @@ jobs:
- name: Install cabal-plan
run: |
cd $(mktemp -d)
cabal install cabal-plan --constraint='cabal-plan +exe'
cabal install cabal-plan --allow-newer="base" --constraint='cabal-plan +exe'
echo "$HOME/.cabal/bin" >> $GITHUB_PATH

# The tool is not essential to the rest of the test suite. If
Expand All @@ -120,9 +106,6 @@ jobs:
- name: Set validate inputs
run: |
FLAGS="${{ env.COMMON_FLAGS }}"
if [[ "${{ matrix.cli }}" == "false" ]]; then
FLAGS="$FLAGS --lib-only"
fi
if [[ ${{ matrix.ghc }} == ${{ env.GHC_FOR_SOLVER_BENCHMARKS }} ]]; then
FLAGS="$FLAGS --solver-benchmarks"
fi
Expand All @@ -131,6 +114,11 @@ jobs:
fi
echo "FLAGS=$FLAGS" >> $GITHUB_ENV

- name: Allow newer dependencies when built with latest GHC
if: ${{ matrix.ghc }} == '9.6.1'
run: |
echo "allow-newer: rere:base, rere:transformers" >> cabal.project.validate

- name: Validate print-config
run: sh validate.sh $FLAGS -s print-config

Expand All @@ -141,7 +129,7 @@ jobs:
run: sh validate.sh $FLAGS -s build

- name: Tar cabal head executable
if: matrix.cli != 'false' && matrix.ghc == env.GHC_FOR_RELEASE
if: matrix.ghc == env.GHC_FOR_RELEASE
run: |
CABAL_EXEC=$(cabal-plan list-bin --builddir=dist-newstyle-validate-ghc-${{ matrix.ghc }} cabal-install:exe:cabal)
# We have to tar the executable to preserve executable permissions
Expand All @@ -163,7 +151,7 @@ jobs:
# - Reuse it in the dogfooding job (although we could use the cached build dir)
# - Make it available in the workflow to make easier testing it locally
- name: Upload cabal-install executable to workflow artifacts
if: matrix.cli != 'false' && matrix.ghc == env.GHC_FOR_RELEASE
if: matrix.ghc == env.GHC_FOR_RELEASE
uses: actions/upload-artifact@v3
with:
name: cabal-${{ runner.os }}-${{ matrix.ghc }}
Expand All @@ -177,145 +165,19 @@ jobs:
run: sh validate.sh $FLAGS -s lib-tests

- name: Validate lib-suite
# Have to disable *-suite validation:
# - the [email protected] problem is tracked at https://github.com/haskell/cabal/issues/8858
# - but curently can't run it with GHC 9.6, tracking: https://github.com/haskell/cabal/issues/8883
if: (runner.os != 'Windows') || (matrix.ghc != '9.6.1')
run: sh validate.sh $FLAGS -s lib-suite

- name: Validate cli-tests
if: matrix.cli != 'false'
run: sh validate.sh $FLAGS -s cli-tests

- name: Validate cli-suite
if: matrix.cli != 'false'
run: sh validate.sh $FLAGS -s cli-suite

# The job below is a copy-paste of validate with the necessary tweaks
# to make all work with an upcoming GHC. Those tweaks include:
# - ghcup needs the prerelease channel activated
# - allow-newer for base libraries and Cabal* libraries
# - (sometimes) disabling some parts on Windows because it's hard to figure
# out why they fail
validate-prerelease:
# TODO: reenable when the next GHC prerelease appears
if: false

name: Validate ${{ matrix.os }} ghc-prerelease
runs-on: ${{ matrix.os }}
outputs:
GHC_FOR_RELEASE: ${{ format('["{0}"]', env.GHC_FOR_RELEASE) }}
strategy:
matrix:
os: ["ubuntu-20.04", "macos-latest", "windows-latest"]

steps:

- uses: actions/checkout@v3

# See https://github.com/haskell/cabal/pull/8739
- name: Sudo chmod to permit ghcup to update its cache
run: |
if [[ "${{ runner.os }}" == "Linux" ]]; then
sudo ls -lah /usr/local/.ghcup/cache
sudo mkdir -p /usr/local/.ghcup/cache
sudo ls -lah /usr/local/.ghcup/cache
sudo chown -R $USER /usr/local/.ghcup
sudo chmod -R 777 /usr/local/.ghcup
fi

- name: ghcup
run: |
ghcup --version
ghcup config set cache true
ghcup config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml
ghcup install ghc --set 9.6.0.20230210
ghcup install cabal --set latest
ghc --version
cabal update

# See the following link for a breakdown of the following step
# https://github.com/haskell/actions/issues/7#issuecomment-745697160
#
# See https://github.com/haskell/cabal/pull/8739 for why Windows is excluded
- if: ${{ runner.os != 'Windows' }}
uses: actions/cache@v3
with:
# validate.sh uses a special build dir
path: |
${{ steps.setup-haskell.outputs.cabal-store }}
dist-*
key: ${{ runner.os }}-${{ matrix.ghc }}-20220419-${{ github.sha }}
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-20220419-

- name: Work around git problem https://bugs.launchpad.net/ubuntu/+source/git/+bug/1993586 (cabal PR #8546)
run: |
git config --global protocol.file.allow always

# The '+exe' constraint below is important, otherwise cabal-install
# might decide to build the library but not the executable which is
# what we need.
- name: Install cabal-plan
run: |
cd $(mktemp -d)
cabal install cabal-plan --constraint='cabal-plan +exe' --allow-newer
echo "$HOME/.cabal/bin" >> $GITHUB_PATH

# The tool is not essential to the rest of the test suite. If
# hackage-repo-tool is not present, any test that requires it will
# be skipped.
# We want to keep this in the loop but we don't want to fail if
# hackage-repo-tool breaks or fails to support a newer GHC version.
- name: Install hackage-repo-tool
continue-on-error: true
run: |
cd $(mktemp -d)
cabal install hackage-repo-tool

# Needed by cabal-testsuite/PackageTests/Configure/setup.test.hs
- name: Install Autotools
if: runner.os == 'macOS'
run: |
brew install automake

- name: Allow newer boot libraries
run: |
echo "allow-newer: base, template-haskell, ghc-prim, Cabal-syntax, Cabal-described, Cabal, cabal-install-solver, cabal-install" >> cabal.project.validate

- name: Set validate inputs
run: |
FLAGS="${{ env.COMMON_FLAGS }}"
if [[ "${{ matrix.cli }}" == "false" ]]; then
FLAGS="$FLAGS --lib-only"
fi
echo "FLAGS=$FLAGS" >> $GITHUB_ENV

- name: Validate print-config
run: sh validate.sh $FLAGS -s print-config

- name: Validate print-tool-versions
run: sh validate.sh $FLAGS -s print-tool-versions

- name: Validate build
run: sh validate.sh $FLAGS -s build

- name: Validate lib-tests
env:
# `rawSystemStdInOut reports text decoding errors`
# test does not find ghc without the full path in windows
GHCPATH: ${{ steps.setup-haskell.outputs.ghc-exe }}
run: sh validate.sh $FLAGS -s lib-tests

- name: Validate lib-suite
# see https://github.com/haskell/cabal/pull/8754#issuecomment-1435025848
# for discussion about the trouble on Windows
if: ${{ runner.os != 'Windows' }}
run: sh validate.sh $FLAGS -s lib-suite

- name: Validate cli-tests
if: matrix.cli != 'false'
run: sh validate.sh $FLAGS -s cli-tests

- name: Validate cli-suite
# see https://github.com/haskell/cabal/pull/8754#issuecomment-1435025848
# for discussion about the trouble on Windows
if: ( runner.os != 'Windows' ) && ( matrix.cli != 'false' )
# Have to disable *-suite validation, see above the comment for lib-suite
if: (runner.os != 'Windows') || (matrix.ghc != '9.6.1')
run: sh validate.sh $FLAGS -s cli-suite

validate-old-ghcs:
Expand All @@ -334,7 +196,7 @@ jobs:
# Newer ghc versions than 8.8.4 have to be installed with ghcup cause
# they are not available in ppa/hvr. The ghcup installation
# needs `sudo` which is not available in the xenial container
ghc: ["8.8.4"]
ghc: ["9.6.1"]
extra-ghc: ["7.10.3", "7.8.4", "7.6.3", "7.4.2", "7.2.2", "7.0.4"]

steps:
Expand All @@ -353,8 +215,8 @@ jobs:

- name: Install extra compiler
run: |
apt-get update
apt-get install -y ghc-${{ matrix.extra-ghc }}-dyn
sudo apt-get update
sudo apt-get install -y ghc-${{ matrix.extra-ghc }}-dyn

- uses: haskell/actions/setup@v2
id: setup-haskell
Expand All @@ -370,13 +232,13 @@ jobs:
path: |
${{ steps.setup-haskell.outputs.cabal-store }}
dist-*
key: ${{ runner.os }}-${{ matrix.ghc }}-20220419-${{ github.sha }}
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-20220419-
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }}
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-

- name: Install cabal-plan
run: |
cd $(mktemp -d)
cabal install cabal-plan --constraint='cabal-plan +exe'
cabal install cabal-plan --allow-newer="base" --constraint='cabal-plan +exe'
echo "$HOME/.cabal/bin" >> $GITHUB_PATH

- name: Validate build
Expand Down Expand Up @@ -424,7 +286,7 @@ jobs:
- name: Install cabal-plan
run: |
cd $(mktemp -d)
cabal install cabal-plan --constraint='cabal-plan +exe'
cabal install cabal-plan --allow-newer="base" --constraint='cabal-plan +exe'
echo "$HOME/.cabal/bin" >> $GITHUB_PATH

- name: Download cabal executable from workflow artifacts
Expand All @@ -439,6 +301,11 @@ jobs:
- name: print-config using cabal HEAD
run: sh validate.sh ${{ env.COMMON_FLAGS }} --with-cabal ./cabal-head/cabal -s print-config

- name: Allow newer dependencies when built with latest GHC
if: ${{ matrix.ghc }} == '9.6.1'
run: |
echo "allow-newer: rere:base, rere:transformers" >> cabal.project.validate

# We dont use cache to force a build with a fresh store dir and build dir
# This way we check cabal can build all its dependencies
- name: Build using cabal HEAD
Expand Down
4 changes: 2 additions & 2 deletions Cabal-tests/Cabal-tests.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ test-suite parser-tests
, tasty-golden >=2.3.1.1 && <2.4
, tasty-hunit
, tasty-quickcheck
, tree-diff >=0.1 && <0.3
, tree-diff >=0.1 && <0.4

ghc-options: -Wall
default-language: Haskell2010
Expand Down Expand Up @@ -161,7 +161,7 @@ test-suite hackage-tests
, optparse-applicative >=0.13.2.0 && <0.17
, stm >=2.4.5.0 && <2.6
, tar >=0.5.0.3 && <0.6
, tree-diff >=0.1 && <0.3
, tree-diff >=0.1 && <0.4

ghc-options: -Wall -rtsopts -threaded
default-extensions: CPP
Expand Down
2 changes: 1 addition & 1 deletion Cabal-tree-diff/Cabal-tree-diff.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ library
, base
, Cabal-syntax ^>=3.10.0.0
, Cabal ^>=3.10.0.0
, tree-diff ^>=0.1 || ^>=0.2
, tree-diff ^>=0.1 || ^>=0.3

exposed-modules: Data.TreeDiff.Instances.Cabal
other-modules:
Expand Down
4 changes: 2 additions & 2 deletions cabal-install-solver/cabal-install-solver.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ library

build-depends:
, array >=0.4 && <0.6
, base >=4.10 && <4.18
, base >=4.10 && <4.19
, bytestring >=0.10.6.0 && <0.12
, Cabal ^>=3.10
, Cabal-syntax ^>=3.10
Expand Down Expand Up @@ -138,7 +138,7 @@ Test-Suite unit-tests
UnitTests.Distribution.Solver.Modular.MessageUtils

build-depends:
, base >= 4.10 && <4.18
, base >= 4.10 && <4.19
, Cabal
, Cabal-syntax
, cabal-install-solver
Expand Down
2 changes: 1 addition & 1 deletion cabal-install/cabal-install.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ common warnings
ghc-options: -Wunused-packages

common base-dep
build-depends: base >=4.10 && <4.18
build-depends: base >=4.10 && <4.19

common cabal-dep
build-depends: Cabal ^>=3.10
Expand Down
Loading