Skip to content

Commit

Permalink
Merge pull request #264 from well-typed/edsko/build-tutorials-on-ghc-910
Browse files Browse the repository at this point in the history
Build tutorials for ghc 9.10
  • Loading branch information
edsko authored Dec 17, 2024
2 parents bf74f47 + 01756b2 commit 4a433df
Show file tree
Hide file tree
Showing 10 changed files with 79 additions and 54 deletions.
109 changes: 65 additions & 44 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@ jobs:
touch cabal.project
echo "packages: $GITHUB_WORKSPACE/source/./grpc-spec" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/./grapesy" >> cabal.project
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/./tutorials/quickstart" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/./tutorials/basics" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/./tutorials/lowlevel" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/./tutorials/metadata" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/./tutorials/monadstack" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/./tutorials/conduit" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/./tutorials/trailers-only" >> cabal.project ; fi
echo "packages: $GITHUB_WORKSPACE/source/./tutorials/quickstart" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/./tutorials/basics" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/./tutorials/lowlevel" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/./tutorials/metadata" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/./tutorials/monadstack" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/./tutorials/conduit" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/./tutorials/trailers-only" >> cabal.project
cat cabal.project
- name: sdist
run: |
Expand Down Expand Up @@ -202,34 +202,55 @@ jobs:
touch cabal.project.local
echo "packages: ${PKGDIR_grpc_spec}" >> cabal.project
echo "packages: ${PKGDIR_grapesy}" >> cabal.project
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_quickstart_tutorial}" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_basics_tutorial}" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_lowlevel_tutorial}" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_metadata_tutorial}" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_monadstack_tutorial}" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_conduit_tutorial}" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_trailers_only_tutorial}" >> cabal.project ; fi
echo "packages: ${PKGDIR_quickstart_tutorial}" >> cabal.project
echo "packages: ${PKGDIR_basics_tutorial}" >> cabal.project
echo "packages: ${PKGDIR_lowlevel_tutorial}" >> cabal.project
echo "packages: ${PKGDIR_metadata_tutorial}" >> cabal.project
echo "packages: ${PKGDIR_monadstack_tutorial}" >> cabal.project
echo "packages: ${PKGDIR_conduit_tutorial}" >> cabal.project
echo "packages: ${PKGDIR_trailers_only_tutorial}" >> cabal.project
echo "package grpc-spec" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo "package grapesy" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "package quickstart-tutorial" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "package basics-tutorial" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "package lowlevel-tutorial" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "package metadata-tutorial" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "package monadstack-tutorial" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "package conduit-tutorial" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "package trailers-only-tutorial" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
echo "package quickstart-tutorial" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo "package basics-tutorial" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo "package lowlevel-tutorial" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo "package metadata-tutorial" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo "package monadstack-tutorial" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo "package conduit-tutorial" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo "package trailers-only-tutorial" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
cat >> cabal.project <<EOF
allow-newer: proto-lens:base
allow-newer: proto-lens-runtime:base
source-repository-package
type: git
location: https://github.com/google/proto-lens
tag: c927e0341715a2ff7f87f219c9a36517f06cef80
subdir: proto-lens
source-repository-package
type: git
location: https://github.com/google/proto-lens
tag: c927e0341715a2ff7f87f219c9a36517f06cef80
subdir: proto-lens-runtime
source-repository-package
type: git
location: https://github.com/google/proto-lens
tag: c927e0341715a2ff7f87f219c9a36517f06cef80
subdir: proto-lens-setup
source-repository-package
type: git
location: https://github.com/google/proto-lens
tag: c927e0341715a2ff7f87f219c9a36517f06cef80
subdir: proto-lens-protoc
package grpc-spec
tests: True
Expand Down Expand Up @@ -295,20 +316,20 @@ jobs:
${CABAL} -vnormal check
cd ${PKGDIR_grapesy} || false
${CABAL} -vnormal check
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then cd ${PKGDIR_quickstart_tutorial} || false ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then cd ${PKGDIR_basics_tutorial} || false ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then cd ${PKGDIR_lowlevel_tutorial} || false ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then cd ${PKGDIR_metadata_tutorial} || false ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then cd ${PKGDIR_monadstack_tutorial} || false ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then cd ${PKGDIR_conduit_tutorial} || false ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then cd ${PKGDIR_trailers_only_tutorial} || false ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
cd ${PKGDIR_quickstart_tutorial} || false
${CABAL} -vnormal check
cd ${PKGDIR_basics_tutorial} || false
${CABAL} -vnormal check
cd ${PKGDIR_lowlevel_tutorial} || false
${CABAL} -vnormal check
cd ${PKGDIR_metadata_tutorial} || false
${CABAL} -vnormal check
cd ${PKGDIR_monadstack_tutorial} || false
${CABAL} -vnormal check
cd ${PKGDIR_conduit_tutorial} || false
${CABAL} -vnormal check
cd ${PKGDIR_trailers_only_tutorial} || false
${CABAL} -vnormal check
- name: haddock
run: |
$CABAL v2-haddock --disable-documentation $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
Expand Down
4 changes: 0 additions & 4 deletions cabal.haskell-ci
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@ branches: main
copy-fields: all
apt: libsnappy-dev protobuf-compiler
haddock-components: libs

-- the quickstart tutorial uses proto-lens-setup,
-- which doesn't compile with ghc 9.10 currently
jobs-selection: any
13 changes: 7 additions & 6 deletions cabal.project.ci
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ package conduit-tutorial
package trailers-only-tutorial
ghc-options: -Werror

--
-- ghc 9.10
--

allow-newer: proto-lens:base
allow-newer: proto-lens-runtime:base
-- proto-lens support for ghc 9.10
-- https://github.com/google/proto-lens/pull/494
source-repository-package
type: git
location: https://github.com/google/proto-lens
tag: c927e0341715a2ff7f87f219c9a36517f06cef80
subdir: proto-lens proto-lens-runtime proto-lens-setup proto-lens-protoc
1 change: 1 addition & 0 deletions tutorials/basics/basics-tutorial.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ tested-with: GHC==8.10.7
, GHC==9.4.8
, GHC==9.6.6
, GHC==9.8.2
, GHC==9.10.1

custom-setup
setup-depends:
Expand Down
1 change: 1 addition & 0 deletions tutorials/conduit/conduit-tutorial.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ tested-with: GHC==8.10.7
, GHC==9.4.8
, GHC==9.6.6
, GHC==9.8.2
, GHC==9.10.1

common lang
build-depends: base >= 4.14 && < 5
Expand Down
1 change: 1 addition & 0 deletions tutorials/lowlevel/lowlevel-tutorial.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ tested-with: GHC==8.10.7
, GHC==9.4.8
, GHC==9.6.6
, GHC==9.8.2
, GHC==9.10.1

common lang
build-depends: base >= 4.14 && < 5
Expand Down
1 change: 1 addition & 0 deletions tutorials/metadata/metadata-tutorial.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ tested-with: GHC==8.10.7
, GHC==9.4.8
, GHC==9.6.6
, GHC==9.8.2
, GHC==9.10.1

custom-setup
setup-depends:
Expand Down
1 change: 1 addition & 0 deletions tutorials/monadstack/monadstack-tutorial.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ tested-with: GHC==8.10.7
, GHC==9.4.8
, GHC==9.6.6
, GHC==9.8.2
, GHC==9.10.1

common lang
build-depends: base >= 4.14 && < 5
Expand Down
1 change: 1 addition & 0 deletions tutorials/quickstart/quickstart-tutorial.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ tested-with: GHC==8.10.7
, GHC==9.4.8
, GHC==9.6.6
, GHC==9.8.2
, GHC==9.10.1

custom-setup
setup-depends:
Expand Down
1 change: 1 addition & 0 deletions tutorials/trailers-only/trailers-only-tutorial.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ tested-with: GHC==8.10.7
, GHC==9.4.8
, GHC==9.6.6
, GHC==9.8.2
, GHC==9.10.1

common lang
build-depends: base >= 4.14 && < 5
Expand Down

0 comments on commit 4a433df

Please sign in to comment.