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

GHC 9.6.1 Support #124

Merged
merged 15 commits into from
Mar 20, 2023
Merged
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
41 changes: 16 additions & 25 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.15.20221225
# version: 0.15.20230312
#
# REGENDATA ("0.15.20221225",["github","ghc-exactprint.cabal","--ghcup-jobs"])
# REGENDATA ("0.15.20230312",["github","ghc-exactprint.cabal","--ghcup-jobs"])
#
name: Haskell-CI
on:
Expand All @@ -28,24 +28,9 @@ jobs:
strategy:
matrix:
include:
- compiler: ghc-9.4.4
- compiler: ghc-9.6.1
compilerKind: ghc
compilerVersion: 9.4.4
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.3
compilerKind: ghc
compilerVersion: 9.4.3
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.2
compilerKind: ghc
compilerVersion: 9.4.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.1
compilerKind: ghc
compilerVersion: 9.4.1
compilerVersion: 9.6.1
setup-method: ghcup
allow-failure: false
fail-fast: false
Expand All @@ -58,7 +43,7 @@ jobs:
curl -sL https://downloads.haskell.org/ghcup/0.1.18.0/x86_64-linux-ghcup-0.1.18.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -74,7 +59,7 @@ jobs:
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
Expand Down Expand Up @@ -131,7 +116,7 @@ jobs:
chmod a+x $HOME/.cabal/bin/cabal-plan
cabal-plan --version
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: source
- name: initial cabal.project for sdist
Expand Down Expand Up @@ -166,8 +151,8 @@ jobs:
run: |
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
cabal-plan
- name: cache
uses: actions/cache@v2
- name: restore cache
uses: actions/cache/restore@v3
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
Expand All @@ -191,8 +176,14 @@ jobs:
${CABAL} -vnormal check
- name: haddock
run: |
$CABAL v2-haddock --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
- name: unconstrained build
run: |
rm -f cabal.project.local
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
- name: save cache
uses: actions/cache/save@v3
if: always()
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ packages
*.yaml.lock
/tests/examples/ghc90-copied/
/tests/examples/ghc92-copied/
/tests/examples/ghc94-copied/
/tests/examples/ghc96-copied/
/hie.yaml
/hie.yaml.cbl
/hie.yaml.stack
Expand All @@ -57,3 +59,6 @@ packages
/cabal.project.local~3
/cpp-grep-cooked.txt
/cpp-grep-raw.txt
/failing-tests-for-ghc.txt
/failing-tests-for-ghc9.2.txt
/failures.txt
19 changes: 10 additions & 9 deletions NEW-GHC.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Change to the current GHC git repository (for the new version of GHC)

$ mkdir /tmp/ghc-tests
$ export DESTINATION=/tmp/ghc-tests
$ export PREVIOUS=ghc-9.0
$ export PREVIOUS=ghc-9.4

Sanity check

Expand All @@ -25,9 +25,10 @@ tests. Generally remove any `should_fail` directory.

find /tmp/ghc-tests/ -iname "should_fail" | xargs rm -fr

In the ghc-exactprint directory

$ mkdir tests/examples/ghc92-copied
$ find /tmp/ghc-tests -iname "*.hs" | xargs cp --backup=numbered -t ./tests/examples/ghc92-copied/
$ mkdir tests/examples/ghc96-copied
$ find /tmp/ghc-tests -iname "*.hs" | xargs cp --backup=numbered -t ./tests/examples/ghc96-copied/

Note: there is a pathological file `parsing001.hs`, which should be deleted

Expand All @@ -39,12 +40,12 @@ extension.
You may need to do `apt-get install mmv` first.
See http://manpages.ubuntu.com/manpages/zesty/en/man1/mmv.1.html

$ cd tests/examples/ghc92-copied
$ cd tests/examples/ghc96-copied
$ mmv "*.hs.~*~" "#1.#2.hs"

### cleanup whitespace in the files

$ cd tests/examples/ghc90-copied
$ cd tests/examples/ghc96-copied
$ ../../../emacs-ws-cleanup.sh


Expand All @@ -61,13 +62,13 @@ testDirs =
GHC80 -> ["ghc710", "ghc80"]
GHC82 -> ["ghc710", "ghc80", "ghc82"]
-- GHC84 -> ["ghc710", "ghc80", "ghc82", "ghc84", "ghc84-copied"]
GHC86 -> ["ghc86-copied"]
GHC96 -> ["ghc96-copied"]
-- GHC84 -> ["ghc84"
```

Also comment out the running of the `noAnnotationTests` and
`prettyRoundTripTests` in `mkTests`, otherwise the test *.out files
Also comment out the running of the `roundTripBalanceCommentsTests` and
`roundTripMakeDeltaTests` in `mkTests`, otherwise the test *.out files
will not be useful.

Run the tests, and move the failing test files over to the
`tests/examples/ghc90` directory
`tests/examples/ghc96` directory
12 changes: 11 additions & 1 deletion ROUNDTRIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ This will generate three additional executables
cabal exec prepare-hackage
```

OR, based on https://neilmitchell.blogspot.com/2018/11/downloading-all-of-hackage.html

```
mkdir hackage-roundtrip-work
cd hackage-roundtrip-work
cabal list --simple | cut -d' ' -f1 | sort | uniq | xargs -l cabal get

```

This will manage the `cabal` programme to call `cabal get` for each package on
hackage, into `./hackage-roundtrip-work`. It also untabifies each haskell file,
and deletes trailing whitespace.
Expand Down Expand Up @@ -54,6 +63,7 @@ TODO: change it to # *define
find . -iname "*.hs" -print0 | xargs -0 grep '__DATE__' --files-with-matches | xargs rm


Empty out the contents of ./roundtrip-config/knownfailures.txt


2. ./dist/build/roundtrip/roundtrip
Expand All @@ -65,7 +75,7 @@ TODO: change it to # *define
```
cabal exec roundtrip -- clean
cabal exec roundtrip -- ./hackage-roundtrip-work/* +RTS -N2
cabal exec roundtrip -- failures
cabal exec roundtrip -- failures +RTS -N2
cabal exec static
```

Expand Down
6 changes: 6 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
packages: .

-- source-repository-package
-- type: git
-- location: https://github.com/mitchellwrosen/fork--unix-compat.git
-- tag: f28060acd449643d267954647c1bb7c748c35fa9

-- repository head.hackage.ghc.haskell.org
-- url: https://ghc.gitlab.haskell.org/head.hackage/
-- secure: True
Expand All @@ -8,6 +13,7 @@ packages: .
-- f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
-- 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
-- 26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
-- active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override

-- optional-packages: packages/*/*.cabal

Expand Down
21 changes: 20 additions & 1 deletion configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,23 @@ rm -fr dist*

# cabal configure -fdev --enable-tests --with-compiler=ghc-9.4.2
# cabal configure -fdev --enable-tests --with-compiler=ghc-9.4.3
cabal configure -fdev --enable-tests --with-compiler=ghc-9.4.4
# cabal configure -fdev --enable-tests --with-compiler=ghc-9.4.4

# cabal configure -fdev --enable-tests --with-compiler=/opt/ghc/9.5.0.20221014/bin/ghc --allow-newer
# cabal configure -fdev --enable-tests --with-compiler=/opt/ghc/9.5.20221014/bin/ghc
#--------------------------------------------------------------------
#- GHC 9.6 HEAD
# cabal configure -fdev --enable-tests --with-compiler=/opt/ghc/9.6.0.20230111/bin/ghc --allow-newer
# cabal configure -fdev --with-compiler=/opt/ghc/9.6.0.20230111/bin/ghc --allow-newer


# cabal configure -fdev -froundtrip --enable-tests --with-compiler=/opt/ghc/9.6.0.20230111/bin/ghc --allow-newer
# cabal configure -fdev -froundtrip --enable-tests --with-compiler=/opt/ghc/9.6.0.20230128/bin/ghc --allow-newer
# cabal configure -fdev -froundtrip --enable-tests --with-compiler=/opt/ghc/9.6.0.20230201/bin/ghc --allow-newer
# cabal configure -fdev -froundtrip --enable-tests --with-compiler=/opt/ghc/9.6.0.20230209/bin/ghc --allow-newer

# cabal configure -fdev -froundtrip --enable-tests --with-compiler=/opt/ghc/9.6.0.20230214/bin/ghc --allow-newer

# cabal configure -fdev -froundtrip --enable-tests --with-compiler=/opt/ghc/9.6.1/bin/ghc --allow-newer
# cabal configure --with-compiler=/opt/ghc/9.6.1/bin/ghc
cabal configure -fdev --enable-tests --with-compiler=/opt/ghc/9.6.1/bin/ghc
1 change: 1 addition & 0 deletions emacs-ws-cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ for file in `find . -name "*.hs"`; do
--eval '(whitespace-cleanup)' \
--eval '(untabify (point-min) (point-max))' \
--eval '(perform-replace " " " " nil nil nil)' \
--eval '(perform-replace " " " " nil nil nil)' \
--eval '(perform-replace " " "" nil nil nil)' \
--eval '(perform-replace " " " " nil nil nil)' \
--eval '(perform-replace " " " " nil nil nil)' \
Expand Down
16 changes: 7 additions & 9 deletions ghc-exactprint.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ author: Alan Zimmerman, Matthew Pickering
maintainer: alan.zimm@gmail.com
category: Development
build-type: Simple
tested-with: GHC == 9.4.1
, GHC == 9.4.2
, GHC == 9.4.3
, GHC == 9.4.4
tested-with: GHC == 9.6.1
extra-source-files: ChangeLog
tests/examples/failing/*.hs
tests/examples/ghc710-only/*.hs
Expand All @@ -32,6 +29,7 @@ extra-source-files: ChangeLog
tests/examples/ghc90/*.hs
tests/examples/ghc92/*.hs
tests/examples/ghc94/*.hs
tests/examples/ghc96/*.hs
tests/examples/pre-ghc810/*.hs
tests/examples/pre-ghc86/*.hs
tests/examples/pre-ghc90/*.hs
Expand Down Expand Up @@ -75,7 +73,7 @@ library
-- other-extensions:
GHC-Options: -Wall -Wredundant-constraints
-- GHC-Options: -Weverything
build-depends: base >=4.17 && <4.18
build-depends: base >=4.18 && <4.19
, bytestring >= 0.10.6
, containers >= 0.5
, ordered-containers
Expand All @@ -91,7 +89,7 @@ library


default-language: Haskell2010
if impl (ghc < 9.4)
if impl (ghc < 9.6)
buildable: False

Test-Suite test
Expand All @@ -110,20 +108,20 @@ Test-Suite test
GHC-Options: -threaded -Wall -Wredundant-constraints
Default-language: Haskell2010
Build-depends: HUnit >= 1.2
, base < 4.18
, base < 4.19
, bytestring
, containers >= 0.5
, ordered-containers
, data-default
, Diff
, directory >= 1.2
, extra
, filepath >= 1.4
, ghc >= 9.4.1
, ghc-paths >= 0.1
, mtl >= 2.2.1
, syb >= 0.5
, silently >= 1.2
, filemanip >= 0.3
-- for the lib only
, fail >= 4.9 && <4.10
, ghc-boot
Expand Down Expand Up @@ -152,7 +150,7 @@ executable roundtrip
, filepath
, ghc
, ghc-exactprint
-- , ghc-paths
, ghc-paths
, syb
, temporary
, time
Expand Down
Loading