From 0bccc8ed8afd1004944dd3cc16f1af0c25f15a60 Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Wed, 14 Sep 2022 08:51:55 +0200 Subject: [PATCH 1/2] Remove unused build-depends and install warnings --- ghcide-bench/ghcide-bench.cabal | 2 +- ghcide/ghcide.cabal | 22 ++++++++-------------- hls-graph/hls-graph.cabal | 6 ++++-- hls-plugin-api/hls-plugin-api.cabal | 3 ++- 4 files changed, 15 insertions(+), 18 deletions(-) diff --git a/ghcide-bench/ghcide-bench.cabal b/ghcide-bench/ghcide-bench.cabal index 450aadba50..502fe861f4 100644 --- a/ghcide-bench/ghcide-bench.cabal +++ b/ghcide-bench/ghcide-bench.cabal @@ -108,7 +108,7 @@ test-suite test implicit-hie:gen-hie main-is: Main.hs hs-source-dirs: test - ghc-options: -Wunused-packages + ghc-options: -Wunused-packages -Werror=unused-packages ghc-options: -threaded -Wall build-depends: base, diff --git a/ghcide/ghcide.cabal b/ghcide/ghcide.cabal index ad9584e68b..a38499ced0 100644 --- a/ghcide/ghcide.cabal +++ b/ghcide/ghcide.cabal @@ -71,7 +71,6 @@ library hiedb == 0.4.2.*, lsp-types ^>= 1.6.0.0, lsp ^>= 1.6.0.0 , - monoid-subclasses, mtl, optparse-applicative, parallel, @@ -230,6 +229,9 @@ library exposed-modules: Development.IDE.GHC.Compat.CPP + if impl(ghc >= 9) + ghc-options: -Wunused-packages -Werror=unused-packages + if flag(ekg) build-depends: ekg-wai, @@ -271,28 +273,15 @@ executable ghcide "-with-rtsopts=-I0 -A128M -T" main-is: Main.hs build-depends: - hiedb, - aeson, base == 4.*, data-default, - directory, extra, - filepath, gitrev, - safe-exceptions, - ghc, - hashable, lsp, lsp-types, - heapsize, - hie-bios, hls-plugin-api, ghcide, - lens, optparse-applicative, - hls-graph, - text, - unordered-containers, other-modules: Arguments Paths_ghcide @@ -322,6 +311,9 @@ executable ghcide ekg-wai, ekg-core, cpp-options: -DMONITORING_EKG + if impl(ghc >= 9) + ghc-options: -Wunused-packages -Werror=unused-packages + test-suite ghcide-tests type: exitcode-stdio-1.0 @@ -378,6 +370,8 @@ test-suite ghcide-tests record-hasfield if impl(ghc < 9.3) build-depends: ghc-typelits-knownnat + if impl(ghc >= 9) + ghc-options: -Wunused-packages hs-source-dirs: test/cabal test/exe test/src ghc-options: -threaded -Wall -Wno-name-shadowing -O0 -Wno-unticked-promoted-constructors main-is: Main.hs diff --git a/hls-graph/hls-graph.cabal b/hls-graph/hls-graph.cabal index b2f90f20f4..2bd8836f38 100644 --- a/hls-graph/hls-graph.cabal +++ b/hls-graph/hls-graph.cabal @@ -76,7 +76,6 @@ library , js-flot , js-jquery , list-t - , primitive , stm , stm-containers , time @@ -91,7 +90,8 @@ library template-haskell if flag(stm-stats) cpp-options: -DSTM_STATS - + if impl(ghc >= 9) + ghc-options: -Wunused-packages -Werror=unused-packages ghc-options: -Wall -Wredundant-constraints -Wno-name-shadowing @@ -136,3 +136,5 @@ test-suite tests , text , unordered-containers build-tool-depends: hspec-discover:hspec-discover -any + if impl(ghc >= 9) + ghc-options: -Wunused-packages -Werror=unused-packages diff --git a/hls-plugin-api/hls-plugin-api.cabal b/hls-plugin-api/hls-plugin-api.cabal index 1e65328e77..58eb8ac547 100644 --- a/hls-plugin-api/hls-plugin-api.cabal +++ b/hls-plugin-api/hls-plugin-api.cabal @@ -52,7 +52,6 @@ library , lsp ^>=1.6.0.0 , opentelemetry >=0.4 , optparse-applicative - , process , regex-tdfa >=1.3.1.0 , text , transformers @@ -70,6 +69,8 @@ library if flag(pedantic) ghc-options: -Werror + if impl(ghc >= 9) + ghc-options: -Wunused-packages -Werror=unused-packages default-language: Haskell2010 default-extensions: From 375521dab2c8bab374c4e0cc2519a568dabf446f Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Thu, 15 Sep 2022 09:11:32 +0200 Subject: [PATCH 2/2] Remove -Werror --- ghcide-bench/ghcide-bench.cabal | 2 +- ghcide/ghcide.cabal | 4 ++-- hls-graph/hls-graph.cabal | 4 ++-- hls-plugin-api/hls-plugin-api.cabal | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ghcide-bench/ghcide-bench.cabal b/ghcide-bench/ghcide-bench.cabal index 502fe861f4..450aadba50 100644 --- a/ghcide-bench/ghcide-bench.cabal +++ b/ghcide-bench/ghcide-bench.cabal @@ -108,7 +108,7 @@ test-suite test implicit-hie:gen-hie main-is: Main.hs hs-source-dirs: test - ghc-options: -Wunused-packages -Werror=unused-packages + ghc-options: -Wunused-packages ghc-options: -threaded -Wall build-depends: base, diff --git a/ghcide/ghcide.cabal b/ghcide/ghcide.cabal index a38499ced0..54f417055e 100644 --- a/ghcide/ghcide.cabal +++ b/ghcide/ghcide.cabal @@ -230,7 +230,7 @@ library Development.IDE.GHC.Compat.CPP if impl(ghc >= 9) - ghc-options: -Wunused-packages -Werror=unused-packages + ghc-options: -Wunused-packages if flag(ekg) build-depends: @@ -312,7 +312,7 @@ executable ghcide ekg-core, cpp-options: -DMONITORING_EKG if impl(ghc >= 9) - ghc-options: -Wunused-packages -Werror=unused-packages + ghc-options: -Wunused-packages test-suite ghcide-tests diff --git a/hls-graph/hls-graph.cabal b/hls-graph/hls-graph.cabal index 2bd8836f38..10c0cc4b32 100644 --- a/hls-graph/hls-graph.cabal +++ b/hls-graph/hls-graph.cabal @@ -91,7 +91,7 @@ library if flag(stm-stats) cpp-options: -DSTM_STATS if impl(ghc >= 9) - ghc-options: -Wunused-packages -Werror=unused-packages + ghc-options: -Wunused-packages ghc-options: -Wall -Wredundant-constraints -Wno-name-shadowing @@ -137,4 +137,4 @@ test-suite tests , unordered-containers build-tool-depends: hspec-discover:hspec-discover -any if impl(ghc >= 9) - ghc-options: -Wunused-packages -Werror=unused-packages + ghc-options: -Wunused-packages diff --git a/hls-plugin-api/hls-plugin-api.cabal b/hls-plugin-api/hls-plugin-api.cabal index 58eb8ac547..4b451bda42 100644 --- a/hls-plugin-api/hls-plugin-api.cabal +++ b/hls-plugin-api/hls-plugin-api.cabal @@ -70,7 +70,7 @@ library if flag(pedantic) ghc-options: -Werror if impl(ghc >= 9) - ghc-options: -Wunused-packages -Werror=unused-packages + ghc-options: -Wunused-packages default-language: Haskell2010 default-extensions: