Commit Graph

11761 Commits

Author SHA1 Message Date
Ethan Atkins f9bc9049ee Set SimpleTerminal properties based on system props
When running sbt 1.4.0 with -Dsbt.ci=true and -Dsbt.color=true, there is
no color output. This was because in this scenario, a SimpleTerminal was
used and isAnsiSupported and isColorEnabled were hardcoded to false
rather than reading the values from the system properties.
2020-10-08 09:36:19 -07:00
Ethan Atkins b057e58792 Don't enter raw mode preemptively
The user input is not echoed in sbt new because we were switching to raw
mode when creating the console terminal. I can't quite remember why I
was entering raw mode preemptively but it doesn't seem like the best
idea.
2020-10-07 09:40:51 -07:00
eugene yokota a2fc24bb6f
Merge pull request #5947 from eatkins/windows-cancellation
Fix ctrl+c handling on windows
2020-10-06 23:14:18 -04:00
Ethan Atkins 1892f04211 Fix ctrl+c handling on windows
In windows, it is necessary for the console mode to include the
ENABLE_PROCESS_INPUT flag in order for ctrl+c to be treated as a signal
rather than a character. In jline 2, the ENABLE_PROCESS_INPUT flag was
preserved whenever the console mode was changed but in jline 3, it was
not. It is easy enough to manually set the flag after entering and
exiting raw mode and setting attributes (which are the apis that change
the console mode on windows).
2020-10-06 13:29:08 -07:00
eugene yokota 6865526d3d
Merge pull request #5944 from eatkins/sbt-snapshot-version
Bump sbt snapshot version
2020-10-06 16:21:10 -04:00
eugene yokota 715bccacd9
Merge pull request #5945 from eatkins/boot-system-in-fix
Fix sbt hangs with invalid build.sbt and --batch
2020-10-06 16:20:54 -04:00
Andrii aae6493701
Merge branch 'develop' into feature/3212/new-plugins-view 2020-10-06 23:08:41 +03:00
Andrii Abramov 6061072937 Brings new `plugins` command output message as per #3212 2020-10-06 23:06:38 +03:00
eugene yokota 42e8c9366d
Merge pull request #5946 from eatkins/no-prompt
Fix line reader for jEdit
2020-10-06 15:44:34 -04:00
Ethan Atkins 10c549a0b9 Fix sbt hangs with invalid build.sbt and --batch
When sbt is starting up and there is an error with the build loading, we
need to read input from the user to determine to restart the build or
not. What is tricky is that there are potentially two sources of input:
thin clients connected through the boot server socket and the actual sbt
console process. If there are not connected thin clients and no system
console is available, we should return -1 in System.in.read, which will
cause sbt to exit.
2020-10-06 11:43:00 -07:00
Ethan Atkins 63f2684219 Bump sbt snapshot version 2020-10-06 11:34:12 -07:00
Ethan Atkins 76128a9380 Read input from dumb terminals
On my computer with jEdit, input is not read because the console input
stream was overridden to be a blocking input stream that never returned
input. While debugging the server test hangs, I added some logic to
prevent us from trying to read from System.in when System.console ==
null but I now realize that was a mistake because of situations like
ides or editors launching an sbt shell.
2020-10-06 09:55:49 -07:00
Ethan Atkins 08aa64e703 Restore terminal prompt for some dumb terminals
A user reported that no prompt was displayed when they used sbt from the
jEdit console. The reason no prompt was displayed was because
System.console was null which caused the ConsoleChannel to be
initialized with its prompt set to NoPrompt. I don't remember why it was
doing this but this bug seems worse than whatever it was trying to
address.
2020-10-06 09:55:49 -07:00
eugene yokota 536da2f29c
Merge pull request #5930 from adpi2/bsp-custom-config
fix BSP on custom configs
2020-10-05 15:27:40 -04:00
Adrien Piquerez 41d3f8e5f0 Add test from sbt/website 2020-10-05 16:25:30 +02:00
Adrien Piquerez af4deaaab1 fix BSP on custom configs 2020-10-05 13:22:48 +02:00
eugene yokota 7dff879b6a
Merge pull request #5926 from eed3si9n/wip/usesbt
Use sbt 1.4.0
2020-10-05 00:21:02 -04:00
Eugene Yokota 5f5463fe3b use sbt 1.4.0 2020-10-04 23:35:05 -04:00
Eugene Yokota 8237eff942 sbtn 1.4.0 2020-10-04 20:13:49 -04:00
Ethan Atkins 40d4e6186e
Merge pull request #5923 from eed3si9n/wip/bump
Zinc 1.4.0, LM 1.4.0
2020-10-04 11:38:43 -07:00
Eugene Yokota 8ac96af3fb Zinc 1.4.0, LM 1.4.0 2020-10-04 13:47:49 -04:00
eugene yokota 49f3deae7d
Merge pull request #5922 from eed3si9n/wip/bumpio
IO 1.4.0
2020-10-04 01:41:41 -04:00
Eugene Yokota a9bda61ee5 Use Ivy for metabuild 2020-10-04 00:36:55 -04:00
Eugene Yokota 081f437afc Banner URL
Fixes https://github.com/sbt/sbt/issues/5921
2020-10-04 00:10:30 -04:00
Eugene Yokota c4517bfd5e versionScheme 2020-10-04 00:09:15 -04:00
Eugene Yokota b54f1fba0b IO 1.4.0 2020-10-04 00:06:54 -04:00
eugene yokota 6b5f2ab3f4
Merge pull request #5919 from eed3si9n/wip/epoch
Epoch directory src/main/{scala-2, scala-3}
2020-10-03 23:54:01 -04:00
Eugene Yokota c11259ee2f Epoch directory src/main/{scala-2, scala-3}
Fixes https://github.com/sbt/sbt/issues/5895
2020-10-03 22:52:06 -04:00
eugene yokota 89ad0db0a9
Merge pull request #5917 from eed3si9n/wip/bumpcoursier
lm-coursier-shaded 2.0.0
2020-10-03 10:35:17 -04:00
Eugene Yokota 6662b2cf99 lm-coursier-shaded 2.0.0
Uses Coursier 2.0.0
2020-10-02 23:07:27 -04:00
eugene yokota aa91a1b304
Merge pull request #5914 from eed3si9n/wip/dependencygraph_fix
Rename some sbt-dependency-graph keys
2020-10-02 08:37:03 -04:00
eugene yokota d9a9a705a0
Merge pull request #332 from avdv/fix-launcher-option-handling
Fix launcher option handling
2020-10-01 21:26:59 -04:00
Claudio Bley 57cf5231ab CI: piccolo.link is broken, switch to direct github link
It returns a 500 internal server error.
2020-10-01 21:23:45 +02:00
Claudio Bley eb38ac57e7 Split up integration tests
Separate them into those that do not need to run a JVM, using
the newly added `java` script, and those that really need to run
the sbt-launch.jar
2020-10-01 21:23:45 +02:00
Claudio Bley a108c46851 Add `java` mock scripts to avoid running a JVM during tests
The script simply prints out each argument in an unambigous form on a single
line and handles to the `--version` option.

For windows, add `java.cmd` script which simply calls the former `java` script.
2020-10-01 21:21:03 +02:00
Claudio Bley 234273db41 Handle `--ivy` option in `SBT_OPTS` too
Fixes sbt/sbt#5885
2020-10-01 21:21:03 +02:00
Claudio Bley a7c034aa99 Fix handling of `--no-share` option
Using `--no-share` as a command line option resulted in a single additional
argument added to the java command:

`-Dsbt.global.base=project/.sbtboot -Dsbt.boot.directory=project/.boot -Dsbt.ivy.home=project/.ivy`

Actually, three separate arguments need to be added.
2020-10-01 21:21:03 +02:00
Eugene Yokota 51466e7b84 Rename some sbt-dependency-graph keys
Fixes https://github.com/sbt/sbt/issues/5894
2020-10-01 09:28:44 -04:00
eugene yokota b8673194cb
Merge pull request #5909 from eatkins/lazy-console-reader
Make ConsoleReader creation lazy
2020-10-01 05:34:51 -04:00
eugene yokota 34d1e62f27
Merge pull request #5908 from eatkins/scala-2.12-thin-client-console
Fix echo setting for scala 2.12 thin client console
2020-10-01 05:33:56 -04:00
eugene yokota e30b83f5a0
Merge pull request #5910 from eatkins/bg-service-hangs
Don't block sbt exit forever on bg service shutdown
2020-09-29 16:19:04 -04:00
Ethan Atkins 16bef0cfc8 Don't block sbt exit forever on bg service shutdown
Some of the sbt scripted tests somewhat frequently hang in CI. I added a
patch that printed a stack trace of the sbt process every 30 seconds. I
discovered that the main thread was stuck in DefaultBackgroundJobService
shutdown. To avoid the hangs, I updated the awaitTermination methods to
take a timeout parameter and we timeout shutdown if 10 seconds have
elapsed.
2020-09-29 11:48:51 -07:00
Ethan Atkins 2ccc0714e8 Make ConsoleReader creation lazy
I noticed while debugging a jline 2 issue that the SimpleReader was
creating a ConsoleReader on startup even if it was never used.
2020-09-29 10:22:28 -07:00
Ethan Atkins 7eaa46800a Fix echo setting for scala 2.12 thin client console
I noticed that when using the scala 2.12 console with the thin client
that there was weird behavior for the first few seconds of the session.
When prompted with 'scala> ' I would type a letter, say v, and the
output would be 'scala>v' instead of 'scala> v'. It turned out that this
was because the NetworkChannel was returning a stale value for
isEchoEnabled. This happened because NetworkChannel has a method
getProperties that is rate limited under the assumption that the
properties rarely change. This made sense for things like
isAnsiSupported or isSuperShellEnabled but not isEchoEnabled. It is
straightforward to fix this by actually getting the terminal attributes
and checking if the echo flag is set.
2020-09-29 10:21:44 -07:00
Ethan Atkins 57af6ba9b7
Merge pull request #5906 from eatkins/windows-capability-typo
Fix typo in windows end key capability
2020-09-28 17:51:53 -07:00
Ethan Atkins 6532b58482 Fix typo in windows end key capability
The normal ansi escape sequence for the end key is \u001B[4~ not
\u001B[4!. This didn't seem to matter in terms of whether or not the
end key worked but it still is worth changing for consistency. Pointed
out in an issue comment in jline 3
(https://github.com/jline/jline3/issues/578#issuecomment-699834705).
2020-09-28 08:46:06 -07:00
Ethan Atkins 1b2404b287
Merge pull request #5905 from eatkins/ci-hangs
Fix many instances of server test hangs
2020-09-28 08:02:24 -07:00
Ethan Atkins 3966d2fcb2 Catch interrupted exceptions in blockUntilNextExec
It is possible for an InterruptedException to be thrown here because of
logic in NetworkClient. This seemed to be the root cause of the fix I
tried in ca251eb7c8 so I'm reverting that
commit.

Revert "Catch interrupted exception in shell"

This reverts commit ca251eb7c8.
2020-09-28 07:28:24 -07:00
Ethan Atkins 5fee13ad5a Restore string cancellation test
The cancel on-going task with string id test was failing in CI because
of a race condition involving server log messages. We need to wait for a
notification that the project has been compiled before we wait for the
"Waiting for" message, otherwise we might pick up the "Waiting for"
message from the previous test case and try to cancel the task before it
has been created.
2020-09-28 07:28:24 -07:00
Ethan Atkins 90f6d77d59 Send exit in network client before shutdown
In the client test, the sbt server would keep open the the client
connection even after it had exited because the client was only shutting
down its side of the connection. Since in the test it wasn't exiting the
jvm, the read side of the connection was still open.
2020-09-28 07:28:24 -07:00