diff --git a/CHANGELOG.md b/CHANGELOG.md index d72042a..4b31040 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.2.8 + +* Support ghc-9.14, adapt to HPT rule creation API change +* ghc-9.10 and ghc-9.12 were supported via hackage revisions + ## 0.2.7 * Support ghc-9.6 and ghc-9.8 diff --git a/fusion-plugin.cabal b/fusion-plugin.cabal index ac6dc29..668fb09 100644 --- a/fusion-plugin.cabal +++ b/fusion-plugin.cabal @@ -1,7 +1,7 @@ cabal-version: 2.2 name: fusion-plugin -version: 0.2.7 +version: 0.2.8 synopsis: GHC plugin to make stream fusion more predictable. description: This plugin provides the programmer with a way to annotate certain @@ -50,12 +50,12 @@ source-repository head library exposed-modules: Fusion.Plugin build-depends: base >= 4.0 && < 5.0 - , containers >= 0.5.6.2 && < 0.8 + , containers >= 0.5.6.2 && < 0.9 , directory >= 1.2.2.0 && < 1.4 , filepath >= 1.4 && < 1.6 - , ghc >= 7.10.3 && < 9.13 + , ghc >= 7.10.3 && < 9.15 , syb >= 0.7 && < 0.8 - , time >= 1.5 && < 1.15 + , time >= 1.5 && < 1.16 , transformers >= 0.4 && < 0.7 , fusion-plugin-types >= 0.1 && < 0.2 diff --git a/src/Fusion/Plugin.hs b/src/Fusion/Plugin.hs index 9b79fbf..c0400ec 100644 --- a/src/Fusion/Plugin.hs +++ b/src/Fusion/Plugin.hs @@ -68,6 +68,13 @@ import GHC.Core.Opt.Simplify (SimplifyOpts(..)) import GHC.Driver.Config.Core.Opt.Simplify (initSimplMode, initSimplifyOpts) #endif +#if MIN_VERSION_ghc(9,14,0) +import GHC.Unit.Env (ue_hpt) +import GHC.Unit.Home.ModInfo (HomeModInfo(..)) +import GHC.Unit.Home.PackageTable (concatHpt) +import GHC.Unit.Module.ModDetails (ModDetails(..)) +#endif + #if MIN_VERSION_ghc(9,6,0) #elif MIN_VERSION_ghc(9,2,0) import Data.Char (isSpace) @@ -1082,7 +1089,12 @@ install args todos = do options <- liftIO $ parseOptions args dflags <- getDynFlags hscEnv <- getHscEnv -#if MIN_VERSION_ghc(9,6,0) +#if MIN_VERSION_ghc(9,14,0) + let hpt = ue_hpt (hsc_unit_env hscEnv) + home_pkg_rules <- liftIO $ concatHpt (md_rules . hm_details) hpt + let hpt_rule_base = mkRuleBase home_pkg_rules + simplify = fusionSimplify hpt_rule_base hscEnv dflags +#elif MIN_VERSION_ghc(9,6,0) m <- getModule let home_pkg_rules = diff --git a/stack.yaml b/stack.yaml index 354eb26..9c73980 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,3 +1,3 @@ -resolver: lts-17.14 +resolver: lts-24.36 packages: - '.'