Commit Graph

447 Commits

Author SHA1 Message Date
Eugene Yokota d1e0a5a35d cleanFull 2025-11-23 14:45:21 -05:00
Eugene Yokota c8edb171ee [2.x] Adds cleanExpunge command
**Problem**
We might want to clear the disk cache.

**Solution**
This adds cleanExpunge command.
2025-11-22 23:12:18 -05:00
Eugene Yokota 4265b92aa4 perf: Cache content hash of binary files
**Problem**
sha256 is currently a bottleneck for no-op compilation.

**Solution**
This adds a local, in-memory cache of sha256 hashes of binary files
using their timestamp and file size.
The size of the digest cache can be configured using localDigestCacheByteSize,
which is set to 1MB by default.
2025-11-11 15:59:42 -05:00
Eugene Yokota 645908f597 Apply Contraband 2025-09-28 21:28:21 -04:00
xuwei-k 1a882b0dc3 remove some `format: off` comments 2025-09-24 18:49:30 +09:00
Eugene Yokota 2fa3159f18 Update to Contraband 0.8.0 2025-09-19 00:46:34 -04:00
Eugene Yokota 9783cd092b Merge branch '1.11.x' into wip/merge-1.11.x 2025-08-25 02:29:12 -04:00
Eugene Yokota ff328a092d Improve sbtn a bit
1. Remove experimental warning.
2. Buffer the boot log so ANSI output is fixed for JVM client.
3. Remove timestamp.
2025-08-24 03:58:13 -04:00
Eugene Yokota 3b4547718e Remove deprecated methods 2025-05-11 05:23:41 -04:00
Eugene Yokota 8db8c79d33 Implement client-side run
**Problem**
`run` task has been emulated via function call inside of a sandboxed classloader,
and blocking the command processing of sbt server loop.
This poses isolation and availability issues.

**Solution**
This implements client-side run where the server creates a sandbox environment, and sends the information to the client,
and the client forks a new JVM to perform the run.
The client-side behavior has been implemented in sbtn side already.
2025-03-09 15:00:24 -04:00
Eugene Yokota 2c3c0f4a7c Merge branch '1.10.x' into wip/merge-1.10.x 2025-03-08 19:05:30 -05:00
Eugene Yokota 9d4cc80a80 Shortcut sbtn shutdown
**Problem**
WHen portfile is not found, sbtn will try to start the server
even when the desired command is shutdown.

**Solution**
When the command is just shutdown, don't start the server.
2025-03-05 02:27:46 -05:00
Eugene Yokota 67265638c6 Implement client-side run
**Problem**
`run` task blocks the server, but during the run the server is just
waiting for the built program to finish.

**Solution**
This implements client-side run where the server creates a sandbox
environment, and sends the information to the client,
and the client forks a new JVM to perform the run.
2025-03-02 20:45:04 -05:00
xuwei-k 5d660ab8b5 remove unnecessary `case`
- 3ca3633505/rules/src/main/scala/fix/RemoveParameterUntuplingCase.scala
- https://docs.scala-lang.org/scala3/reference/other-new-features/parameter-untupling.html
- https://docs.scala-lang.org/scala3/reference/other-new-features/parameter-untupling-spec.html
2025-02-22 08:48:29 +09:00
Eugene Yokota cb63de6574 Merge branch '1.10.x' into wip/merge-1.10.x 2025-02-10 02:43:30 -05:00
Eugene Yokota a75e847a08 refactor: Refactor response handler
**Problem**
The sbtn response handling code is relatively stragightforward,
but it's a bit messy.

**Solution**
This cleans it up a bit, similar to the style used by Unfiltered
back then (not sure how Unfiltered plans are written nowadays) by
expressing each event handling as a partial function, and composing them
together using `orElse`.
2025-02-09 18:17:02 -05:00
Josh Soref 613eb86447
Spelling (#8028)
* spelling: 1.x

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: a

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: aether

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: anymore

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: artifact

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: available

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: be

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: bridge

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: cannot

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: case-insensitive

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: checksum

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: class loads

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: contra

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: dependencies

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: dependency

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: dependent

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: deriveds

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: describes

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: early

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: enclosed

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: evaluation

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: excluding

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: execution

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: for

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: frequently

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: github

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: green

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: https://www

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: https

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: in-sourcing

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: include

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: incompatible

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: indefinitely

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: information

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: inputted

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: just

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: lastmodifiedtimes

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: latest

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: manifest

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: miscellaneous

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: more

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: neither

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: never

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: nonexistent

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: opted

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: outputting

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: params

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: performance

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: preceding

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: presentation

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: project

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: projects

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: protocol

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: related

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: representation

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: res

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: resolverlist

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: resolverset

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: response

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: returned

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: sbt_version

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: scalacheck

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: sentinels

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: separates

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: serves

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: should

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: significant

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: specifically

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: substitute

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: suppress

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: terminal

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: the

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: title

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: transitive

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: version

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: versions

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: want

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: wanting

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: whether

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* link: sbt Cached Resolution

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* link: Testing sbt plugins

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

---------

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2025-02-04 01:11:28 -05:00
Josh Soref 2ee5eb7fa7 Make timing outputs consistently show hours and hint at time format
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2025-01-29 04:20:37 -05:00
Josh Soref 0493dee315 Make timing outputs consistently show hours and hint at time format
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2025-01-27 12:42:53 -05:00
xuwei-k 13d6626564 update .scalafmt.conf. enforce new scala 3 syntax 2025-01-02 11:25:34 +09:00
xuwei-k f255c38892 use toIntOption instead of scala.util.Try 2024-12-30 13:13:53 +09:00
Eugene Yokota 3d86f30837 Merge branch '1.10.x' into wip/merge-1.10.x 2024-12-16 03:20:10 -05:00
friendseeker fae2bcc01b
Add documentation & deduplicate implementation 2024-10-29 21:40:51 -07:00
Friendseeker 92d4cfa690 Replace nnbsp with regular space 2024-10-29 17:43:33 -07:00
Friendseeker 828dc04808 Migrate all usages of `System.console == null` 2024-10-28 18:25:16 -07:00
Eugene Yokota 56941dac04 refactor: Update Scala 3 syntax 2024-10-27 23:55:30 -04:00
Eugene Yokota 14f7d29afc Contraband 0.7.0 2024-10-27 16:21:18 -04:00
xuwei-k 6922915949 use extension instead of implicit class 2024-10-26 09:05:27 +09:00
Eugene Yokota 0b01ed4743 fix: Fixes BSP
**Problem**
Calling -bsp with --sbt-launch-jar causes "Unrecognized option: --server".
This is because --server is passed in twice since $7775

**Solution**
Since the server invocation by BSP client already passes in --server,
we can remove the extra --server append.
2024-10-24 01:44:49 -04:00
xuwei-k ec70bae39a use extension instead of implicit class 2024-10-23 07:05:38 +09:00
Friendseeker 0e85726858 Use JNI to replace deprecated Jansi & JNA 2024-10-22 13:05:20 -07:00
xuwei-k 6406124aeb add `codecPackage` annotation to `state.contra` 2024-10-19 07:31:07 +09:00
xuwei-k 6bf5b8b30f Update contraband sources 2024-10-18 20:34:44 +09:00
Eugene Yokota d9bc88ab8b Default to sbtn for sbt 2.x
This changes the runner script logic to default to sbtn when sbt version is 2.x.
2024-10-18 01:14:28 -04:00
xuwei-k cfb9ffea95 remove deprecated `[this]` qualifier
https://docs.scala-lang.org/scala3/reference/dropped-features/this-qualifier.html
2024-10-03 21:16:48 +09:00
Eugene Yokota c37b7a1555 feat: Non-blocking run
**Problem**
`run` currently blocks all other commands, such as BSP commands.

**Solution**
`run` no longer blocks the command execution loop.
Instead it pauses the prompt on the current command channel.
2024-09-20 04:00:03 -04:00
Karl Yngve Lervåg dd1218ba12 fix: serverIdleTimeOut -> serverIdleTimeout
Use consistent name for the option. The variable is named `serverIdleTimeout` and this also seems the proper camelcasing of the words.
2024-09-15 15:39:34 -04:00
Karl Yngve Lervåg 5387386c21 fix: serverIdleTimeOut -> serverIdleTimeout
Use consistent name for the option. The variable is named `serverIdleTimeout` and this also seems the proper camelcasing of the words.
2024-09-10 23:31:50 +02:00
Eugene Yokota c81d269ed2 Merge branch '1.10.x' into wip/merge-1.10.x 2024-05-07 04:39:25 -04:00
Adrien Piquerez 2e439cab1e [2.x] report cache errors
Report a cache error if the output file of a task is not cacheable
2024-04-24 10:41:56 +02:00
Adrien Piquerez 03ca5365f5 Fix BuildServerTest 2024-03-19 17:06:09 +01:00
Adrien Piquerez 0458e8063d Adapt -Wunused 2024-03-05 11:23:00 +01:00
Adrien Piquerez c15a4031a9 Fix or mute warnings 2024-03-05 10:39:00 +01:00
adpi2 64be877549
Merge pull request #7491 from adpi2/misc-cleanup
[2.x] Miscellaneous cleanup
2024-02-08 17:42:35 +01:00
eugene yokota ecca26175e
[sbt 2.x] remote cache (#7464)
For the details about this PR, please see the blog post https://eed3si9n.com/sbt-remote-cache/.

* Add cache basics
* Refactor Attributed to use StringAttributeMap, which is Map[StringAttributeKey, String]
* Implement disk cache
* Rename Package to Pkg
* Virtualize packageBin
* Use HashedVirtualFileRef for packageBin
* Virtualize compile task
2024-02-07 10:34:06 -05:00
Adrien Piquerez e18ddb1666 Fix resolution of * on String 2024-02-07 11:47:22 +01:00
adpi2 d53ccda9c4
Merge branch '1.10.x' into commands-progress 2023-10-04 09:49:05 +02:00
Matthew de Detrich 47344d264d
Remove invalid test 2023-09-13 22:34:41 +02:00
eugene yokota f7025eff6a
Merge pull request #7087 from mdedetrich/increase-socket-backlog-for-server-client
Set socket backlog to default size of 50
2023-09-13 11:07:44 -04:00
azdrojowa123 bc00cee4df
Add comment to https://github.com/sbt/sbt/pull/7358 (#7362)
comment for new condition in sbt.BasicCommands.runHelp
2023-08-28 10:48:06 -04:00