Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit 23e8d3a

Browse files
author
Patrick Thomson
authored
Merge pull request #110 from github/use-hackage-not-submodules
Use Hackage packages rather than submodules.
2 parents e547afb + 8b3bedc commit 23e8d3a

File tree

12 files changed

+46
-43
lines changed

12 files changed

+46
-43
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "vendor/haskell-tree-sitter"]
2-
path = vendor/haskell-tree-sitter
3-
url = https://github.com/tree-sitter/haskell-tree-sitter.git

.travis.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,16 @@ before_install:
2828
- cabal --version
2929

3030
install:
31-
- cabal new-update
31+
- cabal new-update hackage.haskell.org
3232
- cabal new-configure --enable-tests --write-ghc-environment-files=always
3333
- cabal new-build --only-dependencies -j
3434

3535
script:
36-
- cabal new-build -j semantic-core semantic:exe:semantic
37-
- cabal new-test semantic:test semantic-core:spec
38-
- cabal new-run semantic:parse-examples
36+
- cabal new-build -j
37+
- cabal new-run semantic:test
38+
- cabal new-run semantic-core:spec
39+
# parse-examples is disabled because it slaughters our CI
40+
# - cabal new-run semantic:parse-examples
3941

4042
# Any branch linked with a pull request will be built, as well as the non-PR
4143
# branches listed below:

cabal.project

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
packages: vendor/* vendor/haskell-tree-sitter/languages/* . semantic-core
1+
packages: . semantic-core
2+
3+
jobs: $ncpus
4+
5+
package semantic
6+
ghc-options: +RTS -A128m -n2m -RTS
27

38
source-repository-package
49
type: git

script/clone-example-repos

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
set -e
1414
cd $(dirname "$0")/..
1515

16-
dir="vendor/haskell-tree-sitter/languages"
16+
mkdir -p test/examplerepos || true
17+
git clone --single-branch --recurse-submodules https://github.com/tree-sitter/haskell-tree-sitter.git tmp/haskell-tree-sitter || true
18+
19+
dir="tmp/haskell-tree-sitter/languages"
1720

1821
# clone_repo LOCAL_PATH URL SHA
1922
function clone_repo {

semantic.cabal

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
cabal-version: 2.2
22
name: semantic
3-
version: 0.6.0
4-
synopsis: Framework and service for analyzing and diffing untrusted code.
5-
description: Please see README.md
3+
version: 0.6.0.0
4+
synopsis: Framework and executable for analyzing and diffing untrusted code.
5+
description: Semantic is a library for parsing, analyzing, and comparing source code across many languages.
66
homepage: http://github.com/github/semantic#readme
77
author: The Semantic authors
88
maintainer: opensource+semantic@github.com
@@ -49,21 +49,21 @@ common dependencies
4949
, bytestring ^>= 0.10.8.2
5050
, containers ^>= 0.6.0.1
5151
, directory ^>= 1.3.3.0
52-
, fastsum
52+
, fastsum ^>= 0.1.1.0
5353
, filepath ^>= 1.4.2.1
5454
, free ^>= 5.1
5555
, fused-effects ^>= 0.4.0.0
5656
, fused-effects-exceptions ^>= 0.1.1.0
5757
, hashable ^>= 1.2.7.0
58-
, haskell-tree-sitter
58+
, tree-sitter ^>= 0.1.0.0
5959
, machines ^>= 0.6.4
6060
, mtl ^>= 2.2.2
6161
, network ^>= 2.8.0.0
62-
, process
62+
, process ^>= 1.6.3.0
6363
, recursion-schemes ^>= 5.1
6464
, scientific ^>= 0.3.6.2
65-
, safe-exceptions
66-
, semilattices
65+
, safe-exceptions ^>= 0.1.7.0
66+
, semilattices ^>= 0.0.0.3
6767
, text ^>= 1.2.3.1
6868
, these >= 0.7 && <1
6969
, unix ^>= 2.7.2.2
@@ -224,7 +224,6 @@ library
224224
, Parsing.CMark
225225
, Parsing.Parser
226226
, Parsing.TreeSitter
227-
, Paths_semantic
228227
-- Rendering formats
229228
, Rendering.Graph
230229
, Rendering.JSON
@@ -272,7 +271,8 @@ library
272271
, Tags.Tagging
273272
-- Custom Prelude
274273
, Prologue
275-
274+
autogen-modules: Paths_semantic
275+
other-modules: Paths_semantic
276276
build-depends: base >= 4.12 && < 5
277277
, ansi-terminal ^>= 0.8.2
278278
, array ^>= 0.5.3.0
@@ -304,41 +304,35 @@ library
304304
, reducers ^>= 3.12.3
305305
, semigroupoids ^>= 5.3.2
306306
, servant ^>= 0.15
307-
, shelly
307+
, shelly >= 1.5 && <2
308308
, split ^>= 0.2.3.3
309309
, stm-chans ^>= 3.0.0.4
310310
, template-haskell ^>= 2.14
311311
, time ^>= 1.8.0.2
312-
, unliftio-core
312+
, unliftio-core ^>= 0.1.2.0
313313
, unordered-containers ^>= 0.2.9.0
314314
, vector ^>= 0.12.0.2
315-
, haskell-tree-sitter
316-
, tree-sitter-go
317-
, tree-sitter-haskell
318-
, tree-sitter-json
319-
, tree-sitter-php
320-
, tree-sitter-python
321-
, tree-sitter-ruby
322-
, tree-sitter-typescript
323-
, tree-sitter-tsx
324-
, tree-sitter-java
325-
ghc-options: -Wall -Wmissing-export-lists -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -fno-warn-name-shadowing -j
315+
, tree-sitter-go ^>= 0.1.0.0
316+
, tree-sitter-haskell ^>= 0.1.0.0
317+
, tree-sitter-json ^>= 0.1.0.0
318+
, tree-sitter-php ^>= 0.1.0.0
319+
, tree-sitter-python ^>= 0.1.0.1
320+
, tree-sitter-ruby ^>= 0.1.0.0
321+
, tree-sitter-typescript ^>= 0.1.0.0
322+
, tree-sitter-tsx ^>= 0.1.0.0
323+
, tree-sitter-java ^>= 0.1.0.0
324+
ghc-options: -Wall -Wmissing-export-lists -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -fno-warn-name-shadowing
326325
if flag(release)
327-
ghc-options: -Werror -O1
328326
cpp-options: -DCOMPUTE_GIT_SHA
329327
else
330-
ghc-options: -O0 +RTS -A128m -n2m -RTS
331-
ghc-prof-options: -fprof-auto
328+
ghc-options: +RTS -A128m -n2m -RTS
332329

333330
executable semantic
334331
import: haskell, dependencies, executable-flags
335332
hs-source-dirs: app
336333
main-is: Main.hs
337334
if flag(release)
338-
ghc-options: -O1
339335
cpp-options: -DCOMPUTE_GIT_SHA
340-
else
341-
ghc-options: -O0
342336
build-depends: base
343337
, semantic
344338

@@ -394,7 +388,6 @@ test-suite test
394388
, HUnit ^>= 1.6.0.0
395389
, leancheck >= 0.8 && <1
396390
, temporary
397-
ghc-options: -O0
398391
if flag(release)
399392
ghc-options: -dynamic
400393

@@ -414,7 +407,7 @@ benchmark evaluation
414407
hs-source-dirs: bench/evaluation
415408
type: exitcode-stdio-1.0
416409
main-is: Main.hs
417-
ghc-options: -static -O1
410+
ghc-options: -static
418411
build-depends: base
419412
, criterion
420413
, semantic

test/Analysis/Go/Spec.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# OPTIONS_GHC -O0 #-}
12
module Analysis.Go.Spec (spec) where
23

34
import Data.Abstract.Evaluatable (EvalError(..))

test/Analysis/PHP/Spec.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# OPTIONS_GHC -O0 #-}
12
module Analysis.PHP.Spec (spec) where
23

34
import Control.Abstract

test/Analysis/Ruby/Spec.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# OPTIONS_GHC -O0 #-}
12
{-# LANGUAGE TupleSections #-}
23
module Analysis.Ruby.Spec (spec) where
34

test/Analysis/TypeScript/Spec.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{-# OPTIONS_GHC -O0 #-}
2+
13
module Analysis.TypeScript.Spec (spec) where
24

35
import Data.Syntax.Statement (StatementBlock(..))

test/Examples.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,4 @@ parseFilePath :: (Member (Error SomeException) sig, Member Distribute sig, Membe
105105
parseFilePath path = readBlob (fileForPath path) >>= parseTermBuilder @[] TermShow . pure >>= const (pure True)
106106

107107
languagesDir :: FilePath
108-
languagesDir = "vendor/haskell-tree-sitter/languages"
108+
languagesDir = "tmp/haskell-tree-sitter/languages"

0 commit comments

Comments
 (0)