Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "vendor/haskell-tree-sitter"]
path = vendor/haskell-tree-sitter
url = https://github.com/tree-sitter/haskell-tree-sitter.git
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 6 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 4 additions & 1 deletion script/clone-example-repos
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
55 changes: 24 additions & 31 deletions semantic.cabal
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -224,7 +224,6 @@ library
, Parsing.CMark
, Parsing.Parser
, Parsing.TreeSitter
, Paths_semantic
-- Rendering formats
, Rendering.Graph
, Rendering.JSON
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/Analysis/Go/Spec.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# OPTIONS_GHC -O0 #-}
module Analysis.Go.Spec (spec) where

import Data.Abstract.Evaluatable (EvalError(..))
Expand Down
1 change: 1 addition & 0 deletions test/Analysis/PHP/Spec.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# OPTIONS_GHC -O0 #-}
module Analysis.PHP.Spec (spec) where

import Control.Abstract
Expand Down
1 change: 1 addition & 0 deletions test/Analysis/Ruby/Spec.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# OPTIONS_GHC -O0 #-}
{-# LANGUAGE TupleSections #-}
module Analysis.Ruby.Spec (spec) where

Expand Down
2 changes: 2 additions & 0 deletions test/Analysis/TypeScript/Spec.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{-# OPTIONS_GHC -O0 #-}

module Analysis.TypeScript.Spec (spec) where

import Data.Syntax.Statement (StatementBlock(..))
Expand Down
2 changes: 1 addition & 1 deletion test/Examples.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
1 change: 0 additions & 1 deletion test/Graphing/Calls/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
module Graphing.Calls.Spec ( spec ) where

import Prelude hiding (readFile)
import Prologue
import SpecHelpers hiding (readFile)

import Algebra.Graph
Expand Down
1 change: 0 additions & 1 deletion vendor/haskell-tree-sitter
Submodule haskell-tree-sitter deleted from aa1b3c