Commit Graph
1344 Commits
Author SHA1 Message Date
kenji yoshida 3dc5e621f6 [2.x] deps: Remove disruptor dependency (#9797) 2026-09-20 04:42:25 -04:00
eugene yokota 2ef94e086c [2.x] Custom user agent (#9786)
**Problem**
We want to track the network request created by sbt.

**Solution**
This sets both sbt version and Coursier version into the user agent.
2026-09-17 23:10:52 -04:00
eugene yokota e95712b79f [2.x] deps: Coursier 2.1.25 (#9784) 2026-09-17 19:20:43 -04:00
kenji yoshida 0b5075fc4b [2.x] Remove dataclass-annotation dependency (#9776) 2026-09-16 12:55:46 -04:00
Albert MeltzerandClaude Opus 5 7563b7790b [2.x] Allow adding rows and configuring them separately, and through any method (#9765)
* [2.x] test: Pin what a platform axis alone does

**Problem**
`jsPlatform` enables the Scala.js plugin; the axis does not. A row
built by `customRow` with `VirtualAxis.js` is a Scala.js row by every
name it carries and a JVM row by what runs.

**Solution**
Assert what such a row reports as its platform.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>

* [2.x] feat: Enable JS/Native plugins if the axis is used

Only jsPlatform and nativePlatform enabled the plugin their platform
needs, so using customRow directly would skip it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* [2.x] feat: Configure the rows a matrix builds

A build could reach every row with configure, or one row with the call
that made it, and nothing in between, so settings for the rows of one
platform travelled with every call that creates them. Now
configureRows takes a function of a row's axes and answers with what
to apply, and a row is given it as it is built, so a row declared
after the call is covered too.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-09-16 21:53:11 +09:00
kenji yoshida 21fe27f62c [2.x] ci: Fix warnings (#9768) 2026-09-14 19:28:07 -04:00
kenji yoshida 0fc907cf85 [2.x] ci: Update mima setting (#9760) 2026-09-14 17:21:38 -04:00
eugene yokota e0666adb7b [2.x] Use sbt 2.1.0-M1 (#9767) 2026-09-14 17:20:36 -04:00
eugene yokota 14148450e2 [2.x] Update sbtn to 2.1.0-M1 (#9755) 2026-09-13 03:25:25 -04:00
eugene yokota 801280dc61 [2.x] fix: clean task (#9752)
**Problem**
The clean task no longer works as intended on sbt 2.x due to the disk cache.

**Solution**
This implements an in-memory state of invalidation for subproject and
configuration axes. So clean task would mark subprojects to be
invalidated regardless of the disk cache state.
The invalidation state would be lifted once any cached task executes,
so it's not technically same as sbt 1.x, but the UX should be similar.
2026-09-12 23:18:11 -04:00
Albert Meltzer 9532b51190 ci: Upgrade MiMa to 1.2.0 (#9750)
* build: Upgrade MiMa to 1.2.0
* build: Filter every sbt.internal problem at once
2026-09-11 19:28:12 -04:00
Stas Shevchenko e1ccd99927 [2.x] feat: Add LoggerContext.removeAppender for single appender removal (#9740)
LogExchange.unbindLoggerAppenders calls clearAppenders, which drops and closes every appender on the logger. So if you bind an appender to the global logger and then unbind it, sbt's own console and backing appenders go with it and nothing prints for the rest of the session.

LoggerContext now has removeAppender(loggerName, appender), which removes that one instance by identity and closes it. LogExchange gets an unbindLoggerAppenders(name, appenders) overload on top of it, so unbinding mirrors binding. The existing single-arg version behaves as before, it just says in the scaladoc what it does now.
2026-09-10 23:57:48 -04:00
Jozef Koval 4b88cdd959 [2.x] fix: Diagnose task-local dependency references (#9728)
Task-local filters used in sources.all(filter).value currently produce generic Scala macro scope errors. Report one actionable diagnostic at the offending reference, explaining how to move the definition outside the task or use Def.taskDyn.
2026-09-10 23:50:35 -04:00
Eugene Yokota f9688c1464 Apply Scalafmt format (Scala 3 syntax) 2026-09-10 14:16:27 -04:00
eugene yokota 2238e405b8 [2.x] fix: Fail the build on bad resource generator (#9735)
**Problem**
Currently bad resources are silently dropped.

**Solution**
1. Fix a bad resource generator in the build.
2. Fail the build when bad resources are found.
2026-09-10 01:22:34 -04:00
Anatolii Kmetiuk 56ee42565c [2.x] fix: Remove Ivy API usage from build publishing plugins (#9723) 2026-09-10 10:30:39 +09:00
Stas Shevchenkoandeugene yokota f389e676cd fix: restart the sbt server when -D options change (#9685)
* fix: restart the sbt server when -D options change

* fix: don't restart on completions, wait for the socket

* fix: only trust -D options recorded for this build

* fix: confirm the server left before reporting it gone

* Update protocol/src/main/contraband/portfile.contra

Co-authored-by: eugene yokota <[email protected]>

* fix: record the server -D options as a list

* fix: record the -D options without their values

The connection file keeps the name of each option and a salted digest of it
rather than the option itself, and the comparison follows the JVM in taking the
last definition of a name. A client that is not allowed to restart the server
says which options it cannot pick up instead of staying quiet about them.

* fix: compare the -D options given before a command

A trailing -D option used to switch the whole comparison off, which dropped the
options written before it, and a shutdown request that never reached the server
waited the full timeout before saying so.

* fix: leave a server no client started alone

The connection file says whether its recorded options are the whole story, so a
server an editor keeps is warned about instead of shut down, while one the client
started with no options is still replaced. A restart that cannot reach the server
warns and carries on rather than failing the invocation.

* build: filter NetworkClient clinit in MiMa

---------

Co-authored-by: eugene yokota <[email protected]>
2026-09-08 11:46:36 +09:00
eugene yokota ffe095f5b7 [2.x] ci: Fix nightly publishing (#9705) 2026-09-01 14:49:07 -04:00
Stas Shevchenko 9d0272adf9 [2.x] perf: Cut redundant hashing in disk action cache (#9649)
Follow-up to #9643. The verification added there re-read every downloaded blob right after writing it, and it sat on top of an older cost: DiskActionCacheStore fully re-hashes CAS files on every findBlobs/syncBlobs/getBlobs call, even though the file name is the digest. On a cache hit that meant hashing a whole classpath worth of blobs just to conclude nothing changed.

- Remote blobs (grpc downloads and inline data) are hashed while the stream is written to a staged temp file, then moved into the CAS, so verification costs no extra I/O and tampered bytes never land under the CAS name. Local puts are copied without hashing and are not stamped, so a mismatched local file is still caught by the lookup hash.
- Verified entries are remembered per process by (digest, size, mtime, fileKey), so repeated lookups are a stat instead of a full hash. Any external change to a CAS file invalidates the stamp and forces a re-hash. This is the same trade-off CacheImplicits already makes for file stamps.
2026-09-01 01:54:39 -04:00
eugene yokota a62c3d62f4 [2.x] Scala 3.9.0 (#9439)
Use Scala 3.9.0 for metabuild.
2026-08-27 01:44:57 -04:00
eugene yokota d4ada26c86 [2.x] fix: Fixes JDK 17 domain socket deadlocks (#9671)
**Problem**
Channels.newInputStream/newOutputStream share a channel-wide lock,
which would deadlock for a duplex communication.

**Solution**
This implements an alternative DuplexChannels functions that's capable
of duplex communication expected of a "socket".

This also duplicates the Java implementation to the worker app,
so we can use JDK domain socket for forked test communication.
2026-08-25 02:02:37 -04:00
eugene yokota efb9f93fca [2.x] test: Community Build (#9659)
This adds community build based on the JUnit harness used on scala/scala3.
2026-08-24 12:03:22 -04:00
eugene yokota a91cf079db [2.x] Remove Ivy dependency (#9615)
**Problem**
sbt still has some code that's depending on Ivy.

**Solution**
This removes it.
2026-08-24 12:02:28 -04:00
eugene yokota bd9d9b3f5d [2.x] Symlink CLAUDE.md to AGENTS.md (#9663) 2026-08-24 03:38:07 -04:00
eugene yokota 7115e7c36b [2.x] Update sbtn to 2.0.0-8753a981 (#9630) 2026-08-19 12:53:20 -04:00
eugene yokota 6365a07230 Merge commit from fork
[2.x] fix: Gate LSP calls behind auth
2026-08-06 23:04:54 -04:00
tanaka takaya 1038618246 [2.x] perf: Memoize the artifact content hash in LibraryManagementCodec (#9563)
**Problem**
Serializing an UpdateReport re-reads every artifact through sjson-new's
File iso to recompute its sha256, so every ActionCache key computation
and Tracked write-back re-reads the whole dependency classpath on every
invocation, including no-ops.

**Solution**
Override the iso with a hash memoized by (path, size, lastModified),
with the same invalidation semantics as the digest cache in sbt/sbt#8363,
and mix it into the generated codec via contrabandCodecParents.

Generated-by: Claude Fable 5
2026-08-06 20:46:13 -04:00
Eugene Yokota e6ac4ecffc [2.x] fix: Gate LSP calls behind auth
**Problem**
Some custom LSP calls do not check initialize-handshake,
which over TCP includes token-based authentication.

**Solution**
This adds checkAuthenticated check around sbt/exec etc.
2026-08-06 14:02:51 -04:00
eugene yokota 5d7dbdb427 [2.x] sbtn 2.0.0-731e6666 (#9545) 2026-08-03 03:38:20 -04:00
eugene yokota 67924298f2 [2.x] fix: Fixes sbtn stdin race condition (#9521)
**Problem**
There's a race condition between per-byte readSystemIn notification
and one-byte-read thread lifecycle.

Note: One-byte-read thread was introduced as a solution to the problem
that switching the terminal between raw and canonical mode cannot happen
if it's blocked by read.

**Solution**
This eliminates the thread lifecycle issue by keeping the thread alive
throughout the lifecycle of sbtn itself.
read is still called on demand by the server readSystemIn notification.
2026-07-27 19:52:30 -04:00
kenji yoshida 551857bbd4 [2.x] ci: Update mima setting (#9511) 2026-07-26 23:17:06 -04:00
eugene yokota 9f0a459f81 Merge pull request #9502 from eed3si9n/wip/grpc
[2.x] fix: Intern GrpcActionCacheStore
2026-07-26 01:01:27 -04:00
eugene yokota b81265bdb5 [2.x] sbtn 2.0.0-a0c4773a (#9503) 2026-07-26 00:57:19 -04:00
Eugene Yokota b98c443b5c Add remote-cache test 2026-07-25 23:27:49 -04:00
Eugene Yokota 65e8f34696 [2.x] fix: Intern GrpcActionCacheStore
**Problem**
GrpcActionCacheStore gets recreated per reload.

**Solution**
This interns GrpcActionCacheStore based on the parameters.
2026-07-25 22:38:32 -04:00
31f232c84a [2.x] fix: Register every Def.declareOutput execution, not one per call site (#9492)
The cached-task macro allocated one mutable slot per syntactic
Def.declareOutput / Def.declareOutputDirectory call site and snapshotted the
slots into the task's outputs after the body ran. A call inside a loop or .map
over a runtime-determined list is a single syntactic site executed many times,
so each iteration overwrote the same slot and only the last file was cached and
restored on a cache hit. There was also no way for a conditional call site that
did not execute to stay out of the outputs: its slot remained null.

Declared outputs now accumulate in a per-task ListBuffer: the macro emits one
buffer at the top of the cached body and rewrites each call site to
ActionCache.registerOutput(vf, buffer), which appends and returns the value.
Every execution registers, an unexecuted site contributes nothing, and the
static multi-site shape is unchanged.

Refs #9462 (the declareOutput-in-a-loop half)

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: eugene yokota <[email protected]>
2026-07-24 02:55:33 -04:00
eugene yokota 2e303787a5 [2.x] Allow opt-out of transient warning (#9437)
**Problem**
We want to opt out of the transient key warning.

**Solution**
This implements an optout via nowarn annotation.
2026-07-24 01:42:06 -04:00
kenji yoshida 110a140295 [2.x] ci: Fix warnings in build.sbt (#9494) 2026-07-23 19:09:40 -04:00
eugene yokota 3f073b0059 [2.x] Use JDK's Unix domain socket for bootserver (#9427)
Use JDK's Unix domain socket for bootserver.
2026-07-22 23:57:13 -04:00
kenji yoshida e1f118743c [2.x] ci: Build sbt/sbt using sbt 2 (#9244) 2026-07-20 12:38:53 -04:00
eugene yokota b76ac09d44 [2.x] Bump version number (#9470) 2026-07-17 18:53:28 -04:00
eugene yokota 9f83cb1ef0 [2.x] sbtn 2.0.0-b4d628dd (#9443) 2026-07-12 21:07:14 -04:00
eugene yokota 0ef972706c [2.x] fix: Fixes global plugin loading (#9391)
**Problem**
Global plugin loading doesn't work.

**Solution**
1. Use ModuleID from to supply the location of global-plugin module.
2. Update pluginData with the global plugin classpath.
2026-06-28 14:57:18 -04:00
Anatolii Kmetiuk 4ed16c96ce [2.x] Fix publishDiagnostics propagation (#9376)
**Problem**
Test is based on https://github.com/sbt/sbt/issues/9345#issuecomment-4718229113 which gives us the following sequence:

1. Metals sends buildTarget/compile.
2. sbt publishes real non-empty diagnostics.
3. Metals sends buildTarget/scalaMainClasses.
4. During that request, sbt emits build/publishDiagnostics with diagnostics: [] and reset: true.
5. The following build/taskFinish still reports errors: 1.

Previously, errors for diagnostics reporting via bsp were collected from a live compilation run. In the sequence above, that is triggered by buildTarget/compile. Then, buildTarget/scalaMainClasses does not trigger such a run for the second time, it uses the cached compilation result. Therefore, the diagnostics is not populated.

**Solution**
The proposed fix modifies sendFailureReport to accept an optional CompileFailed object that contains the diagnostics even in case the actual compiler did not run because the cached result was used. If no problems were found for a file via default means, this CompileFailed object is queried to see if it has any information about problems in a given file.
2026-06-26 12:36:42 -04:00
eugene yokota f468735c9f [2.x] sbtn 2.0.0-2932685e (#9363) 2026-06-21 14:41:45 -04:00
kenji yoshida c33b795c78 [2.x] ci: Update version and ivy tests (#9342) 2026-06-15 12:28:14 -04:00
kenji yoshida 29f2c8648f [2.x] ci: Update mimaPreviousArtifacts (#9341) 2026-06-15 12:26:58 -04:00
eugene yokota 183ed46375 [2.x] sbtn 2.0.0-f0d2fae4 (#9333) 2026-06-14 01:32:02 -04:00
kenji yoshida ad6c7a35a8 Update mimaPreviousArtifacts (#9308) 2026-06-09 14:21:18 -04:00
eugene yokota ac320c7fd0 [2.x] fix: ByteStream chunked upload/download (#9298)
**Problem**

BatchUpdateBlobsRequest suffers from gRPC's message size limitation.

**Solution**

For larger files, we switch to using the ByteStream API, chunked to 1MB at a time.
2026-06-07 15:17:20 -04:00