Commit Graph

10259 Commits

Author SHA1 Message Date
Eugene Yokota 07f347b0f4 Revert "Strip out raw Ident(_) in blocks if it's synthetic"
This reverts commit a44aee9ac1.
2020-11-22 15:29:16 -05:00
Eugene Yokota 903a155faf Revert "setType to Block(...)"
This reverts commit b62ddaa4e9.
2020-11-22 15:28:59 -05:00
eugene yokota f9478a0231
Merge pull request #6155 from eed3si9n/wip/local_cache
Use `Global / localCacheDirectory` for remote caching
2020-11-22 15:10:49 -05:00
Eugene Yokota bd7a2e05bf Use `Global / localCacheDirectory` for remote caching
Fixes https://github.com/sbt/sbt/issues/6102

https://github.com/sbt/sbt/pull/6026 changed the implementation of remote cache to NOT use dependency resolution (Coursier), and directly use Ivy resolver for efficiency. This was good, but when I made the change, I've changed the cache directory to be `crossTarget.value / "remote-cache"`. This was ok for local testing purpose, but not great for real usage since we don't want the cache to be wiped out either in the CI machines or on a local laptop.

This adds a new Global key called `localCacheDirectory`. Similar to Coursier cache, this is meant to be shared across all builds running on a machine. Also similar to Coursier cache this will try to follow the operating system specifc caching directory.

### localCacheDirectory location

- Environment variable: `SBT_LOCAL_CACHE`
- System property: `sbt.global.localcache`
- Windows: %LOCALAPPDATA%\sbt\v1
- macOS: $HOME/Library/Caches/sbt/v1
- Linux: $HOME/.cache/sbt/v1
2020-11-22 14:35:20 -05:00
eugene yokota 5b55ef1ba3
Merge pull request #6153 from eed3si9n/wip/nightly_instruction
Update nightly build instruction
2020-11-21 15:22:01 -05:00
Eugene Yokota c1fc6f3e88 Update nightly build instruction 2020-11-21 15:17:02 -05:00
eugene yokota f4f8b6a97e
Merge pull request #6151 from eatkins/scripted-batch-execution
Only set scriptedBatchExcution true for >= 1.4
2020-11-21 13:41:01 -05:00
eugene yokota 1be1f6ddcd
Merge pull request #6149 from adpi2/develop
Bump semanticdb version to 4.4.0
2020-11-21 11:36:48 -05:00
Ethan Atkins d686bead0b Only set scriptedBatchExcution true for >= 1.4
In #6091, we updated the ScriptedPlugin to set scriptedBatchExecution :=
true for all 1.x versions but not 0.13. This commit further restricts
the setting so that it is only set for sbt >= 1.4, which seems necessary
based on the comments in #6094.
2020-11-21 08:31:49 -08:00
Adrien Piquerez 136d0ab297 Bump semanticdb version 2020-11-21 16:43:40 +01:00
eugene yokota a84d3329aa
Merge pull request #6146 from eatkins/metabuild
Prepend scala instance jars to sbt classpath
2020-11-20 23:17:42 -05:00
Ethan Atkins 5448a16ba4 Prepend scala instance jars to sbt classpath
When using the launcher's classpath for the metabuild, the
scala-compiler jar can be missing. This is because the managedJars only
method returns the scala-library jar and not the rest of the scala
instance. To fix this, we can always prepend the scala instance jars to
the classpath.

In order to simulate the issue in scripted, I had to manually remove the
scala-compiler.jar from the scripted classpath or else the scripted test
that I added doesn't actually do anything because the scala-compiler.jar
would end up on the app.provider.mainClasspath.

Fixes #4452
2020-11-20 13:11:24 -08:00
eugene yokota 8a93dc96f7
Merge pull request #6145 from eatkins/print-empty-newlines
Print empty newlines with progress
2020-11-20 15:13:22 -05:00
Ethan Atkins 2cf431ee8a Print empty newlines with progress
With the latest sbt code, the `last` command displayed all of the output
without line separators. This occurred because the logic for appending
bytes to System.out split the input bytes on the line separator but if
there was nothing but the line separator in the input bytes then the
result was empty.
2020-11-20 11:35:20 -08:00
eugene yokota 50b8391ea2
Merge pull request #6133 from eatkins/bump-ci-heap-space
Bump max heap size in ci
2020-11-20 13:18:38 -05:00
eugene yokota 82583a14d9
Merge pull request #6132 from eatkins/scripted-debug
Remove debug command from actions/remote-cache
2020-11-20 13:17:36 -05:00
Ethan Atkins 253d5e3499 Bump max heap size in ci
I have noticed that sbt runs better on my computer with 2G of heap.
Assuming we have that much memory on github actions, it seems like a
good idea to increase it there as well.
2020-11-20 08:37:02 -08:00
Ethan Atkins d47dedfc2c Remove debug command from actions/remote-cache
The presence of the > debug command causes all output after this test to
get very verbose.
2020-11-20 08:24:29 -08:00
Ethan Atkins dc10abfa30
Merge pull request #6129 from eatkins/bsp-watch-fix
Fix watch when metals sbt bsp is in use
2020-11-20 08:20:53 -08:00
Ethan Atkins 62ebe70e5c
Merge branch 'develop' into bsp-watch-fix 2020-11-20 07:51:26 -08:00
Ethan Atkins 37ffbf8ddd
Merge pull request #6114 from eatkins/bsp-consolidate
Use NetworkClient to implement `sbt -bsp`
2020-11-20 07:51:11 -08:00
Ethan Atkins 8ee28d5693
Merge branch 'develop' into bsp-consolidate 2020-11-20 07:29:35 -08:00
eugene yokota 6a5c6f48b1
Merge pull request #6130 from eatkins/scripted-hangs
Stop CI hangs in background job service shutdown
2020-11-20 10:05:53 -05:00
Ethan Atkins 14dee32d6b Stop CI hangs in background job service shutdown
A periodic stacktrace showed that scripted tests were still hanging in ci
trying to shutdown the background job service (I had previously thought
that I'd fixed that in 16bef0cfc8). It
appears that there is a logical bug that prevents some jobs from being
removed from the jobSet even though they have finished. If that happens,
the shutdown will never exit. That is highly undesirable and can be
avoided by adding a timeout and also only trying to shutdown the job if
it is actually running.
2020-11-19 22:26:41 -08:00
Ethan Atkins 2b45183d09 Cleanup user thread task submission
I found this code difficult to reason about so I refactored it so that
it was easier for me to understand.
2020-11-19 18:57:26 -08:00
Ethan Atkins 600628e8e9 Fix watch with metals sbt bsp implementation
I discovered that the metals bsp implementation worked very badly with
continuous builds. The problem was that metals is able to trigger a bsp
compile slightly before the continuous build would trigger. This would
cause the ui to get in a bad state. The worst case was that it would
actually cause sbt (or the thin client) to exit. A less catastrophic
issue was that it was possible for the wrong count to be printed by the
continuous message.

This commit fixes the issue by more carefully managing the prompt state
and only resetting the ui when the prompt is not in the Prompt.Watch
state.
2020-11-19 18:57:24 -08:00
Ethan Atkins 7a8a5e5dac Disable console ui for client launched server
If the sbt server is launched by the remote client, it should not have a
console ui thread because there is no way to even feed input to it once
the server has launched. Having the ui thread can cause the server to
exit unexpectedly if an EOF is read from the console input stream.
2020-11-19 16:10:03 -08:00
Ethan Atkins f3b3148c58 Use NetworkClient to implement `sbt -bsp`
Network client already supports the -bsp command (since
65ab7c94d0). This commit reworks the
BspClient.run method so that it delegates to the NetworkClient. The
advantage to doing it this way is that improvements to starting up the
sbt server by the thin client will automatically propagate to the -bsp
command. The way that it is implemented, all of the output generated
during server startup will be redirected to System.err which is useful
for debugging without messing up the bsp protocol, which relies on only
bsp messages being written to System.out.
2020-11-19 16:03:26 -08:00
Ethan Atkins 68933a628d
Merge pull request #6128 from eatkins/logger-thunk
Only evaluate log message thunk once
2020-11-19 16:03:07 -08:00
Ethan Atkins 3ff85b175d Only evaluate log message thunk once
When there are multiple console appenders for a logger, we inadvertently
evaluated the message thunk for each appender which would cause side
effects to be unexpectedely evaluated multiple times.

Fixes part of #6126.
2020-11-19 14:58:48 -08:00
eugene yokota a185e24fff
Merge pull request #6127 from eatkins/restore-sbtopts
Restore .sbtopts file
2020-11-19 16:32:26 -05:00
Ethan Atkins 184c59d4c0 Restore .sbtopts file
I noticed that the sbt project has gotten much slower to compile on my
computer and that bumping the memory helped a lot. With 1GB, it seems to
take about 60-70 seconds for a clean compile and with 2GB it takes
between 35-40 seconds.

Note that this will break sbt loading on windows using the batch script.
This should be fixed in sbt 1.4.4:
https://github.com/sbt/sbt-launcher-package/pull/344.
2020-11-19 12:42:26 -08:00
eugene yokota 87d0972b03
Merge pull request #6121 from xuwei-k/dotty-update
Update dotty and scala versions in tests
2020-11-19 14:53:48 -05:00
eugene yokota 711a590bc4
Merge pull request #6125 from eatkins/sort-scripted-tests
Sort scripted tests
2020-11-19 14:52:53 -05:00
Ethan Atkins f6e7e3a867 Revert "Mark project/src-scala-binary-version as pending"
This reverts commit 3d02f8902e.
2020-11-19 11:15:13 -08:00
Ethan Atkins 3ff0c296b9 Sort scripted tests
We're seeing errors in github actions that may be related to scripted
test ordering.
2020-11-19 10:57:42 -08:00
xuwei-k 6344de924a Update dotty and scala versions in tests
add "-Ytasty-reader" option

3743cad6ce
2020-11-20 01:06:01 +09:00
eugene yokota f4921e3dd7
Merge pull request #6105 from eatkins/jline3-upgrade
JLine 3.17.1
2020-11-18 22:31:02 -05:00
eugene yokota e96ae5779b
Merge pull request #6118 from eed3si9n/wip/1.5.0-SNAPSHOT
1.5.0-SNAPSHOT
2020-11-18 22:26:28 -05:00
Eugene Yokota dfbce5586e 1.5.0-SNAPSHOT 2020-11-18 18:47:33 -05:00
eugene yokota 9985cb4b1c
Merge pull request #6115 from eatkins/thin-client-startup
Fix thin client sbt process startup output
2020-11-18 18:26:28 -05:00
eugene yokota 9abcbfa31b
Merge pull request #6113 from eatkins/thin-client-shutdown
Fix shutdown for thin client shell
2020-11-18 18:25:36 -05:00
eugene yokota 1d0e6928fe
Merge pull request #6116 from eatkins/supershell-interlace-v2
Fix supershell blowing away lines on windows
2020-11-18 18:18:25 -05:00
Ethan Atkins f3120f8f15 Fix supershell blowing away lines on windows
In 85d17889b6, I attempted to fix
supershell messages getting interlaced with log lines. It turned out
that that approach didn't work with windows and was causing all of the
output to bet blown away. A better approach is to check if the bytes
we're writing contain one or more line separators. If so, we can wrap
the bytes in a string and split the string into lines. Then we can
append a ClearScreenAfterCursor before every newline.

I think the problem with windows was that the ClearScreenAfterCursor was
coming between the carraige return and the newline.
2020-11-18 13:42:52 -08:00
Ethan Atkins 8137c80782 Fix thin client sbt process startup output
The boot server socket was not working correctly when the sbt server was
started by the thin client. This was because it is necessary for us to
create a ConsoleTerminal in order for System.out and System.err to be
properly forwarded to the clients connected over the boot server socket.
As a result, if you started a server instance of sbt with the thin
client, you wouldn't see any output util you connected to the server.
The fix is to just make sure that we create a console terminal if sbt is
run as a subprocess.
2020-11-18 12:38:44 -08:00
Ethan Atkins 39af464dfd Fix shutdown for thin client shell
When a user enters shutdown in the thin client console, it only exits
the thin client, it does not actually shutdown sbt. Running `sbtn
shutdown` did work to shutdown the server, however. It turned out that
this was because there was special handling for shutdown when processed
through jline. We would enqueue the shutdown command and also close the
client connection. Closing the client connection though removed all of
the enqueued commands for the client, which included the shutdown
command. To fix this, we just make sure that we don't remove the
shutdown command when clearing the client commands.
2020-11-18 12:20:48 -08:00
Ethan Atkins c34678e9db Upgrade jline 3
We no longer need to use the forked version of jline because they have
merged in our required changes. The latest version of jline does upgrade
jansi, however, and some of the apis we were relying on for windows were
removed so they had to be manually implemented. I verified that console
input still worked on my windows vm after this change.
2020-11-18 12:18:08 -08:00
Ethan Atkins 927151485d Exclude jansi classes from metabuild top loader
The launcher embeds a fixed version of jansi above the rest of the
classpath on windows. This causes problems for the scala 2.12 console
because it tries to load methods that don't exist from the old jansi
jar. This can be fixed by excluding all jansi classes from the top
loader.

We also need to exclude jansi classes in the scala instance top class
loader to make the 2.10 console work because scala 2.10 uses a shaded
jline that requires a very old jansi version. Due to the shading, the
thin client doesn't work with the 2.10 console.
2020-11-18 12:18:08 -08:00
eugene yokota 1ea0fb7d23
Merge pull request #6112 from eatkins/supershell-interlace
Fix supershell line interlacing with logs
2020-11-18 15:15:19 -05:00
eugene yokota 94dc172ab6
Merge pull request #6111 from sbt/dependabot/github_actions/actions/cache-v2.1.3
Bump actions/cache from v1 to v2.1.3
2020-11-18 15:14:41 -05:00