From 19b040cff6fd5e0a1939ae32f95e8534787bc534 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 14 Jun 2019 08:25:49 -0400 Subject: [PATCH 1/5] Document that Cabal 2.4 is necessary. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #145. Also removes some language about Stackage versions which isn’t accurate anymore. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 236f0b5e53..2798765789 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ cabal new-test cabal new-run semantic -- --help ``` -`semantic` requires at least GHC 8.6.4. We recommend using [`ghcup`][ghcup] to sandbox GHC versions. Our version bounds are based on [Stackage][stackage] LTS versions. The current LTS version is 13.13. `stack` as a build tool is not officially supported; there is an unofficial [`stack.yaml`](https://gist.github.com/jkachmar/f200caee83280f1f25e9cfa2dd2b16bb) available, though we cannot make guarantees as to its stability. +`semantic` requires at least GHC 8.6.4 and Cabal 2.4. We recommend using [`ghcup`][ghcup] to sandbox GHC versions. `stack` as a build tool is not officially supported; there is an unofficial [`stack.yaml`](https://gist.github.com/jkachmar/f200caee83280f1f25e9cfa2dd2b16bb) available, though we cannot make guarantees as to its stability. [nix]: https://www.haskell.org/cabal/users-guide/nix-local-build-overview.html [stackage]: https://stackage.org From 7aa0d8b3d9f158eec7feba4ac284e0626f50ccf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hr=C4=8Dek?= Date: Fri, 14 Jun 2019 15:35:18 +0200 Subject: [PATCH 2/5] Enable GHC warnings in tests --- semantic.cabal | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/semantic.cabal b/semantic.cabal index 1a893c0735..4e76f8ee79 100644 --- a/semantic.cabal +++ b/semantic.cabal @@ -73,8 +73,11 @@ common dependencies common executable-flags ghc-options: -threaded -rtsopts "-with-rtsopts=-N -A4m -n2m" +common ghc-warnings + ghc-options: -Wall -Wmissing-export-lists -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -Wno-name-shadowing + library - import: haskell, dependencies + import: haskell, dependencies, ghc-warnings hs-source-dirs: src exposed-modules: -- Analyses & term annotations @@ -321,7 +324,6 @@ library , tree-sitter-typescript ^>= 0.1.0.0 , tree-sitter-tsx ^>= 0.1.0.0 , tree-sitter-java ^>= 0.1.0.0 - ghc-options: -Wall -Wmissing-export-lists -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -fno-warn-name-shadowing if flag(release) cpp-options: -DCOMPUTE_GIT_SHA else @@ -337,10 +339,9 @@ executable semantic , semantic test-suite test - import: haskell, dependencies, executable-flags + import: haskell, dependencies, executable-flags, ghc-warnings type: exitcode-stdio-1.0 hs-source-dirs: test - ghc-options: -Wunused-imports main-is: Spec.hs other-modules: Analysis.Go.Spec , Analysis.PHP.Spec From 8959d4d1d637ccbe7bc03afb0d33b82447a6b0a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hr=C4=8Dek?= Date: Fri, 14 Jun 2019 15:46:06 +0200 Subject: [PATCH 3/5] Fix -Wdodgy-imports warnings --- src/Data/Language.hs | 2 -- test/Reprinting/Spec.hs | 4 ++-- test/SpecHelpers.hs | 6 +++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Data/Language.hs b/src/Data/Language.hs index 8e136685d0..6af5e0bb0c 100644 --- a/src/Data/Language.hs +++ b/src/Data/Language.hs @@ -13,8 +13,6 @@ module Data.Language ) where import Data.Aeson -import Data.Char (toUpper) -import Data.String import qualified Data.Text as T import Prologue import System.FilePath.Posix diff --git a/test/Reprinting/Spec.hs b/test/Reprinting/Spec.hs index bbbbc3576f..0675cdca50 100644 --- a/test/Reprinting/Spec.hs +++ b/test/Reprinting/Spec.hs @@ -2,12 +2,12 @@ module Reprinting.Spec where -import SpecHelpers hiding (inject, project) +import SpecHelpers import Data.Foldable import qualified Data.Machine as Machine -import Control.Rewriting hiding (context) +import Control.Rewriting import qualified Data.Language as Language import Data.Reprinting.Scope import Data.Reprinting.Token diff --git a/test/SpecHelpers.hs b/test/SpecHelpers.hs index b9f9a58012..c18f7ad8cb 100644 --- a/test/SpecHelpers.hs +++ b/test/SpecHelpers.hs @@ -19,7 +19,7 @@ module SpecHelpers , EdgeLabel(..) ) where -import Control.Abstract hiding (lookupDeclaration) +import Control.Abstract import Data.Abstract.ScopeGraph (EdgeLabel(..)) import qualified Data.Abstract.ScopeGraph as ScopeGraph import qualified Data.Abstract.Heap as Heap @@ -27,7 +27,7 @@ import Control.Effect.Trace as X (runTraceByIgnoring, runTraceByReturning) import Control.Monad ((>=>)) import Data.Traversable as X (for) import Data.Abstract.Address.Precise as X -import Data.Abstract.Evaluatable hiding (lookupDeclaration) +import Data.Abstract.Evaluatable import Data.Abstract.FreeVariables as X import Data.Abstract.Module as X import Data.Abstract.ModuleTable as X hiding (lookup) @@ -51,7 +51,7 @@ import Data.String import Data.Sum import Data.Term as X import Parsing.Parser as X -import Semantic.Task as X hiding (parsePackage) +import Semantic.Task as X import Semantic.Util as X import Semantic.Graph (runHeap, runScopeGraph) import System.FilePath as X From a644674a54b9b441ed3669bee7b78f22b69b922e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hr=C4=8Dek?= Date: Fri, 14 Jun 2019 15:56:07 +0200 Subject: [PATCH 4/5] Fix -Wredundant-constraints warning --- test/Rendering/TOC/Spec.hs | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/Rendering/TOC/Spec.hs b/test/Rendering/TOC/Spec.hs index adadcd19be..4ebe8743c8 100644 --- a/test/Rendering/TOC/Spec.hs +++ b/test/Rendering/TOC/Spec.hs @@ -225,7 +225,6 @@ blankDiff = merge (Nothing, Nothing) (inject [ inserting (termIn Nothing (inject -- Diff helpers diffWithParser :: ( Eq1 syntax - , Show1 syntax , Traversable syntax , Diffable syntax , HasDeclaration syntax @@ -233,7 +232,6 @@ diffWithParser :: ( Eq1 syntax , Member Distribute sig , Member Task sig , Carrier sig m - , Monad m ) => Parser (Term syntax Location) -> BlobPair From 497bc507c56dc16c46c75968c002ec31f9befbbf Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 14 Jun 2019 11:36:55 -0400 Subject: [PATCH 5/5] Cache the dist-newstyle directory. This should address #88. We might even be able to turn -O1 on again. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 29d6f3b0e3..50239553ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ cache: directories: - $HOME/.cabal/packages - $HOME/.cabal/store + - $TRAVIS_BUILD_DIR/dist-newstyle before_cache: - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log