Commit Graph

881 Commits

Author SHA1 Message Date
Eugene Yokota 72acc5ce74 lm-coursier-shaded 2.0.0-RC6-9
https://github.com/coursier/sbt-coursier/releases/tag/v2.0.0-RC6-9
2020-09-14 22:44:16 -04:00
Ethan Atkins 2921dfa005 Bump sbt version 2020-09-07 09:49:43 -07:00
Eugene Yokota 47842f51f8 Zinc 1.4.0-M12 2020-09-06 16:04:47 -04:00
Eugene Yokota 1bd842856f IO 1.4.0-M8, Zinc 1.4.0-M11 2020-09-06 04:50:52 -04:00
Ethan Atkins c01be0395d Bump sbt build to 1.4.0-M2 2020-08-19 09:26:27 -07:00
Eugene Yokota 755fbf4dcd Add exportPipelining setting to implement subproject opt-out
Fixes https://github.com/sbt/sbt/issues/5762
Fixes https://github.com/sbt/sbt/issues/5754

Ref https://github.com/sbt/zinc/pull/883
2020-08-16 15:47:44 -04:00
Eugene Yokota 4a77613250 CompileOrder must be Mixed 2020-08-16 04:43:29 -04:00
Eugene Yokota d6fa4ccc93 Zinc 1.4.0-M9 2020-08-15 13:20:46 -04:00
Eugene Yokota 54aeba1607 Contraband 0.5.0 2020-08-15 13:20:46 -04:00
Eugene Yokota c85e5b8bc0 Upgrade scala version to 2.12.12
This introduces `Def.unit(...)` to workaround the pure expression does nothing warning.
2020-08-11 23:33:12 -04:00
Ethan Atkins 90dacc339c Support scala 2.13 console in thin client
In order to make the console task work with scala 2.13 and the thin
client, we need to provide a way for the scala repl to use an sbt
provided jline3 terminal instead of the default terminal typically built
by the repl. We also need to put jline 3 higher up in the classloading
hierarchy to ensure that two versions of jline 3 are not loaded (which
makes it impossible to share the sbt terminal with the scala terminal).

One impact of this change is the decoupling of the version of
jline-terminal used by the in process scala console and the version
of jline-terminal specified by the scala version itself. It is possible
to override this by setting the `useScalaReplJLine` flag to true. When
that is set, the scala REPL will run in a fully isolated classloader. That
will ensure that the versions are consistent. It will, however, for sure
break the thin client and may interfere with the embedded shell ui.

As part of this work, I also discovered that jline 3 Terminal.getSize is
very slow. In jline 2, the terminal attributes were automatically cached with a
timeout of, I think, 1 second so it wasn't a big deal to call
Terminal.getAttributes. The getSize method in jline 3 is not cached and
it shells out to run a tty command. This caused a significant
performance regression in sbt because when progress is enabled, we call
Terminal.getSize whenever we log any messages. I added caching of
getSize at the TerminalImpl level to address this. The timeout is 1
second, which seems responsive enough for most use cases. We could also
move the calculation onto a background thread and have it periodically
updated, but that seems like overkill.
2020-08-09 17:12:15 -07:00
Ethan Atkins 525cff7fd7 Use java caffeine library rather than scalacache
sbt depends on scalacache (which hasn't been updated in about a year)
and we really don't need the functionality provided by scalacache. In
fact, the java api is somewhat easier to work with for our use case. The
motivation is that scalacache uses slf4j for logging which meant that it
was implicitly loading log4j. This caused some noisy logs during
shutdown when the previously unused cache was initialized just to be
cleaned up.

This commit also upgrades caffeine and moving forward we can always
upgrade caffeine (and potentially shade it) without any conflict with
the scalacache version.
2020-08-07 17:18:09 -07:00
eugene yokota a59d9fbb97
Merge branch 'develop' into wip/versionscheme 2020-08-06 21:04:21 -04:00
Eugene Yokota 002f97cae7 Build pipelining
Ref https://github.com/sbt/zinc/pull/744

This implements `ThisBuild / usePipelining`, which configures subproject pipelining available from Zinc 1.4.0.

The basic idea is to start subproject compilation as soon as pickle JARs (early output) becomes available. This is in part enabled by Scala compiler's new flags `-Ypickle-java` and `-Ypickle-write`.

The other part of magic is the use of `Def.promise`:

```
earlyOutputPing := Def.promise[Boolean],
```

This notifies `compileEarly` task, which to the rest of the tasks would look like a normal task but in fact it is promise-blocked. In other words, without calling full `compile` task together, `compileEarly` will never return, forever waiting for the `earlyOutputPing`.
2020-08-06 02:31:01 -04:00
Eugene Yokota f947970247 versionScheme setting + better eviction warning
Ref https://github.com/sbt/sbt/issues/5710
Ref https://github.com/sbt/librarymanagement/pull/339

This adds `versionScheme` setting. When set, it is included into POM, and gets picked up on the other side as an extra attribute of ModuleID. That information in turn is used to inform the eviction warning.

This should reduce the false positives associated with SemVer'ed libraries showing up in the eviction warning.
2020-08-05 18:11:02 -04:00
eugene yokota e76f61bec5
Merge pull request #5575 from eed3si9n/wip/bump
update to lm-coursier-shaded 2.0.0-RC6-8
2020-08-01 17:13:01 -04:00
Eugene Yokota 2bebee4dfe lm-coursier-shaded 2.0.0-RC6-8
https://github.com/coursier/sbt-coursier/releases/tag/v2.0.0-RC6-5
https://github.com/coursier/sbt-coursier/releases/tag/v2.0.0-RC6-6
https://github.com/coursier/sbt-coursier/releases/tag/v2.0.0-RC6-7
https://github.com/coursier/sbt-coursier/releases/tag/v2.0.0-RC6-8

Ref https://github.com/coursier/sbt-coursier/pull/235
Ref https://github.com/coursier/sbt-coursier/pull/262
2020-08-01 15:51:19 -04:00
eugene yokota b345205c28
Merge pull request #5700 from eed3si9n/wip/bumpzinc
Drop unused Scala X-Ray (sxr) integration
2020-07-27 17:45:50 -04:00
Ethan Atkins 4698f388e9 Remove lint warnings in sbt build
There were a number of unused key lint warnings when loading the sbt
build. In the case of `fork in compile` and `crossVersion in update`, it
wasn't clear that these were actually used, so I removed those settings.
The others seemed to be used so I just added them to the exclude list.

To make this work with legacy versions of sbt, I redefined the
excludeLintKeys key. Once we update the build.properties to a 1.4.x
version, we can drop the `val excludeLint` definition and replace
`excludeLint` with `excludeLintKeys`.

Side note: ++= does not work with excludeLintKeys which is why I used +=
for the excludes.
2020-07-27 09:37:53 -07:00
Eugene Yokota 44e39ec15e Drop unused Sxr 2020-07-25 15:26:35 -04:00
Eugene Yokota 7741b9ae2d Zinc 1.4.0-M7 2020-07-24 23:50:54 -04:00
Ethan Atkins bc4fe0a31a Cross build collectionProj 2020-07-10 13:37:54 -07:00
Ethan Atkins 2ecf5967ee Upgrade LineReader to JLine3
This commit upgrades sbt to using jline3. The advantage to jline3 is
that it has a significantly better tab completion engine that is more
similar to what you get from zsh or fish.

The diff is bigger than I'd hoped because there are a number of
behaviors that are different in jline3 vs jline2 in how the library
consumes input streams and implements various features. I also was
unable to remove jline2 because we need it for older versions of the
scala console to work correctly with the thin client. As a result, the
changes are largely additive.

A good amount of this commit was in adding more protocol so that the
remote client can forward its jline3 terminal information to the server.

There were a number of minor changes that I made that either fixed
outstanding ui bugs from #5620 or regressions due to differences between
jline3 and jline2.

The number one thing that caused problems is that the jline3 LineReader
insists on using a NonBlockingInputStream. The implementation ofo
NonBlockingInputStream seems buggy. Moreover, sbt internally uses a
non blocking input stream for system in so jline is adding non blocking
to an already non blocking stream, which is frustrating.

A long term solution might be to consider insourcing LineReader.java
from jline3 and just adapting it to use an sbt terminal rather than
fighting with the jline3 api. This would also have the advantage of not
conflicting with other versions of jline3. Even if we don't, we may want to
shade jline3 if that is possible.
2020-07-10 13:37:53 -07:00
Ethan Atkins 7dc4f7ce2d Merge remote-tracking branch 'origin/develop' into wip-sbt-instant-startup 2020-06-29 16:44:24 -07:00
Eugene Yokota 73b0c91dfc scala-xml 1.3.0 2020-06-27 01:14:35 -04:00
Ethan Atkins ba345dd797 Add multi-client ui to server
This commit makes it possible for the sbt server to render the same ui
to multiple clients. The network client ui should look nearly identical
to the console ui except for the log messages about the experimental
client.

The way that it works is that it associates a ui thread with each
terminal. Whenever a command starts or completes, callbacks are invoked
on the various channels to update their ui state. For example, if there
are two clients and one of them runs compile, then the prompt is changed
from AskUser to Running for the terminal that initiated the command
while the other client remains in the AskUser state. Whenever the client
changes uses ui states, the existing thread is terminated if it is
running and a new thread is begun.

The UITask formalizes this process. It is based on the AskUser class
from older versions of sbt. In fact, there is an AskUserTask which is
very similar. It uses jline to read input from the terminal (which could
be a network terminal). When it gets a line, it submits it to the
CommandExchange and exits. Once the next command is run (which may or
may not be the command it submitted), the ui state will be reset.

The debug, info, warn and error commands should work with the multi
client ui. When run, they set the log level globally, not just for the
client that set the level.
2020-06-24 19:40:17 -07:00
Ethan Atkins 1b03c9b1a9 Make Terminal a trait to support multiple clients
In order to support a multi-client sbt server ux, we need to factor
`Terminal` out into a class instead of a singleton. Each terminal provides
and outputstream and inputstream. In all of the places where we were
previously relying on the `Terminal` singleton we need to update the
code to use `Terminal.get`, which will redirect io to the terminal whose
command is currently running.

This commit does not implement the server side ui for network clients.
It is just preparatory work for the multi-client ui.

The Terminal implementations have thread safe access to the output
stream. For this reason, I had to remove the sychronization on the
ConsoleOut lockObject. There were code paths that led to deadlock when
synchronizing on the lockObject.
2020-06-24 19:22:57 -07:00
Ethan Atkins 41d66abb02 Add support for JNI implementation of ClientSocket
The JNI implementation is needed in order for a graalvm native-image to
be build of the NetworkClient.
2020-06-24 19:19:06 -07:00
Ethan Atkins cc80b6c6ed Bump javafmt plugin version 2020-06-24 11:24:15 -07:00
Eugene Yokota 5a37ef14fc Zinc 1.4.0-M6 2020-06-14 15:55:37 -04:00
Eugene Yokota 18a8701083 sjson-new 0.9.0 2020-06-09 00:42:56 -04:00
Eugene Yokota 0d15fe1162 Remove HTTP support without explicit opt-in
Ref https://github.com/sbt/sbt/issues/4905
2020-06-07 01:50:41 -04:00
Eugene Yokota 4bb4c3a9b6 launcher 1.1.4
Forward `m.allowInsecureProtocol` to `MavenRepository`.
2020-05-28 16:21:46 -04:00
Alexandre Archambault f850a9c966 Update coursier to 2.0.0-RC6-4
And warn at start-up if ~/.coursier/cache is found.
2020-05-14 15:54:43 +02:00
Eugene Yokota e8ad695623 IO 1.4.0-M6 2020-05-09 15:53:33 -04:00
Eugene Yokota de098b94d2 IO 1.4.0-M4 2020-05-05 21:47:48 -04:00
Eugene Yokota d29bfbbb25 Zinc 1.4.0-M5 2020-04-28 14:57:13 -04:00
Eugene Yokota af746d269e Zinc 1.4.0-M3 2020-04-24 17:44:15 -04:00
Eugene Yokota da999f60aa Update source deps 2020-04-24 17:44:15 -04:00
Eugene Yokota 2396b449fe Contraband 0.4.6 2020-04-24 17:44:15 -04:00
Eugene Yokota 3ce4d22b84 integrate with VirtualFile changes
Ref https://github.com/sbt/zinc/pull/712
2020-04-24 17:44:14 -04:00
Eugene Yokota e95dd544fc ipcsocket 1.0.1 that uses latest JNA 2020-03-30 12:33:57 -04:00
Eugene Yokota 5dd5296bcf lm-coursier-shaded 2.0.0-RC6-2 2020-03-29 21:01:11 -04:00
Eugene Yokota d2def1ac74 Use Array to talk to proper build 2020-03-18 16:28:51 -04:00
Anil Kumar Myla 887eb17f9e
Update scala to 2.12.11 2020-03-18 00:49:14 -07:00
Dale Wijnand 8d6ca826f9 Update sbt to 1.3.8 2020-02-15 08:49:53 +00:00
Eugene Yokota 72aa0780fc Format build.sbt 2020-02-14 00:06:34 -05:00
Eugene Yokota 02152cc41b Refactor server test
This refactors the server test to reuse the server instance for the tests against the same build.
2020-02-13 23:31:09 -05:00
Dale Wijnand 9eb51211d6 Fix Coursier classpath order 2020-02-07 07:04:38 +00:00
Anil Kumar Myla 6e25f1419b
Update coursier to 2.0.0-RC6 2020-02-04 11:47:08 -08:00