Commit Graph

10294 Commits

Author SHA1 Message Date
eugene yokota 1dcafebb9c
Merge pull request #6207 from adpi2/scala3-libmanagement
Remove dotty tool dependencies
2020-12-17 11:03:09 -05:00
Adrien Piquerez f38a7272e7 Remove dotty tool dependencies 2020-12-17 10:24:07 +01:00
eugene yokota acc94fd847
Merge pull request #6199 from adpi2/sbt-dotty
Add compiler-interface to the Scala Instance top loader
2020-12-11 13:32:06 -05:00
Adrien Piquerez c9ab2ee558 Put compiler-interface in the Scala Instance top loader 2020-12-11 11:47:08 +01:00
eugene yokota 5d1c394bb4
Merge pull request #6190 from mkurz/fix_onLoad
onLoad now runs with correct FileTreeRepository and CacheStoreFactory
2020-12-03 21:28:34 -05:00
Matthias Kurz 0dc7622969
Use identity 2020-12-04 00:36:48 +01:00
Matthias Kurz 8e48630376
onLoad now runs with correct FileTreeRepository and CacheStoreFactory 2020-12-04 00:01:47 +01:00
eugene yokota 4d1af77701
Merge pull request #6189 from eatkins/jline-console-close
Close jline 3 terminal when console exits
2020-12-03 13:01:59 -05:00
Ethan Atkins 2e208af7c1 Close jline 3 terminal when console exits
The jline 3 Terminal is an autocloseable and should be closed when we're
down with it. I'm not exactly sure what resources we were potentially
leaking, but the jline3term variable is an instance of the jline
AbstractTerminal class which I know can create a thread in some
circumstances. This came up while working on #6185.
2020-12-03 08:30:14 -08:00
eugene yokota 2bbbcfae77
Merge pull request #6174 from hamnis/bsp_connection_file_possibly_disabled
Make it possible to not write the bsp connection file
2020-11-29 11:46:24 -05:00
Erlend Hamnaberg a554976ffb Update main/src/main/scala/sbt/internal/server/BuildServerProtocol.scala
Change from review

Co-authored-by: Adrien Piquerez <adrien.piquerez@gmail.com>
2020-11-29 16:36:38 +01:00
Erlend Hamnaberg 341e09a07e Make it possible to not write the bsp connection file
Made the bspConfig task dependendant on the bspConfig value.
Changed the bspConfig setting to use a attributeKey so we can use it in the server as well.
2020-11-27 20:00:12 +01:00
João Ferreira e1d8f0cafd
Updates to Coursier 2.0.7 (#6120)
* Updates to Coursier 2.0.7

https://github.com/coursier/sbt-coursier/releases/tag/v2.0.4 which includes https://github.com/coursier/coursier/releases/tag/v2.0.7

> Memo-ize classes that can be created at a high rate

coursier.core.{Dependency, Module, Publication} are now memo-ized (using weak references). This can lower the amount of duplicate instances of these objects, and lower GC pressure.
2020-11-26 19:25:37 -05:00
eugene yokota 29358529f9
Merge pull request #6171 from eatkins/ctrl-c-watch
Fix ctrl+c handling after exiting watch
2020-11-26 12:30:59 -05:00
Ethan Atkins 5c508e4275 Fix waitWatch failure handling
The waitWatch command is very similar to shell in that it should
override the onFailure command to be itself. It also enqueues itself to
remaining commands whenever it reads a new command which made it
unnecessary to append waitWatch to the runCommmand in Continuous.
2020-11-25 14:54:13 -08:00
Ethan Atkins 90ca463c70 Add signal registration in LineReader
It is possible for the signal handler to get in a state where it has no
effect in the shell. When this happens, entering ctrl+c does not exit
the shell. To ensure that ctrl+c always exits the shell, we can register
a signal handler in the line reader that write -1 to the terminal input
stream, which should cause the line reader to return an exit command.
2020-11-25 14:31:29 -08:00
Ethan Atkins c24e7da844 Rethrow InterruptedException instead of ClosedException
There are cases where sbt will incorrectly shutdown if the jline reader
is interrupted while filling the input buffer. To fix this we can throw
an InterruptedException instead of a ClosedException.

The repro for this was start `sbt`, input `~compile` and while sbt was
starting up, open a source file with vim using the metals bsp
integration. sbt server would end up shutting down everytime after a
single compilation iteration.
2020-11-25 14:31:29 -08:00
eugene yokota d46d5dfff5
Merge pull request #6168 from eatkins/ipcsocket-upgrade
Update ipcsocket
2020-11-25 11:49:15 -05:00
Ethan Atkins d5ddf0f8ce
Merge branch 'develop' into ipcsocket-upgrade 2020-11-25 08:25:11 -08:00
eugene yokota 1051690d61
Merge pull request #5515 from jtjeferreira/better_file_input
introduce a new Input/Output: FileInput/FileOutput
2020-11-25 11:11:04 -05:00
Ethan Atkins 3f3e219e0f Update ipcsocket
The new version provides an apple silicon arm64 jni implementation of
the ipcsocket api. It also adds a jni implementation for getting the max
socket length which is necessary because jna isn't supported on the
apple arm64 platform yet.
2020-11-25 07:34:11 -08:00
João Ferreira dd411cac9f introduce a new new Input/Output: FileInput/FileOutput
* FileInput avoids the intermediate String parsing of PlainInput
* FileOuput also avoid the intermediate String representation of PlainOutput
2020-11-25 14:04:56 +00:00
eugene yokota 2e248ca7c2
Merge pull request #6167 from eatkins/client-jni
Use jni if required when running client from xMain
2020-11-24 16:54:18 -05:00
Ethan Atkins 5769f80cbe Use jni if required when running client from xMain
See https://github.com/sbt/sbt/issues/6162#issuecomment-733207878.
2020-11-24 12:35:53 -08:00
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