1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 14:21:31 +03:00
Commit Graph

25838 Commits

Author SHA1 Message Date
Patrick Thomson
be9ffa49d3 Remove inaccurate TODO. 2018-10-23 11:25:55 -04:00
Patrick Thomson
d8a7b2edfb Add TREE_SITTER_ASSIGNMENT_TIMEOUT environment variable.
Now that #2223 is fixed, we're encountering certain large files,
such as[this](https://github.com/golang/text/blob/master/collate/tables.go),
that parse in an acceptable window but that take a tremendously long
time to assign. As such, it behooves us to provide a mechanism to
specify assignment timeouts, independent of the tree-sitter parse timeout.

I copied the Dockerfile/default values from those specified for
TREE_SITTER_PARSE_TIMEOUT. I am open to suggestions as to different
values.

ccing @tclem on this to make sure I haven't screwed anything up w/r/t Docker.
2018-10-23 11:21:34 -04:00
Patrick Thomson
8630d20030 Merge pull request #2229 from github/monadfail-desugaring
Turn on `-XMonadFailDesugaring` globally.
2018-10-22 21:44:45 -04:00
Patrick Thomson
316915a80b Merge branch 'master' into monadfail-desugaring 2018-10-22 21:04:34 -04:00
Patrick Thomson
0134a3ce67 Merge pull request #2228 from github/bump-ts-ruby
Bump tree-sitter-ruby.
2018-10-22 21:04:25 -04:00
Patrick Thomson
bfee125016 Merge branch 'master' into monadfail-desugaring 2018-10-22 17:43:26 -04:00
Timothy Clem
def59bb851 Merge branch 'master' into bump-ts-ruby 2018-10-22 14:35:16 -07:00
Timothy Clem
d5ddbb390e Merge pull request #2225 from github/operating-docs-updates
Operating docs notes
2018-10-22 14:34:39 -07:00
Patrick Thomson
cffcd15b5e Merge branch 'master' into bump-ts-ruby 2018-10-22 16:28:25 -04:00
Timothy Clem
8d3e921f6b Merge branch 'master' into operating-docs-updates 2018-10-22 13:11:09 -07:00
Timothy Clem
d04b9d8dbe Merge pull request #2219 from github/better-terminal-log-config
Check stdout so semanticd logging works well with Procfiles
2018-10-22 13:10:59 -07:00
Patrick Thomson
8800f7072e Turn on -XMonadFailDesugaring globally.
In the past few years, GHC has been moving to remove the `fail` method
from the definition of `Monad`, a longtime wart, and requiring monads
that fail due to an incomplete pattern match to implement `MonadFail`.
You can read about it[here](https://wiki.haskell.org/MonadFail_Proposal).
Though this move is still in progress, we can opt into it by turning
on the `-XMonadFailDesugaring` extension.

The matching and rewriting systems will both benefit from this, as the
incomplete pattern match in following rewrite rule will crash without
`-XMonadFailDesugaring`, even though the sensible and correct thing
for the rule to do is call out to its `MonadFail` instance:

```haskell
-- crashes the program without -XMonadFailDesugaring
getReceiver :: Rule a (Ruby.Send term) term
getReceiver = do
  (Ruby.Send (Just rec) _ _ _) <- target
  pure rec
```

In addition, turning on `MonadFailDesugaring` will warn you if you put
an incomplete pattern match in a monad that doesn't implement `MonadFail`.
This setting will become implicit in GHC 8.6, so this is a good chance
to make sure that we don't introduce any incomplete patterns going forward.
2018-10-22 14:07:48 -04:00
Patrick Thomson
54fb762cf1 Bump tree-sitter-ruby.
The bumped version of tree-sitter-ruby did not make it into #2223 due
to an error on my part. This halves the time it takes to parse the
pathological lexer.rb file.
2018-10-22 13:55:52 -04:00
Timothy Clem
32c49a918f Merge branch 'master' into better-terminal-log-config 2018-10-22 09:29:41 -07:00
Patrick Thomson
c5d75c41f3 Merge pull request #2223 from github/fix-node-copy-slowdown
Fix massive slowdown when copying large AST nodes.
2018-10-22 11:56:04 -04:00
Timothy Clem
24f4161ae9 Merge branch 'master' into operating-docs-updates 2018-10-22 08:26:25 -07:00
Timothy Clem
75af0f8e69 Merge branch 'master' into better-terminal-log-config 2018-10-22 08:20:53 -07:00
Patrick Thomson
71e8991b6e pull in new tree-sitter 2018-10-21 17:25:09 -04:00
Patrick Thomson
eb10ece4a7 lints 2018-10-21 15:35:18 -04:00
Patrick Thomson
d0c8fdf935 Fix massive slowdown when copying large AST nodes.
As per https://github.com/tree-sitter/haskell-tree-sitter/pull/67, we
weren't using the right tree-sitter APIs to copy node children into a
Haskell-compatible data structure. This bumps tree-sitter-haskell and
adjusts the change in signature of ts_node_copy_child_nodes.
2018-10-21 15:19:38 -04:00
Patrick Thomson
3ae2ddf7be Merge pull request #2215 from github/avoid-recompiling-git
Prevent unnecessary recompilation of Semantic.Version in dev mode.
2018-10-19 17:05:22 -04:00
Patrick Thomson
1d7f4aba2c Merge branch 'master' into avoid-recompiling-git 2018-10-19 12:57:08 -04:00
Patrick Thomson
a0484ed20d Merge pull request #2220 from github/fail-on-parse-error
Add a flag to fail fast on tree-sitter parse errors
2018-10-19 12:53:08 -04:00
Timothy Clem
4d1f079855 Add a flag to fail fast on tree-sitter parse errors 2018-10-18 15:23:43 -07:00
Patrick Thomson
7c8e8c5bf5 Merge remote-tracking branch 'origin/master' into avoid-recompiling-git 2018-10-18 17:22:18 -04:00
Patrick Thomson
99af3a1799 Fix inaccuracy in comments. 2018-10-18 17:12:49 -04:00
Patrick Thomson
2ea6747370 Merge pull request #2217 from github/ghc-rtsopts
[Experiment] Improve compile speed with larger GHC allocation area
2018-10-18 17:09:55 -04:00
Timothy Clem
409b94456a Check stdout so this works with Procfiles 2018-10-18 12:34:18 -07:00
Patrick Thomson
b9d4201ddb Merge branch 'master' into ghc-rtsopts 2018-10-18 13:05:37 -04:00
Josh Vera
efde121720 Merge branch 'master' into avoid-recompiling-git 2018-10-18 11:28:18 -04:00
Josh Vera
f458fe580c Merge pull request #2206 from github/quiet-parsing
New cli switch for quiet parsing with timing stats
2018-10-18 11:27:11 -04:00
Josh Vera
b5714f28c4 Merge branch 'master' into quiet-parsing 2018-10-18 10:55:45 -04:00
Patrick Thomson
f4b5f0d44e [Experiment] Improve compile speed with larger GHC allocation area 2018-10-17 21:27:22 -04:00
Patrick Thomson
26da3d463a Merge pull request #2216 from github/split-up-haskell-syntax
Split up Language.Haskell.Syntax into child modules.
2018-10-17 21:27:03 -04:00
Patrick Thomson
379d75f284 Split up Language.Haskell.Syntax into child modules.
This was the longest (in terms of line count) file in the project.
Splitting it up will save on compile time, as it did for TypeScript.
I observe a ~20sec speedup from `stack clean semantic && stack build semantic:lib`
2018-10-17 18:57:29 -04:00
Patrick Thomson
bcc084f5ac move the TH import inside the ifdef 2018-10-17 17:38:35 -04:00
Patrick Thomson
b361c9ef79 Prevent unnecessary recompilation of Semantic.Version in dev mode.
Right now, Semantic.Version is recompiled on every invocation of
`stack build`, since we marked it as `-fforce-recomp` to ensure that
all deployments are tagged appropriately for haystack. However, this
entails a good deal of wasted time during development. With some
liberal application of `CPP`, we can make this recompilation only
happen on CI, thanks to the `release` flag and passing in a compiler
flag.

To test:

* apply the patch
* `stack build semantic`, then `stack exec semantic -- -v`. It should
  print `semantic version 0.4.0 (<development>)`.
* `stack clean semantic && stack build --ghc-options=-DCOMPUTE_GIT_SHA`.
  `stack exec semantic -- -v` should then print out the correct SHA.

Though it's probably not strictly necessary, I've marked the
`semantic` and `semanticd` executables to compile with
-DCOMPUTE_GIT_SHA, just in case.
2018-10-17 17:24:14 -04:00
Patrick Thomson
42bb569ba9 Merge pull request #2214 from github/nfdata-instances
Add NFData instances to enable more accurate benchmarking.
2018-10-17 16:43:12 -04:00
Patrick Thomson
f911b43b63 fix lints 2018-10-17 14:38:30 -04:00
Patrick Thomson
ac543651ee 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 14:08:47 -04:00
Timothy Clem
a19d8bd02e Revert removal of wait 2018-10-17 10:03:46 -07:00
Ayman Nadeem
1dce4b089b Merge branch 'quiet-parsing' of https://github.com/github/semantic into quiet-parsing 2018-10-17 12:12:23 -04:00
Ayman Nadeem
97b6c48c95 remove results 2018-10-17 12:12:12 -04:00
Timothy Clem
3b0a19238f Merge branch 'quiet-parsing' of github.com:github/semantic into quiet-parsing 2018-10-17 08:37:21 -07:00
Timothy Clem
070c15a947 Merge remote-tracking branch 'origin/master' into quiet-parsing 2018-10-17 08:18:33 -07:00
Patrick Thomson
abce41c1e1 Merge pull request #2211 from github/bracket-effect
Fix crash/race associated with `bracket` (#2207)
2018-10-16 23:34:04 -04:00
Patrick Thomson
d3db754004 weirdness in tests 2018-10-16 23:04:39 -04:00
Patrick Thomson
d56badfb29 Use upstream Resource effect. 2018-10-16 20:11:38 -04:00
Ayman Nadeem
f0dcd1d2fc attempt to make this less manual 2018-10-16 18:01:28 -04:00
Timothy Clem
602432359b Merge remote-tracking branch 'origin/bracket-effect' into quiet-parsing 2018-10-16 14:57:14 -07:00