Commit Graph

10242 Commits

Author SHA1 Message Date
Ethan Atkins 9b24e9f9eb Use ConcurrentLinkedDeque for EventHandler
ArrayList::add is not thread safe. I ran into cases where async tests
using utests would fail even when all of the individual tests passed.
This was because multiple threads called back into the handle method of
the handler instance variable, which just delegated to eventList::add.
When this happened, one of the events would get added to the list as a
null reference, which would manifest as an NPE upstream on the master
process. After this change, my tests stopped failing.
2018-03-21 10:50:30 -07:00
Ethan Atkins 8eb2d7389d Add test for async utest TestSuites
Sometimes when utest runs async tests (i.e. tests that return a future)
the test suite will fail even when none of the individual tests do. This
is due to a data race in sbt. Most, but not all, of the time, this test
will induce that race.
2018-03-21 10:41:41 -07:00
Dale Wijnand ca874d5d5f
Merge pull request #4017 from dwijnand/cleanup/CommandChannel
Cleanup CommandChannel
2018-03-20 11:05:16 +00:00
Dale Wijnand 00ce32f102
Cleanup CommandChannel 2018-03-20 09:17:55 +00:00
Dale Wijnand fe418c92a7
Merge pull request #4016 from dwijnand/cleanup/Watched
Make Watched use State#handleError
2018-03-20 08:54:18 +00:00
Dale Wijnand b23980ce1b
Merge pull request #4018 from dwijnand/cleanup/NetworkChannel
Cleanup NetworkChannel
2018-03-20 08:54:04 +00:00
Dale Wijnand 9c0ac90ee9
Make Watched use State#handleError 2018-03-19 15:21:15 +00:00
Dale Wijnand 6ceed00f48
Cleanup NetworkChannel 2018-03-19 15:11:39 +00:00
Eugene Yokota 862ae293ba include only scala-library into the boot classpath during run
Fixes https://github.com/sbt/sbt/issues/3405
Ref https://github.com/scala/scala-xml/issues/195

sbt's `run` is emulated using a classloader trick that includes ScalaInstance as the parent classloader under the classpath. The problem is the ScalaInstance classloader currently contains both compiler, library, and their transitive JARs:

```scala
res0: Array[java.io.File] = Array(scala-library.jar, scala-compiler.jar, jline.jar, scala-reflect.jar, scala-xml_2.12.jar)
```

This could have been causing various issues, but most recently it showed up as wrong version of scala-xml getting prioritized over what's passed by the user.

1. new field loaderLibraryOnly is added to xsbti.ScalaInstance.
2. it is initialized to the library loader if the launcher creates it, otherwise create layered loader here.

This aims to isolate the library loader, and retain the perf.
2018-03-19 18:45:42 +09:00
Dale Wijnand c6df309073
Merge pull request #4025 from tiqwab/fix-parsing-id
Fix handling id in jsonrpc model
2018-03-18 16:35:44 +00:00
Naohisa Murakami 9d01bdff68
Merge pull request #1 from eed3si9n/wip/fix-parsing-id
Add test case for number id in JSON-RPC
2018-03-18 07:38:25 +09:00
Eugene Yokota e5d2588927 Add test case for number id in JSON-RPC 2018-03-18 02:11:23 +09:00
tiqwab a5119a411c Fix handling id in jsonrpc model
Fix #3861
2018-03-17 22:41:47 +09:00
Dale Wijnand 6abf4c9e00
Merge pull request #4022 from tmiyamon/support-vscode-test-compile
support test compile on saving in vscode
2018-03-16 10:12:32 +00:00
tmiyamon 77ffbe896d support test compile on saving in vscode 2018-03-16 18:03:52 +09:00
eugene yokota 571417dc6f
Merge pull request #4019 from itohiro73/improve-contributing
Improve instruction for locally built sbt in CONTRIBUTING.md
2018-03-16 15:24:22 +09:00
Hiroshi Ito 04ab2d30e1 Improve instruction for locally built sbt in CONTRIBUTING.md 2018-03-16 15:07:17 +09:00
eugene yokota 4efce7e877
Merge pull request #3991 from dwijnand/ExecStatusEvent-exitCode
Add an optional exitCode to ExecStatusEvent so clients can use it
2018-03-16 00:27:17 +09:00
Dale Wijnand 933668076a
Merge pull request #3989 from dwijnand/cleanup-lsp
Cleanup some parts of the LSP impl
2018-03-15 13:57:44 +00:00
Dale Wijnand 5f56fa9f14
Extract serializeResponse 2018-03-15 12:55:21 +00:00
Dale Wijnand d3ef452a5f
Extract jsonRpcRespondErrorImpl 2018-03-15 12:55:21 +00:00
Dale Wijnand 268b5111ab
Format LSP methods 2018-03-15 12:55:21 +00:00
Dale Wijnand de690f4e41
Collapse 1-line scaladocs 2018-03-15 12:55:20 +00:00
Dale Wijnand 087f21741d
Merge pull request #3975 from eed3si9n/wip/serverext
make sbt server extensible
2018-03-15 01:58:07 +00:00
Dale Wijnand 98332c0891
Reply to sbt/exec w/ a Response/Error w/ error code 2018-03-14 13:56:29 +00:00
Dale Wijnand bde6365013
Add an optional exitCode to ExecStatusEvent so clients can use it 2018-03-14 11:56:51 +00:00
Dale Wijnand 7baf97d2a6
Introduce ErrorCodes.UnknownError
Defined in the application defined errors range.
2018-03-14 11:56:51 +00:00
Dale Wijnand 3530349e9a
Rename ErrorCodes' UnknownErrorCode to UnknownServerError
Allows for a non-server-specific unknown error code to be defined.
2018-03-14 11:56:50 +00:00
Dale Wijnand 8972287892
Cleanup ErrorCodes 2018-03-14 11:56:29 +00:00
Eugene Yokota 0433440c59 move ServerHandler to internal per review 2018-03-13 23:42:40 +09:00
Eugene Yokota f13465246c include the full body in debug message 2018-03-13 23:02:45 +09:00
Eugene Yokota cd9f0d2711 make sbt server extensible
Fixes #3890

Here's an example:

```scala
    Global / serverHandlers += ServerHandler({ callback =>
      import callback._
      import sjsonnew.BasicJsonProtocol._
      import sbt.internal.protocol.JsonRpcRequestMessage
      ServerIntent(
        {
          case r: JsonRpcRequestMessage if r.method == "lunar/helo" =>
            jsonRpcNotify("lunar/oleh", "")
            ()
        },
        PartialFunction.empty
      )
```
2018-03-13 23:02:45 +09:00
Eugene Yokota d4cdb11b53 typo fix 2018-03-13 17:47:11 +09:00
Dale Wijnand dd4de14593
Upgrade to contraband 0.4.0 2018-03-12 15:39:07 +00:00
Eugene Yokota 07e26a1dcf don't use toStream
Ref #3979
toStream doesn't help performance.
2018-03-10 18:43:43 -05:00
Eugene Yokota d2f2a90d5e handroll for-expression
Ref https://github.com/sbt/sbt/pull/3979

Based on #3979 this handrolls the for-express using while.
2018-03-10 18:43:43 -05:00
Eugene Yokota b82a1870a7 add tests around scope delegation 2018-03-10 17:24:39 -05:00
eugene yokota 3559de06aa
Merge pull request #3999 from eed3si9n/wip/cache-watch-service
[bport] Cache watch service
2018-03-09 17:42:11 -05:00
Ethan Atkins 5df1d8e23f Cache watch service
I noticed that my custom WatchService was never cleaned up by sbt and
realized that after every build we were making a new WatchService. At
the same time, we were reusing the WatchState from the previous run,
which was using the original WatchService. This was particularly
problematic because it prevented us from registering any paths with the
new watch service. This may have prevented some of the file updates
from being seen by the watch service. Moreover, because we lost the
reference to the original WatchService, there was no way to clean it up,
which was a resource leak.

May be related to #3775, #3695
2018-03-09 06:11:52 -05:00
Dale Wijnand ed5a8c118b
Upgrade to contraband 0.3.3 2018-03-08 12:49:38 +00:00
Dale Wijnand 80d342a811
Merge pull request #3995 from ruippeixotog/cross-strict-aggregation
Filter incompatible aggregates in cross switch commands
2018-03-08 11:27:55 +00:00
Dale Wijnand a85d7606f3
Merge pull request #3994 from fmlrt/in_configuration_scope_filter_factories
Add more configuration axis ScopeFilter factory methods
2018-03-08 11:26:38 +00:00
eugene yokota ec93e3e9d5
Merge pull request #3947 from exoego/global-eviction-warning-options
Add the eviction warnings options to global
2018-03-07 20:40:24 -05:00
TATSUNO Yasuhiro 68f58aba87
Merge branch '1.x' into global-eviction-warning-options 2018-03-08 09:18:53 +09:00
eugene yokota 051d09e921
Merge pull request #3998 from eed3si9n/wip/fix-3143
Add test to confirm leak is gone
2018-03-07 18:16:58 -05:00
exoego dc4f93a7c3 Remove unnecessary GlobalScope 2018-03-08 08:14:39 +09:00
eugene yokota 92c95ce290
Merge pull request #3997 from eed3si9n/wip/test-status-thread-safety
Fix race condition in non-forked, parallel tests.
2018-03-07 16:18:55 -05:00
jvican f24e5f2136 Add test to confirm leak is gone
The following commit adds the test case used to report #3143 in a big
projects with lots of cross versions and modules. The execution of the
test is instant!
2018-03-07 16:15:29 -05:00
Eugene Yokota 49b4c3a3e0 mima 2018-03-07 15:31:24 -05:00
Dale Wijnand 10275489d8
Merge pull request #3987 from dwijnand/document-Rich-Init-classes
Document RichInitX classes
2018-03-07 09:44:19 +00:00