1
1
mirror of https://github.com/github/semantic.git synced 2024-12-19 21:01:35 +03:00
semantic/semantic.cabal

422 lines
17 KiB
Plaintext
Raw Normal View History

2019-02-19 21:54:14 +03:00
cabal-version: 2.2
2018-02-26 21:16:56 +03:00
name: semantic
version: 0.6.0
synopsis: Framework and service for analyzing and diffing untrusted code.
2015-11-18 01:44:16 +03:00
description: Please see README.md
2018-02-26 21:16:56 +03:00
homepage: http://github.com/github/semantic#readme
2015-11-18 01:44:16 +03:00
author: Rob Rix, Josh Vera
2015-11-18 01:52:41 +03:00
maintainer: rob.rix@github.com
2019-02-19 22:20:33 +03:00
copyright: (c) 2016-2019 GitHub, Inc.
2015-11-18 01:44:16 +03:00
category: Web
2017-07-23 17:34:30 +03:00
build-type: Simple
2019-02-19 22:20:33 +03:00
stability: alpha
2015-11-18 01:44:16 +03:00
flag release
description: Build with optimizations on (for CI or deployment builds)
default: False
2019-02-19 21:54:14 +03:00
-- GHC extensions shared between targets
common haskell
default-language: Haskell2010
default-extensions: DataKinds
, DeriveFoldable
, DeriveFunctor
, DeriveGeneric
, DeriveTraversable
, FlexibleContexts
, FlexibleInstances
, MonadFailDesugaring
, MultiParamTypeClasses
, OverloadedStrings
, RecordWildCards
, StandaloneDeriving
, StrictData
, TypeApplications
2019-02-19 22:20:33 +03:00
common dependencies
build-depends: base >= 4.8 && < 5
, aeson
, algebraic-graphs
, async
, bifunctors
, bytestring
, containers
, directory
, fastsum
, filepath
, free
, fused-effects
, Glob
, hashable
, haskell-tree-sitter
, machines
, mtl
, network
, recursion-schemes
, scientific
2019-03-18 19:56:46 +03:00
, safe-exceptions
2019-02-19 22:20:33 +03:00
, semilattices
, text
, these
, proto3-suite
, proto3-wire
2019-02-19 22:31:16 +03:00
common executable-flags
ghc-options: -threaded -rtsopts "-with-rtsopts=-N -A4m -n2m"
2015-11-18 01:44:16 +03:00
library
2019-02-19 22:20:33 +03:00
import: haskell, dependencies
2015-11-18 01:44:16 +03:00
hs-source-dirs: src
exposed-modules:
2017-11-27 22:32:13 +03:00
-- Analyses & term annotations
Analysis.Abstract.Caching.FlowInsensitive
, Analysis.Abstract.Caching.FlowSensitive
, Analysis.Abstract.Collecting
, Analysis.Abstract.Dead
, Analysis.Abstract.Graph
, Analysis.Abstract.Tracing
, Analysis.ConstructorName
, Analysis.CyclomaticComplexity
, Analysis.TOCSummary
2018-11-02 00:49:35 +03:00
, Analysis.Decorator
, Analysis.HasTextElement
, Analysis.PackageDef
-- Semantic assignment
2017-11-27 22:32:13 +03:00
, Assigning.Assignment
, Assigning.Assignment.Deterministic
, Assigning.Assignment.Table
-- Control structures & interfaces for abstract interpretation
, Control.Abstract
, Control.Abstract.Context
, Control.Abstract.Evaluator
, Control.Abstract.Heap
2018-05-28 22:09:10 +03:00
, Control.Abstract.Hole
, Control.Abstract.Modules
2018-05-18 17:11:19 +03:00
, Control.Abstract.Primitive
, Control.Abstract.PythonPackage
, Control.Abstract.Roots
2018-09-11 01:50:40 +03:00
, Control.Abstract.ScopeGraph
2018-03-02 22:45:56 +03:00
, Control.Abstract.Value
-- Effects
, Control.Effect.Interpose
, Control.Effect.REPL
2018-09-14 19:47:21 +03:00
, Control.Rewriting
-- Datatypes for abstract interpretation
, Data.Abstract.Address.Hole
2018-08-10 20:31:55 +03:00
, Data.Abstract.Address.Monovariant
, Data.Abstract.Address.Precise
2018-08-08 02:50:55 +03:00
, Data.Abstract.BaseError
2018-04-25 22:44:44 +03:00
, Data.Abstract.Declarations
, Data.Abstract.Evaluatable
, Data.Abstract.FreeVariables
2019-01-15 23:27:09 +03:00
, Data.Abstract.AccessControls.Class
, Data.Abstract.AccessControls.Instances
, Data.Abstract.HasSpan
2018-03-15 03:42:59 +03:00
, Data.Abstract.Heap
2017-12-01 21:57:15 +03:00
, Data.Abstract.Live
2018-03-22 00:59:16 +03:00
, Data.Abstract.Module
, Data.Abstract.ModuleTable
2018-05-18 19:43:28 +03:00
, Data.Abstract.Name
2018-03-14 17:36:56 +03:00
, Data.Abstract.Number
, Data.Abstract.Package
, Data.Abstract.Path
2018-08-29 20:47:44 +03:00
, Data.Abstract.ScopeGraph
, Data.Abstract.Value.Abstract
, Data.Abstract.Value.Concrete
, Data.Abstract.Value.Type
-- General datatype definitions & generic algorithms
, Data.Algebra
, Data.AST
2017-06-24 17:00:40 +03:00
, Data.Blob
2017-09-27 19:41:41 +03:00
, Data.Diff
, Data.Duration
2017-08-06 19:29:28 +03:00
, Data.Error
, Data.File
, Data.Flag
, Data.Functor.Both
, Data.Functor.Classes.Generic
2019-01-11 19:20:58 +03:00
, Proto3.Google.Timestamp
2018-05-11 19:04:26 +03:00
, Data.Graph
2018-09-07 01:12:12 +03:00
, Data.Graph.ControlFlowVertex
, Data.Handle
, Data.History
2018-11-17 00:09:11 +03:00
, Data.ImportPath
2017-09-09 19:15:22 +03:00
, Data.JSON.Fields
2017-11-27 22:17:48 +03:00
, Data.Language
, Data.Location
2018-03-07 20:22:52 +03:00
, Data.Map.Monoidal
2017-09-27 19:29:07 +03:00
, Data.Patch
, Data.Project
, Data.Quieterm
2017-06-24 16:46:28 +03:00
, Data.Range
, Data.Reprinting.Errors
, Data.Reprinting.Fragment
, Data.Reprinting.Operator
, Data.Reprinting.Scope
, Data.Reprinting.Splice
, Data.Reprinting.Token
2018-03-21 23:40:56 +03:00
, Data.Semigroup.App
, Data.Scientific.Exts
, Data.Source
, Data.Span
-- À la carte syntax types
, Data.Syntax
2017-03-26 22:34:44 +03:00
, Data.Syntax.Comment
2017-03-27 00:31:10 +03:00
, Data.Syntax.Declaration
, Data.Syntax.Directive
, Data.Syntax.Expression
, Data.Syntax.Literal
2017-03-27 00:31:50 +03:00
, Data.Syntax.Statement
2017-03-29 23:23:02 +03:00
, Data.Syntax.Type
, Data.Tag
2017-09-27 19:37:37 +03:00
, Data.Term
-- Diffing algorithms & interpretation thereof
2017-11-27 19:41:50 +03:00
, Diffing.Algorithm
2017-11-27 19:51:39 +03:00
, Diffing.Algorithm.RWS
, Diffing.Algorithm.RWS.FeatureVector
2017-11-27 19:48:39 +03:00
, Diffing.Algorithm.SES
, Diffing.Interpreter
-- Language-specific grammar/syntax types, & assignments
2017-10-11 01:24:25 +03:00
, Language.Markdown.Assignment
, Language.Markdown.Syntax
2017-08-23 00:48:18 +03:00
, Language.Go.Grammar
2017-10-11 20:12:32 +03:00
, Language.Go.Assignment
, Language.Go.Syntax
2017-11-21 23:48:29 +03:00
, Language.Go.Type
, Language.Haskell.Grammar
, Language.Haskell.Assignment
, Language.Haskell.Syntax
, Language.Haskell.Syntax.Constructor
, Language.Haskell.Syntax.Haskell
, Language.Haskell.Syntax.Identifier
, Language.Haskell.Syntax.Pattern
, Language.Haskell.Syntax.QuasiQuote
, Language.Haskell.Syntax.Type
2017-07-17 19:52:50 +03:00
, Language.JSON.Grammar
2017-10-11 01:14:57 +03:00
, Language.JSON.Assignment
2018-08-22 02:15:08 +03:00
, Language.JSON.PrettyPrint
2018-08-28 01:06:51 +03:00
, Language.MiniRuby.Assignment
2018-08-28 19:12:29 +03:00
, Language.MiniPython.Assignment
2017-05-17 21:08:54 +03:00
, Language.Ruby.Grammar
2017-10-11 01:36:09 +03:00
, Language.Ruby.Assignment
2018-08-22 02:15:08 +03:00
, Language.Ruby.PrettyPrint
2018-08-28 19:12:44 +03:00
, Language.Ruby.Syntax
2017-10-11 01:55:42 +03:00
, Language.TypeScript.Assignment
, Language.TypeScript.Grammar
2018-07-20 00:05:44 +03:00
, Language.TypeScript.Resolution
, Language.TypeScript.Syntax
2018-10-18 20:50:07 +03:00
, Language.TypeScript.Syntax.Import
, Language.TypeScript.Syntax.JavaScript
2018-07-20 00:05:44 +03:00
, Language.TypeScript.Syntax.JSX
, Language.TypeScript.Syntax.TypeScript
2018-10-18 20:50:07 +03:00
, Language.TypeScript.Syntax.Types
2017-12-15 22:14:08 +03:00
, Language.PHP.Assignment
, Language.PHP.Grammar
, Language.PHP.Syntax
2017-10-11 01:26:29 +03:00
, Language.Python.Assignment
2017-05-17 22:32:07 +03:00
, Language.Python.Grammar
, Language.Python.PrettyPrint
2017-05-12 02:45:05 +03:00
, Language.Python.Syntax
2018-03-16 00:57:06 +03:00
, Language.Java.Assignment
, Language.Java.Grammar
, Language.Java.Syntax
, Numeric.Exts
-- Parser glue
2017-11-27 21:24:45 +03:00
, Parsing.CMark
, Parsing.Parser
2017-11-27 21:24:45 +03:00
, Parsing.TreeSitter
2018-02-26 21:16:56 +03:00
, Paths_semantic
, Proto3.Google.Wrapped
-- Rendering formats
, Rendering.Graph
2017-11-27 21:30:38 +03:00
, Rendering.JSON
, Rendering.TOC
, Reprinting.Tokenize
, Reprinting.Translate
2018-08-03 19:47:54 +03:00
, Reprinting.Typeset
2018-07-31 19:44:20 +03:00
, Reprinting.Pipeline
-- High-level flow & operational functionality (logging, stats, etc.)
, Semantic.Analysis
-- API
, Semantic.Api
, Semantic.Api.Diffs
2019-03-01 23:27:13 +03:00
, Semantic.Api.Bridge
, Semantic.Api.LegacyTypes
, Semantic.Api.Symbols
, Semantic.Api.Terms
, Semantic.Api.TOCSummaries
, Semantic.Api.V1.CodeAnalysisPB
, Semantic.AST
, Semantic.CLI
2018-06-08 20:48:38 +03:00
, Semantic.Config
2018-04-04 18:23:21 +03:00
, Semantic.Distribute
2018-06-07 02:17:44 +03:00
, Semantic.Env
2018-04-09 20:57:12 +03:00
, Semantic.Graph
2017-11-27 21:09:03 +03:00
, Semantic.IO
, Semantic.REPL
, Semantic.Resolution
2017-05-29 20:11:17 +03:00
, Semantic.Task
, Semantic.Task.Files
, Semantic.Telemetry
2018-06-14 02:39:13 +03:00
, Semantic.Telemetry.AsyncQueue
, Semantic.Telemetry.Haystack
, Semantic.Telemetry.Log
, Semantic.Telemetry.Stat
2018-09-14 00:20:42 +03:00
, Semantic.Timeout
, Semantic.Util
, Semantic.Util.Pretty
, Semantic.Version
-- Serialization
, Serializing.Format
, Serializing.SExpression
2018-10-31 18:34:38 +03:00
, Tags.Taggable
, Tags.Tagging
-- Custom Prelude
2018-05-23 21:04:15 +03:00
, Prologue
2016-10-06 04:47:47 +03:00
build-depends: base >= 4.8 && < 5
2017-05-19 23:03:44 +03:00
, ansi-terminal
, array
, attoparsec
2017-08-03 10:22:40 +03:00
, cmark-gfm
2018-06-08 20:12:45 +03:00
, cryptohash
Add NFData instances to enable more accurate benchmarking. Because we're getting serious about benchmarking in the run-up to Windrose, it's time to bring in the `deepseq` package to ensure that benchmarks can fully evaluate the result of a test case. The `deepseq` package provides an `NFData` typeclass: ``` class NFData a where rnf :: a -> () ``` Instances use the `seq` combinator to ensure that the argument to `rnf` is fully evaluated, returning (). If there is a `Generic` instance for `a`, the implementation can be omitted. This patch adds NFData for every syntax node, graph vertex, environment data structures, and exceptions. It is long, but the work is very straightforward, so don't panick. The benchmark suite (`stack bench`) now produces more accurate results. The benchmarks previously mimicked `rnf` by calling `show` on the result of an evaluation or graph construction; now that we have actual `NFData` instances we can use the `nfIO` combinator from criterion. This has sped up the evaluation benchmarks and reduced their memory consumption, while it has slowed down the call graph benchmarks, as those benchmarks weren't evaluating the whole of the graph. Unfortunately, this patch increases compile times, as we have to derive a few more Generic instances. I wish this weren't the case, but there's little we can do about it now. In the future I have some plans for how to reduce compile time, and I bet that those gains will at least nullify the speed hit from this patch. Now that we have NFData instances for every data type, we can start benchmarking assignments, in preparation for fixing #2205. This patch also pulls in updates to `effects` and `fastsum` that add appropriate NFData instances for the data they vend.
2018-10-17 21:08:47 +03:00
, deepseq
, directory-tree
, freer-cofreer
, generic-monoid
, ghc-prim
2016-10-06 19:03:06 +03:00
, gitrev
2018-08-03 16:25:52 +03:00
, haskeline
, hostname
, hscolour
2018-06-08 20:12:45 +03:00
, http-client
, http-client-tls
, http-types
, http-media
, kdt
, lens
, mersenne-random-pure64
, network-uri
2016-10-06 04:47:47 +03:00
, optparse-applicative
2017-04-04 17:57:18 +03:00
, parallel
2017-08-06 18:21:35 +03:00
, parsers
2018-07-31 19:44:20 +03:00
, prettyprinter
, pretty-show
2018-09-14 19:47:21 +03:00
, profunctors
2018-03-07 19:27:17 +03:00
, reducers
2018-03-14 16:30:45 +03:00
, semigroupoids
2019-01-17 02:39:07 +03:00
, servant
2017-04-03 22:26:28 +03:00
, split
, stm-chans
, template-haskell
, time
2017-07-31 18:56:17 +03:00
, unix
, unordered-containers
2018-06-13 19:47:35 +03:00
, vector
, haskell-tree-sitter
2017-08-11 15:03:27 +03:00
, tree-sitter-go
, tree-sitter-haskell
2017-08-11 15:03:55 +03:00
, tree-sitter-json
2017-12-15 22:14:08 +03:00
, tree-sitter-php
2017-08-11 15:06:08 +03:00
, tree-sitter-python
2017-08-11 15:06:37 +03:00
, tree-sitter-ruby
2017-08-11 15:07:03 +03:00
, tree-sitter-typescript
2018-03-16 01:53:55 +03:00
, tree-sitter-java
2019-02-19 22:20:33 +03:00
ghc-options: -Wall -Wmissing-export-lists -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -fno-warn-name-shadowing -j
if flag(release)
ghc-options: -Werror -O1
2019-02-11 23:08:24 +03:00
cpp-options: -DCOMPUTE_GIT_SHA
else
ghc-options: -O0 +RTS -A128m -n2m -RTS
ghc-prof-options: -fprof-auto
2015-11-18 01:44:16 +03:00
2017-04-03 19:28:53 +03:00
executable semantic
2019-02-19 22:31:16 +03:00
import: haskell, dependencies, executable-flags
2016-10-06 02:17:46 +03:00
hs-source-dirs: app
main-is: Main.hs
if flag(release)
ghc-options: -O1
cpp-options: -DCOMPUTE_GIT_SHA
else
2019-02-19 22:31:16 +03:00
ghc-options: -O0 -dynamic
2016-10-06 02:17:46 +03:00
build-depends: base
2018-02-26 21:16:56 +03:00
, semantic
2016-10-06 02:17:46 +03:00
2016-09-15 00:12:06 +03:00
test-suite test
2019-02-19 22:31:16 +03:00
import: haskell, dependencies, executable-flags
2015-11-18 01:44:16 +03:00
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: Spec.hs
2018-05-07 21:20:56 +03:00
other-modules: Analysis.Go.Spec
, Analysis.PHP.Spec
, Analysis.Python.Spec
2018-03-14 02:19:26 +03:00
, Analysis.Ruby.Spec
2018-03-10 02:54:52 +03:00
, Analysis.TypeScript.Spec
2018-05-07 21:20:56 +03:00
, Assigning.Assignment.Spec
2018-05-07 21:21:05 +03:00
, Control.Abstract.Evaluator.Spec
, Data.Abstract.Path.Spec
2018-10-31 20:19:43 +03:00
, Data.Abstract.Name.Spec
2018-07-20 16:52:43 +03:00
, Data.Diff.Spec
, Data.Functor.Classes.Generic.Spec
, Data.Functor.Listable
2018-10-31 19:20:38 +03:00
, Data.Graph.Spec
2018-07-20 16:52:43 +03:00
, Data.Mergeable
2018-10-31 19:46:52 +03:00
, Data.Range.Spec
, Data.Scientific.Spec
2018-10-31 22:47:30 +03:00
, Data.Semigroup.App.Spec
2017-11-27 21:49:52 +03:00
, Data.Source.Spec
2017-11-27 22:02:03 +03:00
, Data.Term.Spec
2017-11-27 21:48:43 +03:00
, Diffing.Algorithm.RWS.Spec
2017-11-27 21:51:05 +03:00
, Diffing.Algorithm.SES.Spec
2017-11-27 22:03:45 +03:00
, Diffing.Interpreter.Spec
2018-07-16 18:07:40 +03:00
, Graphing.Calls.Spec
2017-11-27 22:06:12 +03:00
, Integration.Spec
, Numeric.Spec
, Parsing.Spec
2018-07-31 17:43:46 +03:00
, Reprinting.Spec
2018-12-12 01:21:39 +03:00
, Rewriting.Go.Spec
2018-12-12 01:36:42 +03:00
, Rewriting.JSON.Spec
2018-12-13 20:04:06 +03:00
, Rewriting.Python.Spec
2017-11-27 22:04:58 +03:00
, Rendering.TOC.Spec
2017-11-27 22:00:53 +03:00
, Semantic.Spec
2017-11-27 21:57:25 +03:00
, Semantic.CLI.Spec
2017-11-27 21:52:48 +03:00
, Semantic.IO.Spec
2017-11-27 21:58:23 +03:00
, Semantic.Stat.Spec
2018-11-02 23:55:30 +03:00
, Tags.Spec
, SpecHelpers
, Test.Hspec.LeanCheck
2019-02-19 22:20:33 +03:00
build-depends: semantic
, tree-sitter-json
, hspec >= 2.4.1
2017-01-08 07:16:27 +03:00
, hspec-core
2016-10-06 04:47:47 +03:00
, hspec-expectations-pretty-diff
2017-02-14 17:57:21 +03:00
, HUnit
2017-01-08 07:16:27 +03:00
, leancheck
2019-02-19 22:31:16 +03:00
ghc-options: -O0
if flag(release)
2019-02-19 22:31:16 +03:00
ghc-options: -dynamic
2015-11-18 01:44:16 +03:00
test-suite parse-examples
2019-02-19 22:20:33 +03:00
import: haskell, dependencies
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: Examples.hs
2019-02-19 22:20:33 +03:00
build-depends: semantic
, hspec >= 2.4.1
, hspec-core
, hspec-expectations-pretty-diff
, process
2018-03-08 03:34:20 +03:00
benchmark evaluation
2019-02-19 22:31:16 +03:00
import: haskell, executable-flags
Add NFData instances to enable more accurate benchmarking. Because we're getting serious about benchmarking in the run-up to Windrose, it's time to bring in the `deepseq` package to ensure that benchmarks can fully evaluate the result of a test case. The `deepseq` package provides an `NFData` typeclass: ``` class NFData a where rnf :: a -> () ``` Instances use the `seq` combinator to ensure that the argument to `rnf` is fully evaluated, returning (). If there is a `Generic` instance for `a`, the implementation can be omitted. This patch adds NFData for every syntax node, graph vertex, environment data structures, and exceptions. It is long, but the work is very straightforward, so don't panick. The benchmark suite (`stack bench`) now produces more accurate results. The benchmarks previously mimicked `rnf` by calling `show` on the result of an evaluation or graph construction; now that we have actual `NFData` instances we can use the `nfIO` combinator from criterion. This has sped up the evaluation benchmarks and reduced their memory consumption, while it has slowed down the call graph benchmarks, as those benchmarks weren't evaluating the whole of the graph. Unfortunately, this patch increases compile times, as we have to derive a few more Generic instances. I wish this weren't the case, but there's little we can do about it now. In the future I have some plans for how to reduce compile time, and I bet that those gains will at least nullify the speed hit from this patch. Now that we have NFData instances for every data type, we can start benchmarking assignments, in preparation for fixing #2205. This patch also pulls in updates to `effects` and `fastsum` that add appropriate NFData instances for the data they vend.
2018-10-17 21:08:47 +03:00
hs-source-dirs: bench/evaluation
2018-05-21 18:17:11 +03:00
type: exitcode-stdio-1.0
main-is: Main.hs
2019-02-19 22:31:16 +03:00
ghc-options: -static -O1
2018-05-21 18:17:11 +03:00
build-depends: base
, criterion
, semantic
2018-03-08 03:34:20 +03:00
2015-11-18 01:44:16 +03:00
source-repository head
type: git
2018-02-26 21:16:56 +03:00
location: https://github.com/github/semantic