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

Commit 30fd1b4

Browse files
authored
Merge branch 'master' into remove-orphan-bytestring-listable
2 parents 02b36d2 + 1afb36c commit 30fd1b4

File tree

9 files changed

+20
-41
lines changed

9 files changed

+20
-41
lines changed

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ cache:
44
directories:
55
- $HOME/.cabal/packages
66
- $HOME/.cabal/store
7+
- $TRAVIS_BUILD_DIR/dist-newstyle
78

89
before_cache:
910
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
@@ -28,12 +29,12 @@ before_install:
2829
- cabal --version
2930

3031
install:
31-
- cabal new-update -v hackage.haskell.org
32-
- cabal new-configure --enable-tests --write-ghc-environment-files=always
33-
- cabal new-build --only-dependencies -j
32+
- cabal new-update -v
33+
- cabal new-configure --enable-tests --disable-optimization --write-ghc-environment-files=always --jobs=2
34+
- cabal new-build --only-dependencies
3435

3536
script:
36-
- cabal new-build -j
37+
- cabal new-build
3738
- cabal new-run semantic:test
3839
- cabal new-run semantic-core:spec
3940
# parse-examples is disabled because it slaughters our CI

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ cabal new-test
108108
cabal new-run semantic -- --help
109109
```
110110

111-
`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.
111+
`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.
112112

113113
[nix]: https://www.haskell.org/cabal/users-guide/nix-local-build-overview.html
114114
[stackage]: https://stackage.org

semantic-core/semantic-core.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cabal-version: 2.2
1+
cabal-version: 2.4
22

33
name: semantic-core
44
version: 0.0.0.0

semantic.cabal

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cabal-version: 2.2
1+
cabal-version: 2.4
22
name: semantic
33
version: 0.6.0.0
44
synopsis: Framework and executable for analyzing and diffing untrusted code.
@@ -73,8 +73,11 @@ common dependencies
7373
common executable-flags
7474
ghc-options: -threaded -rtsopts "-with-rtsopts=-N -A4m -n2m"
7575

76+
common ghc-warnings
77+
ghc-options: -Wall -Wmissing-export-lists -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -Wno-name-shadowing
78+
7679
library
77-
import: haskell, dependencies
80+
import: haskell, dependencies, ghc-warnings
7881
hs-source-dirs: src
7982
exposed-modules:
8083
-- Analyses & term annotations
@@ -321,7 +324,6 @@ library
321324
, tree-sitter-typescript ^>= 0.1.0.0
322325
, tree-sitter-tsx ^>= 0.1.0.0
323326
, 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
325327
if flag(release)
326328
cpp-options: -DCOMPUTE_GIT_SHA
327329
else
@@ -337,10 +339,9 @@ executable semantic
337339
, semantic
338340

339341
test-suite test
340-
import: haskell, dependencies, executable-flags
342+
import: haskell, dependencies, executable-flags, ghc-warnings
341343
type: exitcode-stdio-1.0
342344
hs-source-dirs: test
343-
ghc-options: -Wunused-imports
344345
main-is: Spec.hs
345346
other-modules: Analysis.Go.Spec
346347
, Analysis.PHP.Spec

src/Data/Language.hs

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@ module Data.Language
1313
) where
1414

1515
import Data.Aeson
16-
import Data.Char (toUpper)
17-
import Data.String
1816
import qualified Data.Text as T
1917
import Prologue
20-
import Proto3.Suite
2118
import System.FilePath.Posix
2219

2320
-- | The various languages we support.
@@ -37,7 +34,7 @@ data Language
3734
| TypeScript
3835
| PHP
3936
| TSX
40-
deriving (Eq, Generic, Ord, Read, Show, Bounded, Hashable, ToJSON, Named, Enum, MessageField, NFData)
37+
deriving (Eq, Generic, Ord, Read, Show, Bounded, Hashable, ToJSON, Enum, NFData)
4138

4239
class SLanguage (lang :: Language) where
4340
reflect :: proxy lang -> Language
@@ -78,12 +75,6 @@ instance SLanguage 'TypeScript where
7875
instance SLanguage 'PHP where
7976
reflect _ = PHP
8077

81-
82-
-- This ensures that the protobuf file is generated with ALL_CAPS_NAMES.
83-
instance Finite Language where
84-
enumerate _ = fmap go [Unknown ..] where
85-
go x = (fromString (fmap toUpper (show x)), fromEnum x)
86-
8778
instance FromJSON Language where
8879
parseJSON = withText "Language" $ \l ->
8980
pure $ fromMaybe Unknown (parseLanguage l)
@@ -107,18 +98,6 @@ parseLanguage l = case T.toLower l of
10798
knownLanguage :: Language -> Bool
10899
knownLanguage = (/= Unknown)
109100

110-
-- | Defaults to 'Unknown'.
111-
instance HasDefault Language where def = Unknown
112-
113-
-- | Piggybacks on top of the 'Enumerated' instance, as the generated code would.
114-
-- This instance will get easier when we have DerivingVia.
115-
instance Primitive Language where
116-
primType _ = primType (Proxy @(Enumerated Language))
117-
encodePrimitive f = encodePrimitive f . Enumerated . Right
118-
decodePrimitive = decodePrimitive >>= \case
119-
(Enumerated (Right r)) -> pure r
120-
other -> Prelude.fail ("Language decodeMessageField: unexpected value" <> show other)
121-
122101
-- | Returns a Language based on the file extension (including the ".").
123102
languageForType :: String -> Language
124103
languageForType mediaType = case mediaType of

src/Semantic/CLI.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{-# LANGUAGE ApplicativeDo, RankNTypes #-}
1+
{-# LANGUAGE ApplicativeDo #-}
22
module Semantic.CLI (main) where
33

44
import Control.Exception as Exc (displayException)

test/Rendering/TOC/Spec.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,15 +225,13 @@ blankDiff = merge (Nothing, Nothing) (inject [ inserting (termIn Nothing (inject
225225

226226
-- Diff helpers
227227
diffWithParser :: ( Eq1 syntax
228-
, Show1 syntax
229228
, Traversable syntax
230229
, Diffable syntax
231230
, HasDeclaration syntax
232231
, Hashable1 syntax
233232
, Member Distribute sig
234233
, Member Task sig
235234
, Carrier sig m
236-
, Monad m
237235
)
238236
=> Parser (Term syntax Location)
239237
-> BlobPair

test/Reprinting/Spec.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
module Reprinting.Spec where
44

5-
import SpecHelpers hiding (inject, project)
5+
import SpecHelpers
66

77
import Data.Foldable
88
import qualified Data.Machine as Machine
99

10-
import Control.Rewriting hiding (context)
10+
import Control.Rewriting
1111
import qualified Data.Language as Language
1212
import Data.Reprinting.Scope
1313
import Data.Reprinting.Token

test/SpecHelpers.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ module SpecHelpers
1919
, EdgeLabel(..)
2020
) where
2121

22-
import Control.Abstract hiding (lookupDeclaration)
22+
import Control.Abstract
2323
import Data.Abstract.ScopeGraph (EdgeLabel(..))
2424
import qualified Data.Abstract.ScopeGraph as ScopeGraph
2525
import qualified Data.Abstract.Heap as Heap
2626
import Control.Effect.Trace as X (runTraceByIgnoring, runTraceByReturning)
2727
import Control.Monad ((>=>))
2828
import Data.Traversable as X (for)
2929
import Data.Abstract.Address.Precise as X
30-
import Data.Abstract.Evaluatable hiding (lookupDeclaration)
30+
import Data.Abstract.Evaluatable
3131
import Data.Abstract.FreeVariables as X
3232
import Data.Abstract.Module as X
3333
import Data.Abstract.ModuleTable as X hiding (lookup)
@@ -51,7 +51,7 @@ import Data.String
5151
import Data.Sum
5252
import Data.Term as X
5353
import Parsing.Parser as X
54-
import Semantic.Task as X hiding (parsePackage)
54+
import Semantic.Task as X
5555
import Semantic.Util as X
5656
import Semantic.Graph (runHeap, runScopeGraph)
5757
import System.FilePath as X

0 commit comments

Comments
 (0)