Commit Graph

9603 Commits

Author SHA1 Message Date
Adrien Piquerez 8b8745cb0b Fix completion 2020-09-17 14:23:28 +02:00
Adrien Piquerez 759392aaf0 Add BSP `buildTarget/run` test 2020-09-17 14:23:07 +02:00
Adrien Piquerez 9f04358fce Add BSP buildTarget/run endpoint 2020-09-17 13:40:50 +02:00
Adrien Piquerez 92fb69f370 Add BSP buildTarget/scalaMainClasses endpoint 2020-09-17 13:32:30 +02:00
eugene yokota 3bee2cff9a
Merge pull request #5854 from eatkins/jline-reader
Use DumbTerminal if sbt.log.noformat=true
2020-09-15 16:45:04 -04:00
eugene yokota 3923d52c18
Merge pull request #5855 from eatkins/symlinks
Skip contents of symlinked directories in clean
2020-09-15 16:08:18 -04:00
Ethan Atkins a946cbf702 Skip contents of symlinked directories in clean
The clean task was previously deleting the contents of directories that
were symlinked into the target directory. This was an oversight because
it never occurred to me that users might symlink a directory whose
contents they did not want deleted into the target directory.
2020-09-15 09:24:04 -07:00
Ethan Atkins 334146f541 Use DumbTerminal if sbt.log.noformat=true
When sbt is run with the sbt.log.noformat system property set to true,
no virtual io is used which causes the jline 3 terminal that we creaate
to not work at all. For reasons that I don't understand, it is also
necessary to set the jline.terminal system property to none to make the
dumb terminal work.
2020-09-15 09:10:21 -07:00
eugene yokota 70111bb689
Merge pull request #5851 from eed3si9n/wip/bumpcoursier
lm-coursier-shaded 2.0.0-RC6-9
2020-09-14 23:58:36 -04:00
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
eugene yokota 66308bae45
Merge pull request #5847 from eed3si9n/wip/promise_propagate
Cancel all promises if one fails
2020-09-14 22:33:18 -04:00
eugene yokota f033aa5ca1
Merge pull request #5844 from eed3si9n/wip/pipelining_adjustments
Fix mixed pipelining
2020-09-14 22:32:48 -04:00
eugene yokota 75da49556c
Merge pull request #5838 from adpi2/bsp-reload
Add BSP workspace/reload
2020-09-14 08:08:14 -04:00
Adrien Piquerez ac85117841 Add BSP workspace/reload 2020-09-14 13:10:11 +02:00
Eugene Yokota 55d2b0a3c6 Cancel all promises if one fails
Fixes https://github.com/sbt/sbt/issues/5822

Currently the entire shell gets stuck when there's a compilation error with pipelining.
This at least returns to sbt shell.
2020-09-14 01:04:10 -04:00
Ethan Atkins 10e2f2821e
Merge pull request #5846 from eatkins/json-read
Expand json rpc request input buffer if needed
2020-09-13 21:09:27 -07:00
Ethan Atkins 5ef777a806
Merge branch 'develop' into json-read 2020-09-13 20:32:38 -07:00
Ethan Atkins 7b31495ae3 Expand json rpc request input buffer if needed
When a json rpc request is specified without any headers, the size of
the message may exceed the buffer that was created for reading hdeaders.
This would cause an exception to be thrown when creating a string from
the header buffer because the number of bytes requested would exceed the
capacity of the buffer. To fix this, we can expand the buffer
dynamically if needed. For the common case when the headers are
specified, this should be a no-op.
2020-09-13 19:43:06 -07:00
eugene yokota 6ebba09020
Merge pull request #5845 from eed3si9n/wip/sig_files_written
Demote [sig files written]
2020-09-13 19:39:05 -04:00
Eugene Yokota 350a6af6ef Demote [sig files written]
It gets ridiculous seeing the screen fill up with [sig files written] after a while.
Here's a quick hack to demote that stuff.
2020-09-13 17:54:36 -04:00
Eugene Yokota 2a8c184a51 Fix mixed pipelining
Together with https://github.com/sbt/zinc/pull/920 this fixes most of the mixed pipelining issues.

1. Previous values are carried from `compileScalaBackend` in `compileJavaTask`.
2. `compileJava / compileOptions ` now uses `compile / compileOptions` to avoid unintentional change of javac or scalac options.
3. Hooks up early compile analysis store.
2020-09-13 16:25:09 -04:00
eugene yokota 8053ebea73
Merge pull request #5823 from eed3si9n/wip/server_cmd
Add pseudo --server command
2020-09-12 15:46:22 -04:00
Eugene Yokota d24cd2b3f7 Rename --close-io-streams to --detach-stdio 2020-09-12 14:19:37 -04:00
Eugene Yokota bba3d08aac Add pseudo --server command
Ref https://github.com/sbt/sbt/issues/5665

This adds `--server` command that is immediately filtered out in Main.scala.
The purpose of `--server` is so we can invoke thin client from `sbt` script at some point in the future when Bash script can parse `project/build.properties`.

`sbtn` would need to call `sbt` again to start the server, and at that point the shell script would need to actually invoke the server. The intent of `--server` is to be used as the tie breaker.

Also build users may want to sometimes call `sbt --server`.
2020-09-12 14:12:02 -04:00
eugene yokota 8160035f41
Merge pull request #5840 from eatkins/play-progress
Skip task progress work if already shutdown
2020-09-12 08:27:42 -04:00
eugene yokota a7f00ecd7a
Merge pull request #5839 from eatkins/play-shell-prompt
Honor shellPrompt override
2020-09-12 08:24:41 -04:00
Ethan Atkins 476cfc6649 Change terminalShellPrompt to colorShellPrompt
I introduced the terminalShellPrompt so that we could generate a prompt
that was colored only if the terminal supported color. Rather than
expose the terminal implementation detail, we can just use a boolean
flag that toggles whether or not color is enabled and sbt can pass in
the value of terminal.isColorEnabled into the function.
2020-09-11 11:47:36 -07:00
Ethan Atkins 5e88d4b233 Warn on progress RejectedExecutionException
It shouldn't be the case that a RejectedExecutionException is thrown
by TaskProgress. If that assumption is violated, log the exception but
don't crash sbt.
2020-09-11 11:39:53 -07:00
Ethan Atkins 4a2bf67eb8 Skip task progress work if already shutdown
The play plugin seems to do out of band task evaluation on a stale State
object in the `run` task. As a result, when sbt tries to schedule tasks
to run, they tried to register the work with a closed TaskProgress
instance. There was no guard against this and it ended up causing a
RejectedExecutionException.
2020-09-11 11:37:17 -07:00
Ethan Atkins a471e7384d Honor shellPrompt override
sbt 1.4.0 generates the shell prompt using the terminal properties for
the specific terminal for which the prompt is rendered. The mechanism
for doing this broke the prompt for projects that overrode the
shellPrompt key, notably the play plugin. After this change, the play
custom prompt is correctly rendered with 1.4.0-SNAPSHOT.
2020-09-11 10:50:21 -07:00
eugene yokota 96b4f7b8e6
Merge pull request #5837 from eatkins/terminal-color
Refactor color settings
2020-09-11 05:48:27 -04:00
eugene yokota f655d91d86
Merge pull request #5836 from eatkins/relay-appender
Use null ConsoleOut for RelayAppender
2020-09-11 05:45:25 -04:00
eugene yokota 34da6cfc0c
Merge pull request #5835 from eatkins/progress-truncated-command
Increase length of truncated command
2020-09-11 05:44:14 -04:00
eugene yokota 174a50aca4
Merge pull request #5834 from eatkins/jline-reset
Restore terminal when exiting Terminal.withStreams
2020-09-11 05:43:06 -04:00
Ethan Atkins 1bd8665ccc Refactor color settings
A user of 1.4.0-RC1 reported that colors were not being displayed on
fedora 32. I'm not sure if this will fix the issue with fedora, but I
found it confusing how formatEnabledInEnv was set so I refactored things
in a way that I found more clear. I verified that things worked as
expected with -Dsbt.color={true,false} and with -Dsbt.log.format and
-Dsbt.log.noformat.
2020-09-10 16:44:19 -07:00
Ethan Atkins 3d6d847947 Use null ConsoleOut for RelayAppender
The RelayAppender should not log directly to console out since it is
supposed to be relaying json log messages to connected clients. This was
manifesting as double printing on some success messages.
2020-09-10 16:40:47 -07:00
Ethan Atkins 5d7485eaff Increase length of truncated command
When the server is running a command with a long name on behalf of a
client, we truncate the command if it exceeds the length of the
terminal. This is because some of the bsp commands are very long.
Nevertheless, only taking 10 characters was a bit too aggressive.
2020-09-10 16:40:15 -07:00
Ethan Atkins b610ce9298 Restore terminal when exiting Terminal.withStreams
There was a reddit comment that the user's tty was messed up after they
exited sbt:
https://www.reddit.com/r/scala/comments/io3z2p/sbt_140rc1_released/.
This attempts to fix that issue by restoring the terminal before
exiting. In order to ensure the tty is restored, it's necessary to move
the work off of a background thread and delay sbt exit. This does take
about 150ms on my machine but I figure that isn't a huge deal in the
scheme of things.
2020-09-10 15:37:15 -07:00
eugene yokota 67f6df0bdb
Merge pull request #5831 from eatkins/boot-fix
Fix output when starting sbt from thin client
2020-09-10 17:25:09 -04:00
eugene yokota 1514f96492
Merge pull request #5832 from eatkins/tcp-socket
Catch SocketException on server shutdown
2020-09-10 17:21:07 -04:00
Ethan Atkins 31f36eeff3 Add serverConnectionType to excludeLintKeys 2020-09-10 11:56:42 -07:00
Ethan Atkins 828aac8fe5 Catch SocketException on server shutdown
Fixes #5829
2020-09-10 11:55:01 -07:00
Ethan Atkins 1ec2cd85cd Fix output when starting sbt from thin client
When starting sbt via the thin client with 1.4.0-RC1, there is no output
until sbt finishes booting up which is poor ux. The reason is that sbt
only uses virtual io when sbt.io.virtual == true or formatEnabledInEnv
== true and not ci. The default value for formatEnabledInEnv is set
based on whether color is enabled in the environment. This had copied
old logic that turned on color if ansi was enabled but it makes more
sense to check the color property (which is set by the thin client via
an environment variable when it launches sbt) and fall back to whether
or not java.lang.System.console is defined. We also can explicitly set
"-Dsbt.io.virtual=true" when the thin client launches sbt since the thin
client relies on this behavior. By doing it in both places, the sbtn
for 1.4.0-RC1 will display boot output for newer versions of sbt.

Bonus: don't call ConsoleAppender.formatEnabledInEnv which just calls
back to Terminal.formatEnabledInEnv
2020-09-10 10:00:14 -07:00
eugene yokota 771ac51cb2
Merge pull request #5824 from eatkins/gc-monitor-fixes
Set initial collection time in gc monitor
2020-09-08 23:10:32 -04:00
Ethan Atkins f23aecfdbf Suggest using alternate gc implementation
Running publishLocal in the zinc project can cause gc thrashing with the
default parallelgc collector using jdk8 on my laptop. If I switch to
G1GC, it does not thrash even if I leave the heap the same size.
2020-09-08 11:12:13 -07:00
Ethan Atkins 4e3d351e71 Set initial collection time in gc monitor
The java GarbageCollectorMXBean.getCollectionTime returns the cumulative
amount of time the collector has run during the jvm session. The GC
monitor is tracking how much time has been spent in garbage collection
during each task evaluation run. In order for this calculation to work
correctly, it is necessary to set the initial elapsed time to the bean's
current collection time when we create the gc monitor. Without doing
this, we can get completely incorrect results that are reporting based
on the total gc time for the entire process, not just in the last 10
seconds.

Should fix https://github.com/sbt/sbt/issues/5818
2020-09-08 11:07:30 -07:00
Ethan Atkins a34181b078
Merge pull request #5820 from eatkins/sbt-version-bump
Bump sbt version
2020-09-08 11:03:07 -07:00
Ethan Atkins 2921dfa005 Bump sbt version 2020-09-07 09:49:43 -07:00
eugene yokota f0f14f9c49
Merge pull request #5799 from eatkins/doc-fail-repro
Reproduce scaladoc failures
2020-09-07 04:55:42 -04:00
Ethan Atkins dc3bccc57f Add scripted verification that doc works
In 1.4.0-RC2, doc did not actually generate html files for the project
clases. This was fixed in zinc and this commit updates the actions/doc
scripted test to verify that doc actually generates output for the
project classes.
2020-09-06 16:30:58 -07:00