diff --git a/README.md b/README.md index f719aa1..f462da8 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ package * -fplugin-trustworthy -plugin-package=trace-foreign-calls -fplugin=Plugin.TraceForeignCalls -``` +``` The first open ensures that if we have dependencies that rely on Safe Haskell, compiling modules with the plugin does not mark them as unsafe, the second line diff --git a/cabal.project.plugin b/cabal.project.plugin-9.6.4 similarity index 100% rename from cabal.project.plugin rename to cabal.project.plugin-9.6.4 diff --git a/cabal.project.plugin-9.8.2 b/cabal.project.plugin-9.8.2 new file mode 100644 index 0000000..f42d482 --- /dev/null +++ b/cabal.project.plugin-9.8.2 @@ -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 diff --git a/example-pkg-A/example-pkg-A.cabal b/example-pkg-A/example-pkg-A.cabal index 748d74b..58cc146 100644 --- a/example-pkg-A/example-pkg-A.cabal +++ b/example-pkg-A/example-pkg-A.cabal @@ -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 diff --git a/example-pkg-B/example-pkg-B.cabal b/example-pkg-B/example-pkg-B.cabal index efbf3a2..7ba6417 100644 --- a/example-pkg-B/example-pkg-B.cabal +++ b/example-pkg-B/example-pkg-B.cabal @@ -13,12 +13,13 @@ maintainer: edsko@well-typed.com 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 diff --git a/trace-foreign-calls/src/Plugin/TraceForeignCalls.hs b/trace-foreign-calls/src/Plugin/TraceForeignCalls.hs index e9fd526..51fcd7c 100644 --- a/trace-foreign-calls/src/Plugin/TraceForeignCalls.hs +++ b/trace-foreign-calls/src/Plugin/TraceForeignCalls.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} module Plugin.TraceForeignCalls (plugin) where @@ -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 diff --git a/trace-foreign-calls/trace-foreign-calls.cabal b/trace-foreign-calls/trace-foreign-calls.cabal index 83290bf..1eb7cbb 100644 --- a/trace-foreign-calls/trace-foreign-calls.cabal +++ b/trace-foreign-calls/trace-foreign-calls.cabal @@ -18,6 +18,7 @@ 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 @@ -25,7 +26,7 @@ source-repository head common lang build-depends: - base >= 4.18 && < 4.19 + base >= 4.18 && < 4.20 default-language: GHC2021 ghc-options: @@ -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: