Commit Graph

9603 Commits

Author SHA1 Message Date
eugene yokota d1e7b2c35c
Merge pull request #5815 from eed3si9n/wip/bump
Zinc 1.4.0-M12
2020-09-06 17:16:46 -04:00
Eugene Yokota 47842f51f8 Zinc 1.4.0-M12 2020-09-06 16:04:47 -04:00
eugene yokota c684a73e34
Merge pull request #5814 from eed3si9n/wip/bump
IO 1.4.0-M8, Zinc 1.4.0-M11
2020-09-06 06:10:40 -04:00
eugene yokota b0d89ed59f
Merge pull request #5812 from eatkins/gc-monitor
Add gc monitor to warn users about excessive gc
2020-09-06 04:54:16 -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 fdce1eb7e6 Add gc monitor to warn users about excessive gc
It is not uncommon in large projects for the jvm to silently be running
frequent full gcs in the background. This can slow progress to a crawl.
Usually the fix is to bump the -Xmx parameter but if the users do not
realize that their tasks are slow because of gc thrashing, they may not
think to do that. This PR adds a monitor that hooks into the jvm's event
notification system to keep track of how much time is spent in GC. If
the ratio of the amount of time in gc to the total elapsed time exceeds
some threshold, we emit a warning.

I was motivated to do this because publishLocal can take forever in the
zinc project because a 1G heap isn't big enough.
2020-09-05 13:47:39 -07:00
eugene yokota 45ebebda5d
Merge pull request #5810 from eatkins/progress-format
Improve progress display with limit + 1 tasks
2020-09-03 09:25:40 -04:00
eugene yokota 172177a207
Merge pull request #5811 from eatkins/pipelining-progress
Hide compileEarly and pickleProducts from progress
2020-09-03 09:24:53 -04:00
Ethan Atkins 4f734ebeaa Hide compileEarly and pickleProducts from progress
These tasks show up during task progress and they clutter up the
display. Since my understanding is that both of these tasks are more or
less just waiting for other work to complete, I don't think they are
helpful for debugging.
2020-09-02 22:06:38 -07:00
Ethan Atkins d85f600229 Improve progress display with limit + 1 tasks
When the number of tasks running exceeds the limit for the number of
progress tasks to display by 1. Say the limit is 2 and there are three
tasks running, then we display

  | ... (1 other tasks)
  | => foo 2s
  | => bar 3s

This looks bad considering we could just display what the task actually is.
2020-09-02 21:34:54 -07:00
eugene yokota 32c1f0c90a
Merge pull request #5807 from eatkins/logger-appender-source-compat
Restore bindLoggerAppenders source compatibility
2020-09-02 20:42:23 -04:00
eugene yokota 460a6f2291
Merge pull request #5806 from eatkins/zinc-sandwich-fix
Allow incompatible mixed scala versions
2020-09-02 19:51:17 -04:00
eugene yokota 090f48fea8
Merge pull request #5809 from eatkins/sanitize-bsp-id
Sanitize builder server protocol uri
2020-09-02 19:49:44 -04:00
Ethan Atkins 443ebcd3d7 Sanitize builder server protocol uri
The lift-json project couldn't load in the community build because the
generated uri contained two # identifiers.
2020-09-02 15:58:19 -07:00
Ethan Atkins fb840cb806 Restore bindLoggerAppenders source compatibility
The akka-http project doesn't load because it gets an Appender with
MainAppender.defaultBacked which returns an sbt Appender rather than a
log4j appender now. It then passes that appender into
bindLoggerAppenders which doesn't work because bindLoggerAppenders was
expecting a log4j appender rather than an sbt Appender..
2020-09-02 13:25:45 -07:00
Ethan Atkins c6021ecdf6 Allow incompatible mixed scala versions
The zinc scripted project depends on all of the compiler bridges. As a
result the introduction of the strict scala binary version check in
f8139da192 broke zinc scripted. This
commit reverts to the old behavior in the non scala sandwich case.

I also switched to a for comprehension instead of a pattern match
because this is a rare case where I think it made the code significantly
more readable.
2020-09-02 11:49:05 -07:00
eugene yokota debc9a28a4
Merge pull request #5804 from eatkins/watch-cancel
Change ctrl+c behavior in ~
2020-09-01 09:10:14 -04:00
Ethan Atkins c931b005ab Change ctrl+c behavior in ~
While in a continuous build, when the user enters ctrl+c into the sbt
server console (not a thin client connection) when sbt has been launched
in interactive mode, the server exits.  This commit makes it so that
instead we just cancel the watch. As a result, if sbt was started in
batch mode, e.g. `sbt ~compile`, ctrl+c will still exit sbt but in
interactive mode ctrl+c will take the user back to the shell.
2020-08-31 11:41:08 -07:00
Ethan Atkins afac5e5067 Block watch until threads spin up
I occassionally end up in a state where watch input does not seem to be
read. To rule out the possibility that the background thread that reads
input has not successfully started, this commit makes it so that we
block until the thread signals that it has started via a CountDownLatch.

The diff is superficially big because of an indentation change at the
bottom.
2020-08-31 11:36:39 -07:00
eugene yokota 1b99049fbc
Merge pull request #5782 from adpi2/feature/bsp-enabled
Add bspEnabled setting
2020-08-27 10:55:48 -04:00
Martin Duhem fbcd18de25
Merge pull request #5800 from Duhemm/test-agent-duplicate-tasks
Filter out duplicate `TaskDef`s in test agent
2020-08-27 11:55:36 +02:00
Adrien Piquerez 23c8889e26 Add bspEnabled setting 2020-08-27 09:11:52 +02:00
Martin Duhem 5cce0e9d5d
Fix #5801: Remove duplicate TaskDefs in test agent
When forking, a test could be run as many times as its `TestDef` matched
`Fingerprint`s. When forking is disabled, sbt correctly runs the tests
only once.
2020-08-26 17:19:35 +02:00
eugene yokota 788fd4aa28
Merge pull request #5793 from eatkins/kill-processes
Kill external processes on sigint
2020-08-26 11:07:52 -04:00
eugene yokota 68f1999774
Merge pull request #5794 from eatkins/dumb-terminal
Use dumb terminal when specified by property
2020-08-26 11:07:13 -04:00
eugene yokota 9bd1089cb0
Merge pull request #5796 from eatkins/network-channel-memory
Reduce sbt memory utilization
2020-08-24 15:23:09 -04:00
Ethan Atkins 1c21f13b99 Reduce sbt memory utilization
The sbt Server is initialized with a callback onIncomingSocket. That
callback was created in CommandExchange and held references to a build
structure and a state. Neither the state nor structure would ever go out
of scope so they effectively leaked. It is possible for each
NetworkChannel to access a recent instance of state through the
CommandExchange.withState method. Using this, we can eliminate the
references to state and build structure in the onIncomingSocket
callback. In the sbt project, this reduced the memory utilization by
about 50mb on startup.
2020-08-24 10:30:43 -07:00
Ethan Atkins 7e0fbb9be5 Use dumb terminal when specified by property
Intellij invokes sbt with "-Djline.terminal=jline.UnsupportedTerminal"
which Terminal rewrites to the value none. When that property is set, we
should be using a jline dumb terminal. While
https://github.com/sbt/sbt/pull/5788 did fix the import functionality,
jline 3 was still emitting some ansi characters to the intellij console.
When we feed a dumb terminal to the jline 3 line reader, the ansi
control characters go away.
2020-08-23 11:12:53 -07:00
Ethan Atkins d3f8cc8161 Kill external processes on sigint
On linux and mac, entering ctrl+c will automatically kill any forked
processes that were created by the sbt server because sigint is
automatically forwarded to the child process. This is not the case on
windows where it is necessary to forcibly kill these processes.
2020-08-23 10:15:07 -07:00
eugene yokota 8fe7e33a31
Merge pull request #5792 from eatkins/windows-ctrl-c
Allow windows console users to exit with ctrl+c
2020-08-23 13:13:07 -04:00
eugene yokota 573bd8af04
Merge pull request #5788 from eatkins/intellij-import
Fix intellij import for 1.4.x
2020-08-23 13:12:11 -04:00
Ethan Atkins af761da811 Allow windows console users to exit with ctrl+c
On windows with jline3, inputting ctrl+c in the sbt console just causes
the input stream to return -3 unlike mac and linux where ctrl+c always
signals.

Fixes https://github.com/sbt/sbt/issues/5791
2020-08-23 09:12:52 -07:00
Ethan Atkins 41c33ba92f Fix intellij import with 1.4.x
The intellij import currentlly works by forking an sbt process and
writing command input through the process input stream. To make this
work, we need the SimpleTerminal (which is used when sbt is run with
-Dsbt.log.noformat=true) to be able to read input.

Attaching the input to the simple terminal caused watch tests to fail on
windows. This can be fixed by checking if the byte read from the input
stream is -1 and ignoring it if so.
2020-08-23 08:59:08 -07:00
Ethan Atkins 02366fdf49 Honor formatEnabledInEnv at the Terminal level
The sbt.log.noformat parameter should be treated very similarly to
sbt.io.virtual. When it is true, we should just use the raw io streams
for the process. This came up because of
https://github.com/sbt/sbt/issues/5784 which reported that intellij
imports were not working and that ansi control characters were being
written to the output.
2020-08-23 08:51:55 -07:00
eugene yokota 99e833d11a
Merge pull request #5789 from eatkins/join-threads
Use more aggressive strategy to join ui threads
2020-08-22 11:38:42 -04:00
Ethan Atkins 329baf4b0b Use more aggressive strategy to join ui threads
There can be race conditions where we try to interrupt and join a ui
thread before it becomes interruptible by blockign on a queue. To
workaround this, we can add the JoinThread class which adds an
extension method Thread.joinFor that takes a FiniteDuration parameter.
This variant of join will repeatedly interrupt and attempt to join the
thread for up to 10 milliseconds before retrying until the limit is
reached. If the limit is reached, we print a noisy error to the console.

I'm not 100% sure if we are leaking threads in the latest sbt version
but this gives me more piece of mind that either we are always
successfully joining the threads or we will be alerted if the joining
fails.
2020-08-21 12:57:37 -07:00
eugene yokota b8dac52338
Merge pull request #5774 from adpi2/feature/bsp-config-task
Add bspConfig task
2020-08-20 10:27:06 -04:00
eugene yokota 7f0d97acdf
Merge pull request #5776 from eatkins/sbt-upgrade
Bump sbt build to 1.4.0-M2
2020-08-19 23:06:12 -04:00
eugene yokota f7dad80258
Merge pull request #5777 from eatkins/ci-virtual-io
Don't use virtual io by default in CI
2020-08-19 22:57:07 -04:00
Ethan Atkins c641ebd55e Use latest sbt version in a travis build
Moving forward, it would be great for sbt to use the latest code to run
the scripted tests. This could help detect regressions that aren't
noticed by manual dogfooding. We can do this by first publishing
1.4.0-SNAPSHOT binaries before running tests. I didn't want to do this
for all of the builds because it does make each build that publishes
binaries take about a minute longer. The last build in the matrix is
much faster than the other builds though so I made just that build use
the snapshot version. Since that build almost always finishes first,
this should have little effect on the actual time to run ci even though
the cpu time will increase a bit.
2020-08-19 12:00:02 -07:00
Ethan Atkins f0055cd18a Don't use virtual io by default in CI
The CI output logs for the sbt build are truncated when using sbt
1.4.0-M2 because the virtual tty provided by the build agent doesn't
seem to work well with sbt's virtual io.
2020-08-19 11:32:06 -07:00
Ethan Atkins f4d72c8d0f Disable pipelining in CI
sbt 1.4.0-M2 failed to build util-tracking in 2.13.3 in CI with
pipelining enabled. It works fine with pipelining disabled.
2020-08-19 11:26:38 -07:00
Ethan Atkins b2d7ba3aec Disable virtual io in CI
The travis tty does not work with virtual io. We should disable virtual
io by default when sbt detects that it's being run in CI but until we
release 1.4.0-M3 or 1.4.0-RC1, we need this flag to fix the travis
output.
2020-08-19 11:26:38 -07:00
Ethan Atkins c01be0395d Bump sbt build to 1.4.0-M2 2020-08-19 09:26:27 -07:00
eugene yokota 85a0d08a4e
Merge pull request #5773 from adpi2/fix/dotty-semanticdb
Enable semanticdb with Dotty
2020-08-17 12:28:46 -04:00
Adrien Piquerez 4a02292b6f Enable semanticdb with Dotty 2020-08-17 17:39:43 +02:00
Adrien Piquerez 97b0347c15 Add bspConfig task 2020-08-17 17:33:48 +02:00
eugene yokota 31dc975ec7
Merge pull request #5769 from eed3si9n/wip/banner
Advertise versionScheme instead
2020-08-16 21:15:58 -04:00
eugene yokota da9cf449c7
Merge pull request #5767 from eed3si9n/wip/dotty-mixed
Implement Scala 2.13-3.0 sandwich
2020-08-16 21:15:21 -04:00
eugene yokota edc9386082
Merge pull request #5768 from eatkins/appender-bin-compat
Restore binary compatibility for LogManager.defaults
2020-08-16 19:28:59 -04:00