Commit Graph

10167 Commits

Author SHA1 Message Date
eugene yokota 5e9677e338
Merge pull request #6076 from eed3si9n/wip/bogusbuild
Preparatory GitHub Actions
2020-11-08 19:16:25 -05:00
Eugene Yokota 476b9ef541 Preparatory GitHub Actions
Ref https://github.com/sbt/sbt/issues/6031
2020-11-08 19:12:42 -05:00
eugene yokota e3131a8205
Merge pull request #6067 from eatkins/sbt-ci
Fix console with -Dsbt.ci=true
2020-11-06 17:40:19 -05:00
eugene yokota 031d2c6655
Merge pull request #6071 from eatkins/join-thread
Throw timeoutexception in JoinThread
2020-11-06 17:37:24 -05:00
eugene yokota ac6c962a63
Merge pull request #6073 from eatkins/fix-console-cancellation
Fix console task cancellation
2020-11-06 17:37:06 -05:00
Ethan Atkins ceee8ac492 Fix console task cancellation
When the sbt main loop is blocked by console, any other connected client
is prompted that they can kill the task by typing cancel. The
implementation for the console task is to write some input that will
cause the console to exit because the scala 2.12 console cannot be
safely killed with an interrupt. This input, however, was being blocked
from written to the console because the console input stream was holding
the readThread lock. We can be fix this and propagate the input to the
console we wish to terminate by synchronizing on a different lock
object. This should have no impact outside of cancelling the console
because that is the only place where we call the write method of
WriteableInputStream.
2020-11-06 13:56:01 -08:00
eugene yokota 92cbaa925f
Merge pull request #6069 from eatkins/remove-unnecessary-log-line
Remove unnecessary log line in thin client
2020-11-06 07:39:32 -05:00
eugene yokota 87b168b8b3
Merge pull request #6068 from eatkins/color-completions
Fix tab completions if color is disabled
2020-11-06 07:36:37 -05:00
Ethan Atkins 748dfd6e67 Throw timeoutexception in JoinThread
Rather than throwing an interrupted exception if we fail to join a
thread, we should throw a timeout exception.
2020-11-05 11:09:01 -08:00
Ethan Atkins 583ad06aac Remove unnecessary log line in thin client
When a batch command is run with the thin client, it logs an info
message that the command completed. This is unnecessary given that
completion is implied by the success or failure method that follows. It
made the output look a little different in the thin client vs the
console.
2020-11-05 10:13:21 -08:00
Ethan Atkins c1fcf5c531 Fix console with -Dsbt.ci=true
If a user runs sbt -Dsbt.ci=true with the latest code, sbt immediately
exits. This was because we were passing the SimpleTerminal into jline3
and jline 3 would end up exiting immediately. Instead we can still make
a console terminal if there is a console available. An alternative
approach would have been to use a dumb terminal with -Dsbt.ci=true, but
the dumb terminal experience is not great (tab completions don't work
for example), so I thought this was a better fix.
2020-11-05 10:02:37 -08:00
Ethan Atkins e18f14b3c3 Fix tab completions if color is disabled
Tab completions did not work well in sbt 1.4.x when run with
-Dsbt.color=false. This was because we were stripping a bunch of ansi
codes, which caused some problems with the jline 3 completion engine.
Instead of stripping the ansi codes, we can set the jline max_colors
capability to 1 if color is disabled. With this change, the completions
are similar to 1.3.13 except that in jline 2 the user has to hit tab
twice to see all of the available candidates while in jline 3, the
candidates are immediately printed below the prompt.
2020-11-05 09:55:20 -08:00
eugene yokota e5164cdf43
Merge pull request #6063 from eed3si9n/wip/sbt-bumps
Bump sbt versions
2020-11-05 00:40:29 -05:00
Ethan Atkins 2b55aa38ae Bump sbt versions 2020-11-04 23:45:59 -05:00
eugene yokota 19ae383f9f
Merge pull request #6041 from eatkins/active-json
Start server if active.json file is removed
2020-11-04 23:06:45 -05:00
eugene yokota a0cf4b5b42
Merge pull request #6051 from eatkins/virtual-console
Only create console terminal if process has console
2020-11-04 23:04:14 -05:00
eugene yokota b78f8f390b
Merge pull request #6054 from eatkins/scripted-batch-execution
Restore old `scriptedBatchExecution := false` semantics
2020-11-04 23:03:54 -05:00
eugene yokota aba92ad90e
Merge pull request #6052 from eatkins/old-scripted-tests
Move scripted-sbt-old ScriptedTests file
2020-11-04 23:03:31 -05:00
Ethan Atkins 5376c33cd7
Merge branch 'develop' into old-scripted-tests 2020-11-04 18:48:15 -08:00
Ethan Atkins 749d32df36 Set the default scriptedBatchExecution to true
sbt itself effectively runs its scripted test with
scriptedBatchExecution true and scriptedParallelInstances 1. The
performance is much better when this works. This can cause issues, see
https://github.com/sbt/sbt/issues/6042, but we inadvertently made this
behavior the default in 1.4.0 and it took about a month before #6042 was
reported so I think most users would benefit from this default.
2020-11-04 18:47:31 -08:00
Ethan Atkins 3b9b20051f Restore old scripted behavior with batch tests disabled
When 1 is passed in as the sbtInstances argument to runInParallel, all
of the tests get batched together in a single sbt session. The run
methods in ScriptedRunner were delegating to runInParallel and as a
result were causing all of the tests to be batched, which was not how it
used to work in sbt 1.3.x. To fix this we can instead pass in
Int.MaxValue for the number of sbt instances. The Int.MaxValue parameter
causes the batch size to be set to 1 in the batchScriptedRunner method
which causes the scriptedRunners variable to have the same size as the
number of tests. We then can prevent a parallel array from being used if
the sbtInstances is deteced to be the Int.MaxValue sentinel.
2020-11-04 18:47:31 -08:00
Ethan Atkins afbceb062f Only create console terminal if process has console
Intellij import was broken in sbt 1.4.2 because we increased the
scenarios in which virtual io is used. The problem wasn't actually
virtual io but that we create a console terminal with jline3 and that
could cause issues reading input from System.in. This can be fixed by
only creating an instance of ConsoleTerminal if a console is actually
available for the sbt process. When hasConsole is false, the
consoleTerminalHolder will point to the SimpleTerminal whose inputStream
method just reads directly from System.in. After making this change, I
verified that intellij import worked again on windows.

We also don't want to make a console terminal if it is a dumb terminal
because jline 3 ends up having problems with the ConsoleTerminal.
2020-11-04 18:47:01 -08:00
Ethan Atkins 7e1384608e Fix console when supershell is disabled
The sbt console didn't work with supershell disabled because setting
that parameter was causing the terminal type to be dumb which only works
in some very specific situations. When Terminal.isAnsiSupported was
false, we were setting sbt to use a dumb terminal. We really only want
to use a dumb terminal if virtual io is off. It also doesn't necessarily
make sense to automatically disable general ansi codes even if
supershell is disabled by system property.
2020-11-04 18:47:01 -08:00
Ethan Atkins 3b09ff6af7 Support ansi by default if color is supported
Scalatest will check the ansiCodesSupported value of a console appender
to decide whether or not to colorize its output. We were setting
isAnsiSupported to false by default in ci to prevent the ConsoleAppender
from adding ansi codes to the output. The only place though where we
were doing that was in adding a ClearScreenAfterCursor to the end of
each log line. This was done for supershell but there is actually other
logic in supershell processing that adds these anyway.
2020-11-04 18:47:01 -08:00
eugene yokota 4983fbd536
Merge pull request #6060 from eatkins/test-cross-fix
Bump scalatest version in tests/test-cross
2020-11-04 21:38:53 -05:00
Ethan Atkins c738c887e0 Bump scalatest version in tests/test-cross
The travis build has been failing with issues with the scalatest 3.0.5
jar so let's try with 3.0.6.
2020-11-04 10:24:58 -08:00
Ethan Atkins 8d67543ff3 Move scripted-sbt-old ScriptedTests file
I use fzf in vim to switch between files and I am often accidentally
opening this file. Renaming it fixes that problem for me.
2020-11-03 09:02:18 -08:00
eugene yokota 25f492d919
Merge pull request #6036 from jtjeferreira/coursier_2.0.2
Updates to Coursier 2.0.6
2020-11-03 09:02:05 -05:00
eugene yokota d21598f7ba
Merge pull request #6044 from eatkins/color-default
Disable color by default if formatting is disabled
2020-11-03 08:32:05 -05:00
eugene yokota 5948ec6499
Merge pull request #6048 from eatkins/scripted-sort
Sort scripted tests
2020-11-03 07:16:53 -05:00
eugene yokota be99299fed
Merge pull request #6047 from eatkins/scripted-whitespace
Remove unnecessary newline
2020-11-03 06:52:14 -05:00
João Ferreira bc150efd55
Merge branch 'develop' into coursier_2.0.2 2020-11-03 07:52:16 +00:00
João Ferreira 997ee5b405
2.0.3 2020-11-02 22:47:32 +00:00
Ethan Atkins 6b9ea562a5 Remove unnecessary newline 2020-11-02 13:51:14 -08:00
Ethan Atkins 9d3c807c7f Sort scripted tests
It is nice to have the scripted tests run in a deterministic order. I've
noticed that on windows, they tend to run in sorted order but in a
random order on posix platforms.
2020-11-02 13:50:04 -08:00
Ethan Atkins 1d3af543f7 Disable color by default if formatting is disabled
If a user runs with -Dsbt.log.format=false or -Dsbt.log.noformat=true,
we should disable color by default. Running with -Dsbt.color=true should
make this possible.
2020-11-02 11:05:31 -08:00
Ethan Atkins 452c49f84c Start server if active.json file is removed
If there are two sbt instances and one of them is running a server, the
other instance is presently prevented from ever starting a server. If an
sbt instance is unable to start a local server because of the presence
of another server, we can monitor the active.json file for changes and,
if it is deleted, we can then try again to start a new server instance.
2020-11-02 08:36:46 -08:00
eugene yokota 8c3f2a50f7
Merge pull request #6026 from eed3si9n/wip/content
Make remoteCacheId content-based
2020-11-01 22:06:37 -05:00
eugene yokota ded2787f23
Merge pull request #6039 from eed3si9n/wip/bumpzinc
Zinc 1.4.2
2020-11-01 22:06:01 -05:00
Eugene Yokota c5fd92959f AdoptOpenJDK 8 on Windows 2020-11-01 21:37:25 -05:00
Eugene Yokota d2252cc89d Zinc 1.4.2 2020-11-01 21:24:35 -05:00
Eugene Yokota 6c344830df Bring back fixed-id for testing 2020-11-01 19:51:57 -05:00
Eugene Yokota 744cfefa6c Refactor remote cache to per-config
Refactor remote caching to be scoped to configuration.
In addition, this avoid the use of dependency resolver (since I'm not resolving anything) and directly invoke the Ivy resolver for the artifact, somewhat analogus to publishing process.
This should speed up the `pullRemoteCache` since it avoids the POM download as well.

For sbt-binrary-remote-cache this created a bit of complication since the (publishing) resolver doesn't act correctly as (downloading) resolver in terms of the credentials, so I had to create a new key `remoteCacheResolvers` to have asymmetric resolver.
2020-11-01 19:15:28 -05:00
Eugene Yokota 078280ac47 Make sure we test the caching effect 2020-10-31 07:26:33 -04:00
João Ferreira cf926115ed update coursier to 2.0.2 2020-10-30 20:49:20 +00:00
eugene yokota 4a2aaabb9b
Merge pull request #6035 from sbt/travis-ci-badge
Update travis-ci badge. s/.org/.com/
2020-10-29 11:14:18 -04:00
kenji yoshida 512494d11c
Update travis-ci badge. s/.org/.com/
https://github.com/sbt/sbt/issues/6031
2020-10-29 23:54:09 +09:00
Eugene Yokota 6a356c61e0 Refactor remoteCacheId 2020-10-29 09:47:27 -04:00
eugene yokota dc676af358
Merge pull request #6030 from eatkins/bsp-client
Support -bsp in sbtn
2020-10-29 06:12:23 -04:00
Ethan Atkins f0c6d72ec7
Merge branch 'develop' into bsp-client 2020-10-28 10:07:12 -07:00