From cfc60fc2258c990763d65111b66420cd59ca92fe Mon Sep 17 00:00:00 2001 From: Brandon Chinn Date: Thu, 17 Aug 2023 09:10:07 -0700 Subject: [PATCH] Use specific versions of fourmolu for each version of GHC --- plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal b/plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal index aec7882f28e..f94aae99362 100644 --- a/plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal +++ b/plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal @@ -31,7 +31,6 @@ library build-depends: , base >=4.12 && <5 , filepath - , fourmolu ^>= 0.9 || ^>= 0.10 || ^>= 0.11 || ^>= 0.12 || ^>= 0.13 , ghc , ghc-boot-th , ghcide == 2.1.0.0 @@ -43,6 +42,15 @@ library , text , transformers + if impl(ghc >= 8.10) && impl(ghc < 9.0) + build-depends: fourmolu ^>= 0.9 + elif impl(ghc >= 9.0) && impl(ghc < 9.2) + build-depends: fourmolu ^>= 0.11 + elif impl(ghc >= 9.2) && impl(ghc < 9.8) + build-depends: fourmolu ^>= 0.13 + else + buildable: false + -- fourmolu 0.9.0 fails to build on Windows CI for reasons unknown if impl(ghc >= 9.2) && os(windows) && impl(ghc < 9.4) build-depends: fourmolu > 0.9.0.0 || < 0.9.0.0