diff --git a/.gitmodules b/.gitmodules index 6dab354824..e69de29bb2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "vendor/haskell-tree-sitter"] - path = vendor/haskell-tree-sitter - url = https://github.com/tree-sitter/haskell-tree-sitter.git diff --git a/.travis.yml b/.travis.yml index 0fcfe68a2b..5dbd7eb182 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,14 +28,16 @@ before_install: - cabal --version install: -- cabal new-update +- cabal new-update hackage.haskell.org - cabal new-configure --enable-tests --write-ghc-environment-files=always - cabal new-build --only-dependencies -j script: -- cabal new-build -j semantic-core semantic:exe:semantic -- cabal new-test semantic:test semantic-core:spec -- cabal new-run semantic:parse-examples +- cabal new-build -j +- cabal new-run semantic:test +- cabal new-run semantic-core:spec +# parse-examples is disabled because it slaughters our CI +# - cabal new-run semantic:parse-examples # Any branch linked with a pull request will be built, as well as the non-PR # branches listed below: diff --git a/cabal.project b/cabal.project index 7db9d1e8e2..5772f08158 100644 --- a/cabal.project +++ b/cabal.project @@ -1,4 +1,9 @@ -packages: vendor/* vendor/haskell-tree-sitter/languages/* . semantic-core +packages: . semantic-core + +jobs: $ncpus + +package semantic + ghc-options: +RTS -A128m -n2m -RTS source-repository-package type: git diff --git a/script/clone-example-repos b/script/clone-example-repos index af2aa98fd6..85589ad65f 100755 --- a/script/clone-example-repos +++ b/script/clone-example-repos @@ -13,7 +13,10 @@ set -e cd $(dirname "$0")/.. -dir="vendor/haskell-tree-sitter/languages" +mkdir -p test/examplerepos || true +git clone --single-branch --recurse-submodules https://github.com/tree-sitter/haskell-tree-sitter.git tmp/haskell-tree-sitter || true + +dir="tmp/haskell-tree-sitter/languages" # clone_repo LOCAL_PATH URL SHA function clone_repo { diff --git a/semantic.cabal b/semantic.cabal index ccb96efc0e..7ba07963b4 100644 --- a/semantic.cabal +++ b/semantic.cabal @@ -1,8 +1,8 @@ cabal-version: 2.2 name: semantic -version: 0.6.0 -synopsis: Framework and service for analyzing and diffing untrusted code. -description: Please see README.md +version: 0.6.0.0 +synopsis: Framework and executable for analyzing and diffing untrusted code. +description: Semantic is a library for parsing, analyzing, and comparing source code across many languages. homepage: http://github.com/github/semantic#readme author: The Semantic authors maintainer: opensource+semantic@github.com @@ -49,21 +49,21 @@ common dependencies , bytestring ^>= 0.10.8.2 , containers ^>= 0.6.0.1 , directory ^>= 1.3.3.0 - , fastsum + , fastsum ^>= 0.1.1.0 , filepath ^>= 1.4.2.1 , free ^>= 5.1 , fused-effects ^>= 0.4.0.0 , fused-effects-exceptions ^>= 0.1.1.0 , hashable ^>= 1.2.7.0 - , haskell-tree-sitter + , tree-sitter ^>= 0.1.0.0 , machines ^>= 0.6.4 , mtl ^>= 2.2.2 , network ^>= 2.8.0.0 - , process + , process ^>= 1.6.3.0 , recursion-schemes ^>= 5.1 , scientific ^>= 0.3.6.2 - , safe-exceptions - , semilattices + , safe-exceptions ^>= 0.1.7.0 + , semilattices ^>= 0.0.0.3 , text ^>= 1.2.3.1 , these >= 0.7 && <1 , unix ^>= 2.7.2.2 @@ -224,7 +224,6 @@ library , Parsing.CMark , Parsing.Parser , Parsing.TreeSitter - , Paths_semantic -- Rendering formats , Rendering.Graph , Rendering.JSON @@ -272,7 +271,8 @@ library , Tags.Tagging -- Custom Prelude , Prologue - + autogen-modules: Paths_semantic + other-modules: Paths_semantic build-depends: base >= 4.12 && < 5 , ansi-terminal ^>= 0.8.2 , array ^>= 0.5.3.0 @@ -304,41 +304,35 @@ library , reducers ^>= 3.12.3 , semigroupoids ^>= 5.3.2 , servant ^>= 0.15 - , shelly + , shelly >= 1.5 && <2 , split ^>= 0.2.3.3 , stm-chans ^>= 3.0.0.4 , template-haskell ^>= 2.14 , time ^>= 1.8.0.2 - , unliftio-core + , unliftio-core ^>= 0.1.2.0 , unordered-containers ^>= 0.2.9.0 , vector ^>= 0.12.0.2 - , haskell-tree-sitter - , tree-sitter-go - , tree-sitter-haskell - , tree-sitter-json - , tree-sitter-php - , tree-sitter-python - , tree-sitter-ruby - , tree-sitter-typescript - , tree-sitter-tsx - , tree-sitter-java - ghc-options: -Wall -Wmissing-export-lists -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -fno-warn-name-shadowing -j + , tree-sitter-go ^>= 0.1.0.0 + , tree-sitter-haskell ^>= 0.1.0.0 + , tree-sitter-json ^>= 0.1.0.0 + , tree-sitter-php ^>= 0.1.0.0 + , tree-sitter-python ^>= 0.1.0.1 + , tree-sitter-ruby ^>= 0.1.0.0 + , 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) - ghc-options: -Werror -O1 cpp-options: -DCOMPUTE_GIT_SHA else - ghc-options: -O0 +RTS -A128m -n2m -RTS - ghc-prof-options: -fprof-auto + ghc-options: +RTS -A128m -n2m -RTS executable semantic import: haskell, dependencies, executable-flags hs-source-dirs: app main-is: Main.hs if flag(release) - ghc-options: -O1 cpp-options: -DCOMPUTE_GIT_SHA - else - ghc-options: -O0 build-depends: base , semantic @@ -394,7 +388,6 @@ test-suite test , HUnit ^>= 1.6.0.0 , leancheck >= 0.8 && <1 , temporary - ghc-options: -O0 if flag(release) ghc-options: -dynamic @@ -414,7 +407,7 @@ benchmark evaluation hs-source-dirs: bench/evaluation type: exitcode-stdio-1.0 main-is: Main.hs - ghc-options: -static -O1 + ghc-options: -static build-depends: base , criterion , semantic diff --git a/test/Analysis/Go/Spec.hs b/test/Analysis/Go/Spec.hs index 9bdb9f7a09..a750f46bbb 100644 --- a/test/Analysis/Go/Spec.hs +++ b/test/Analysis/Go/Spec.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -O0 #-} module Analysis.Go.Spec (spec) where import Data.Abstract.Evaluatable (EvalError(..)) diff --git a/test/Analysis/PHP/Spec.hs b/test/Analysis/PHP/Spec.hs index 2069e50ddb..de74db45c2 100644 --- a/test/Analysis/PHP/Spec.hs +++ b/test/Analysis/PHP/Spec.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -O0 #-} module Analysis.PHP.Spec (spec) where import Control.Abstract diff --git a/test/Analysis/Ruby/Spec.hs b/test/Analysis/Ruby/Spec.hs index 6641ebfa54..1efe60f8ab 100644 --- a/test/Analysis/Ruby/Spec.hs +++ b/test/Analysis/Ruby/Spec.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -O0 #-} {-# LANGUAGE TupleSections #-} module Analysis.Ruby.Spec (spec) where diff --git a/test/Analysis/TypeScript/Spec.hs b/test/Analysis/TypeScript/Spec.hs index 0e0e4b3e1a..75169a1d43 100644 --- a/test/Analysis/TypeScript/Spec.hs +++ b/test/Analysis/TypeScript/Spec.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -O0 #-} + module Analysis.TypeScript.Spec (spec) where import Data.Syntax.Statement (StatementBlock(..)) diff --git a/test/Examples.hs b/test/Examples.hs index b7c5b3ab27..363f73000a 100644 --- a/test/Examples.hs +++ b/test/Examples.hs @@ -105,4 +105,4 @@ parseFilePath :: (Member (Error SomeException) sig, Member Distribute sig, Membe parseFilePath path = readBlob (fileForPath path) >>= parseTermBuilder @[] TermShow . pure >>= const (pure True) languagesDir :: FilePath -languagesDir = "vendor/haskell-tree-sitter/languages" +languagesDir = "tmp/haskell-tree-sitter/languages" diff --git a/test/Graphing/Calls/Spec.hs b/test/Graphing/Calls/Spec.hs index 4fee9ed626..d5aa71dca7 100644 --- a/test/Graphing/Calls/Spec.hs +++ b/test/Graphing/Calls/Spec.hs @@ -3,7 +3,6 @@ module Graphing.Calls.Spec ( spec ) where import Prelude hiding (readFile) -import Prologue import SpecHelpers hiding (readFile) import Algebra.Graph diff --git a/vendor/haskell-tree-sitter b/vendor/haskell-tree-sitter deleted file mode 160000 index aa1b3c7441..0000000000 --- a/vendor/haskell-tree-sitter +++ /dev/null @@ -1 +0,0 @@ -Subproject commit aa1b3c74410a71648a5301d6241566dfe79165a4