Skip to content

Commit

Permalink
Support ghc 9.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
edsko committed Apr 27, 2024
1 parent c2ea390 commit 21701a0
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 11 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This GitHub workflow config has been generated by a script via
#
# haskell-ci 'github' 'cabal.project'
# haskell-ci 'github' 'cabal.project.ci'
#
# To regenerate the script (for example after adjusting tested-with) run
#
Expand All @@ -10,7 +10,7 @@
#
# version: 0.19.20240421
#
# REGENDATA ("0.19.20240421",["github","cabal.project"])
# REGENDATA ("0.19.20240421",["github","cabal.project.ci"])
#
name: Haskell-CI
on:
Expand All @@ -28,6 +28,11 @@ jobs:
strategy:
matrix:
include:
- compiler: ghc-9.8.2
compilerKind: ghc
compilerVersion: 9.8.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.6.4
compilerKind: ghc
compilerVersion: 9.6.4
Expand Down Expand Up @@ -158,6 +163,17 @@ jobs:
echo "package example-pkg-B" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
cat >> cabal.project <<EOF
package trace-foreign-calls
tests: True
ghc-options: -Werror
package example-pkg-A
tests: True
ghc-options: -Werror
package example-pkg-B
tests: True
ghc-options: -Werror
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(example-pkg-A|example-pkg-B|trace-foreign-calls)$/; }' >> cabal.project.local
cat cabal.project
Expand Down
File renamed without changes.
13 changes: 13 additions & 0 deletions cabal.project.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
packages: trace-foreign-calls, example-pkg-A, example-pkg-B

package trace-foreign-calls
tests: True
ghc-options: -Werror

package example-pkg-A
tests: True
ghc-options: -Werror

package example-pkg-B
tests: True
ghc-options: -Werror
File renamed without changes.
10 changes: 10 additions & 0 deletions cabal.project.plugin-9.8.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import: cabal.project

package *
ghc-options:
-package-db=/tmp/cabal-plugin-store/ghc-9.8.2/package.db
-fplugin-trustworthy
-plugin-package=trace-foreign-calls
-fplugin=Plugin.TraceForeignCalls

store-dir: /tmp/cabal-plugin-store
3 changes: 2 additions & 1 deletion example-pkg-A/example-pkg-A.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ build-type: Simple
extra-source-files: cbits/cbits.h
cbits/cbits.c
tested-with: GHC ==9.6.4
GHC ==9.8.2

common lang
ghc-options:
-Wall
build-depends:
base >= 4.18 && < 4.19
base >= 4.18 && < 4.20
default-language:
GHC2021

Expand Down
3 changes: 2 additions & 1 deletion example-pkg-B/example-pkg-B.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ maintainer: [email protected]
category: Development
build-type: Simple
tested-with: GHC ==9.6.4
GHC ==9.8.2

common lang
ghc-options:
-Wall
build-depends:
base >= 4.18 && < 4.19
base >= 4.18 && < 4.20
default-language:
GHC2021

Expand Down
5 changes: 0 additions & 5 deletions trace-foreign-calls/cabal.project.ci

This file was deleted.

6 changes: 6 additions & 0 deletions trace-foreign-calls/src/Plugin/TraceForeignCalls.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}

module Plugin.TraceForeignCalls (plugin) where
Expand Down Expand Up @@ -198,7 +199,12 @@ mkWrapper rfi@ReplacedForeignImport {
fun_ext = mkNameSet [unLoc rfiSuffixedName] -- TODO: what is this?
, fun_id = rfiOriginalName
, fun_matches = MG {
#if __GLASGOW_HASKELL__ == 906
mg_ext = Generated
#endif
#if __GLASGOW_HASKELL__ >= 908
mg_ext = Generated SkipPmc
#endif
, mg_alts = noLocA . map noLocA $ [
Match {
m_ext = EpAnnNotUsed
Expand Down
5 changes: 3 additions & 2 deletions trace-foreign-calls/trace-foreign-calls.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ extra-doc-files: CHANGELOG.md
extra-source-files: test-cbits/test_cbits.h
test-cbits/test_cbits.c
tested-with: GHC ==9.6.4
GHC ==9.8.2

source-repository head
type: git
location: https://github.com/well-typed/trace-foreign-calls

common lang
build-depends:
base >= 4.18 && < 4.19
base >= 4.18 && < 4.20
default-language:
GHC2021
ghc-options:
Expand All @@ -49,7 +50,7 @@ library
build-depends:
-- dependencies intentionally kept at a minimum
-- (we want to be able to build the boot libs with this plugin)
, ghc >= 9.6 && < 9.7
, ghc >= 9.6 && < 9.9

test-suite test-trace-foreign-calls
import:
Expand Down

0 comments on commit 21701a0

Please sign in to comment.