Commit Graph

10270 Commits

Author SHA1 Message Date
Ethan Atkins 13b09bcd8f
Merge pull request #6166 from eatkins/watch-prompt-fix
Fix watch shell option
2020-11-23 14:46:42 -08:00
Ethan Atkins c6ab4d843e Fix watch shell option
When a user returns to the shell with 's' in recent versions of sbt, the
prompt is not initially displayed. This ends up being because MainLoop
was incorrectly setting the terminal prompt to Prompt.Watch when it
exited watch. I realized in debugging the issue that it didn't make
sense to restort the terminal prompt to the initial value before task
evaluation. By removing that logic, the 's' option option started
working correctly again.
2020-11-23 14:25:11 -08:00
eugene yokota 3a7ab8cf5e
Merge pull request #6165 from eatkins/ipcsocket-jna
Use JNI implementation of ipcsocket APIs on Arm Macs
2020-11-23 16:14:05 -05:00
Ethan Atkins ab2875e837 Use jni implementation of ipcsocket apis on arm macs
There isn't yet a version of the jna available that works with the new
apple silicon using arm64. To workaround this, we can use the jni
implementation by default on arm64 macs. If the user wants to force the
jni implementation for any supported platform, they can opt in with the
`sbt.ipcsocket.jni` system property and/or by setting the serverUseJni
setting.
2020-11-23 12:31:15 -08:00
Ethan Atkins 8e7e3efea1
Merge pull request #6164 from eatkins/thin-client-cancel
Make the thin client `cancel` command work reliably
2020-11-23 11:39:11 -08:00
Ethan Atkins fde8846b48
Merge branch 'develop' into thin-client-cancel 2020-11-23 10:19:24 -08:00
eugene yokota 098575feff
Merge pull request #6163 from eatkins/bump-sbt-version
Update sbt version
2020-11-23 13:16:19 -05:00
Ethan Atkins a9957e5d73 Make the thin client `cancel` command work reliably
When the sbt server is running a task, it presents all connected clients
with a message that instructs them that they cancel the running task.
Unfortunately, this often didn't work and the task would keep running
after cancel was entered. The reason for this was because the exec id
passed in to NetworkChannel did not necessarily match the exec id of the
running task. Because cancel in this case is not really exec specific,
this commit adds a flag to NetworkChannel.cancel that forces it to
cancel the running task regardless of what execID is passed in.
2020-11-23 10:05:47 -08:00
Ethan Atkins 4f0f5cec82 Update sbt version 2020-11-23 09:42:43 -08:00
eugene yokota 909c5aa2c6
Merge pull request #6158 from eed3si9n/wip/pure-expression
Work around "a pure expression does nothing" warning, take 2
2020-11-22 17:35:01 -05:00
Eugene Yokota 00265bf912 Work around "a pure expression does nothing" warning, take 2
In https://github.com/sbt/sbt/pull/5981 I tried to work around the spruious post-macro "a pure expression does nothing" warning (https://github.com/scala/bug/issues/12112) by trying to remove some pure-looking expressions out of the tree.

This quickly backfired when it was reported that sbt 1.4.3 was not evaluating some code. This backs out the macro-level manipulation, and instead try to silence the warning at the reporter level. This feels safer, and it seems to work just as well.
2020-11-22 17:04:19 -05:00
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