18398 Commits
Author SHA1 Message Date
eugene yokota b7bba1147a Merge pull request #9868 from eed3si9n/wip/cpu-load
[2.x] fix: Fix task output lost by the thin client under CPU load
2026-10-04 16:57:12 -04:00
Eugene Yokota 1d53696285 [2.x] docs: Update commit message guideline 2026-10-04 00:24:33 -04:00
Eugene YokotaandClaude Opus 5.5 0dc72f0a21 [2.x] fix: Fix task output lost by the thin client under CPU load
**Problem**
Under CPU load, the thin client sometimes loses task output. The channel
started reading before it was subscribed, so an early sbt/attach was
dropped and the command ran on an unattached channel.

**Solution**
Start the channel threads after subscribing it.

Fixes #9834

Generated-by: Claude Code

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-03 21:19:18 -07:00
EugeneandEugene f4618946c5 [2.x] fix: Read all forked test output before reporting the fork's exit (#9860)
**Problem**
When a forked test JVM exits, WorkerProxy.watch calls notifyExit right
away, and on exit code 0 that completes the run. If the response reader
has not consumed the rest of the stream yet, the remaining events, logs and
the final response are dropped, and the build passes with failing tests
unreported. Slow listeners, or several forks at once, make this likely.

**Solution**
Track when the response stream reaches end of input (the socket reader for
Tcp/Ipc, stdout for Stdio), and have the watch thread wait for it, with a
bound, before calling notifyExit. This is what sbt 1.x did by joining the
acceptor thread. The new scripted test uses a listener that sleeps per
event, and fails without this change.

Fixes #9859

Generated-by: Claude Opus 5.5

Co-authored-by: Eugene <[email protected]>
2026-10-03 23:12:50 -04:00
Albert MeltzerandClaude Opus 5.5 07929cce29 [2.x] CrossVersion: make parser public (#9864)
PR #9790 added parser as qualified-private, anticipating use limited to
internal code; however, as PR #9781 will now be moved to a plugin, let's
relax the visibility limitation.

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-03 23:10:27 -04:00
eugene yokotaandClaude Opus 5.5 e5d555a84e [2.x] ci: Rebalance scripted jobs (#9867)
**Problem**
Scripted job 3 is near the 25 minute timeout, and tests/* runs twice.

**Solution**
Drop tests/* from job 2, and move groups from job 3 to jobs 4 and 7.

Generated-by: Claude Code

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-10-03 23:10:05 -04:00
eugene yokota d1b8c573d5 [2.x] fix: Use Path.userHome (#9866)
**Problem**
user.home can return "?"

**Solution**
This centralize to Path.userHome, which works around the JDK bug.
2026-10-03 22:05:40 -04:00
kenji yoshida 1f1d094747 [2.x] Replace old sun.misc.Unsafe lazy val in lmCoursierShaded (#9853) 2026-10-01 23:57:57 -04:00
eugene yokota 7c7b676aa8 [2.x] deps: sbtn 2.1.0-6eac8efa (#9861) 2026-10-01 22:18:16 -04:00
eugene yokotaandClaude Opus 5.5 a1a1ec83d1 [2.x] fix: Fix one-line catch cases broken by the reformat (#9857)
**Problem**
The Scala 3 syntax reformat (f9688c146) turned braced catch blocks such
as

    catch { case e: Exception => e.printStackTrace(); 1 }

into one-line catch cases. A one-line catch case body is a single
expression, so the semicolon ends the catch case and the value after it
becomes a separate statement that is always the result. ForkTest always
saw an exit code of 1 and both of its properties failed, and
extractLicenses0 in the build always returned Nil instead of the
license files referenced by NOTICE.

**Solution**
Put the catch case bodies on their own lines so the trailing value is
part of the catch case again.

Generated-by: Claude Opus 5.5

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-10-01 19:07:26 -04:00
eugene yokota 6eac8efab3 Merge pull request #9856 from eed3si9n/wip/watch
[2.x] fix: Fixes watch ignoring file events
2026-10-01 18:54:04 -04:00
Eugene YokotaandClaude Opus 5.5 817ed24aeb [2.x] fix: Reset build source stamps on every load
**Problem**
CheckBuildSources.reset only refreshed the stored build source stamps
when the set of build source globs changed. A reload that did not go
through the command-level check (for example, scripted batch mode
reusing one sbt instance across tests) kept stale stamps, so the next
check reported unchanged build files as modified and reloaded sbt in
the middle of a watch. That reload closed the file tree repository the
watch was still using, failing the next iteration with "Tried to invoke
register on closed repository".

**Solution**
Take a fresh baseline of the build source stamps on every load.

Generated-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-01 18:29:21 -04:00
Eugene YokotaandClaude Opus 5.5 e2ae392599 [2.x] fix: Fixes watch ignoring file events
**Problem**
Since 2.1.0-M1, the tilde command starts watching but never triggers a
build on a source change. The Scala 3 syntax reformat (f9688c146)
rewrote

    catch { case _: InterruptedException => interrupted.set(true); Nil }

into a braceless one-liner. Without braces, the semicolon ends the catch
case, so the block became the try/catch expression followed by Nil, and
the events value was always Nil. Every file event was discarded.

**Solution**
Put the catch case body on its own lines so Nil is the value of the
catch case again.

Generated-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-01 18:29:21 -04:00
Eugene Yokota f95ec6e6bb [2.x] test: Restore watch tests 2026-10-01 18:29:21 -04:00
eugene yokotaandClaude Opus 5.5 4705874544 [2.x] fix: Keep the interrupt flag in more thin-client paths (#9855)
**Problem**
Like #9848, some paths still swallow InterruptedException. The
NetworkTerminal request methods block on queue.take, so an
interrupted task thread gets a default value back and loses its
interrupt flag. removeChannel still uses put, and the client's boot
read thread ignores the interrupt meant to stop it.

**Solution**
Restore the flag in NetworkTerminal (in withThread only while the
terminal is open), use add in removeChannel, and stop the read
thread on interrupt. Add tests to NetworkChannelSpec.

Generated-by: Claude Opus 5.5

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-10-01 16:24:48 -04:00
Michał Pierściński 77ef215dfa [2.x] fix: Keep the interrupt flag when writing to the thin client (#9848)
**Problem**
In the default thin-client mode, writing to System.out or System.err
from an interrupted thread throws InterruptedException and clears the
interrupt flag. NetworkChannel enqueues output with `put` on unbounded
LinkedBlockingQueues, and `put` acquires its lock with
lockInterruptibly(). Logging libraries swallow the exception, so the
interrupt is silently lost and code relying on it can hang.

**Solution**
Use `add` instead of `put` on the unbounded queues. They never block,
so no other behavior changes. Add regression tests to
NetworkChannelSpec.

Fixes issue #9845

Generated-by: Claude Opus 5.5
2026-10-01 13:47:20 -04:00
eugene yokota eaedb46ad9 [2.x] fix: Remove write permission from CAS (prevent CAS corruption) (#9847)
**Problem**
CAS currently allows write through.

**Solution**
This prevents it on POSIX systems.
2026-10-01 13:03:36 -04:00
eugene yokota fbaf4be64f [2.x] deps: Update Coursier to 2.1.26 (#9852) 2026-10-01 12:35:15 -04:00
eugene yokota 89f47dc429 [2.x] fix: Fixes analysis cache not retaining recent Analysis (#9851)
**Problem**
Caffeine cache takes in account of how often the data was used,
so once 20 analysis fills up the cache, the last addition
may immediately get evicted.

**Solution**
Replace Caffeine cache with LRU cache.
2026-10-01 01:08:15 -04:00
eugene yokota 986a4c5167 [2.x] Use JDK AF_UNIX socket (#9846) 2026-09-30 00:09:57 -04:00
Matthias KurzandClaude Opus 5.5 121bab88bb [2.x] fix: Forward -J options to sbt server (#9839)
**Problem**
The native thin client discards -J JVM options before it starts the
server, so sbt -J-Xmx2G starts the server with the runner's default
1 GB heap. sbt.bat does not handle -J on the command line: it passes
the option to sbt as a command, which exits with "Not a valid
command". Its default memory check also misses heap options given on
the command line or as -XX:MaxRAM and RAM percentages, so the
appended -Xmx1024m overrides them.

**Solution**
sbtn passes -J options to the server script, and strips -J when it
starts the launcher JAR through java. A -J split out of a quoted
command stays in that command, and a bare -J is dropped. sbt.bat
strips -J, adds the option to the JVM options, rejoins -J-D and -J-XX
values that cmd.exe splits at '=', and passes -J options on to sbtn.
Its default memory check ignores quotes and checks the same options
as the Unix runner.

Generated-by: OpenAI Codex
Generated-by: Claude Code

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-28 16:51:34 -04:00
eugene yokota 80c381c732 [2.x] docs: Update release notes (#9841) 2026-09-28 15:17:52 -04:00
eugene yokota 0a70458a4b [2.x] deps: Zinc 2.1.0-M5 (#9837) v2.1.0-M3 2026-09-28 04:15:44 -04:00
eugene yokota 1de781405c Merge pull request #9836 from eed3si9n/wip/community-build
[2.x] test: Add chimney to community-build
2026-09-28 03:31:51 -04:00
Eugene Yokota 31cdedeae7 [2.x] test: Compare sbt 1.x vs 2.x vs remote cache 2026-09-28 03:09:52 -04:00
Eugene Yokota 4becc23595 [2.x] test: Run test twice 2026-09-27 22:35:55 -04:00
Eugene Yokota 16111c6b79 [2.x] test: Use remote cache 2026-09-27 21:54:59 -04:00
Eugene Yokota 1162cbed47 [2.x] test: Move community-build to server-test.yml 2026-09-27 20:31:45 -04:00
Eugene Yokota fe070fa263 [2.x] test: Add bazel-remote to the container 2026-09-27 20:31:45 -04:00
Eugene Yokota 15161fec1b [2.x] test: Add chimney to community-build 2026-09-27 19:12:11 -04:00
eugene yokota c03a75308d [2.x] fix: Retry mkInput (#9835)
**Problem**
mkInput may fail for file locking reasons outside of the task engine
management.

**Solution**
This adds a simple retry. Note that we do not try to fall back
to organic task execution when mkInput fails.
2026-09-27 18:22:01 -04:00
kenji yoshida c967d4ed40 Fix warning in test (#9832) 2026-09-27 13:55:12 -04:00
kenji yoshida 792bf0b73c Use sbt 2.1.0-M2 (#9833) 2026-09-27 13:54:29 -04:00
eugene yokota 8a2ec14cc8 [2.x] Short-circuit x := expr.value (#9831)
**Problem**
Identity map of a task (x := expr.value) goes through the task macro
machinery requiring JsonFormat etc for cached task.
This is not necessary for dynamic task etc.

**Solution**
This implements a short-circuit for x := expr.value shaped tree.
2026-09-26 18:30:17 -04:00
eugene yokota 637c5d2a05 [2.x] remoteCacheRequestTimeout setting (#9829)
Problem/Solution
This adds remoteCacheRequestTimeout setting so timeout can be controlled.
2026-09-26 14:23:06 -04:00
eugene yokota 2aef51422a [2.x] fix: Fixes .m2/settings.xml overriding sbtResolvers (#9828)
**Problem**
Since Coursier 2.1.25 .m2/settings.xml takes over even when sbtResolvers exists.

**Solution**
Turn off .m2/settings.xml unless explicitly enabled.
2026-09-25 23:38:55 -04:00
Anatolii Kmetiuk 16421fc75c [2.x] fix: Isolate cached test results by execution scope (#9823)
Include project identity, portable project path, configuration and platform in test digests so sibling projects cannot reuse each other’s successful test results. Add regression coverage for isolation and cache reuse.
2026-09-25 21:50:45 -04:00
Anatolii Kmetiuk 79c7d9d728 [2.x] fix: Honor JAVA_HOME in the Unix launcher (#9825)
Problem: The Unix launcher ignores JAVA_HOME and selects Java from PATH when JAVACMD is absent.

Solution: Check JAVA_HOME/bin/java before falling back to PATH while preserving explicit --java-home and JAVACMD precedence.

Fixes #9794
2026-09-25 14:30:25 -04:00
Anatolii Kmetiuk a015c666df [2.x] fix: Read scripted pause from standard input (#9824)
Problem
The scripted pause handler assumes the JVM has a directly attached terminal. System.console() can return null when sbt runs in client-server mode or with redirected streams, causing pause to fail.

Solution
Use scala.io.StdIn.readLine() to read the configured input stream, which supports sbt client input forwarding. Add unit tests for waiting, line consumption, and EOF.
2026-09-25 11:55:59 -04:00
eugene yokota c8a0007d6e [2.x] feat: Persistent worker for test (#9678) 2026-09-25 03:30:09 -04:00
eugene yokota f9ca5f5ee6 [2.x] fix: Fixes inMemoryAnalysisCache limit (#9500)
**Problem**
The in-memory Analysis cache is currently weighted by on-disk size,
but according to the user report it expands out 50x, so 100MB
size limit doesn't hit.

**Solution**
This set maxCount instead, default 20 and configurable by system property
sbt.local_cache.analysis_count.
2026-09-24 18:38:55 -04:00
eugene yokota 754d0d5e37 [2.x] fix: Remove duplicate self JAR from Runtime (#9820)
**Problem**
Since #9471, Runtime/fullClasspath combines exportedProducts
(unversioned) with the Runtime internal dependency classpath
(packageBin, versioned), so the project's own JAR appears twice.

**Solution**
In Runtime, build fullClasspath and fullClasspathAsJar from
the versioned exported products.
2026-09-24 18:38:14 -04:00
eugene yokota 2f667aee96 [2.x] Include other repos into devcontainer (#9819) 2026-09-24 17:03:16 -04:00
eugene yokota dd7b23b0d2 [2.x] Update user-agent to major.minor (#9818)
To avoid user-agent being used for tracking, use only major.minor.
2026-09-24 16:57:45 -04:00
Albert Meltzer c7e8ce5f55 [2.x] refactor: VirtualAxis: refactor constructing ScalaVersionAxis (#9789) 2026-09-22 18:52:45 -04:00
Albert MeltzerandClaude Fable 5.1 b9c722a95f [2.x] refactor: ProjectMatrix: re-use xxxPlatform methods (#9788)
* [2.x] ProjectMatrix: re-use xxxPlatform methods
* [2.x] ProjectMatrix: pass configure directly

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
2026-09-22 18:30:27 -04:00
Jozef Koval 27f1792e91 [2.x] fix: publishLocal must overwrite, remote publish must not (#9814)
Fixes #9813.

With overwrite = false, the default for non-snapshot versions, the ivyless
publisher kept an existing file and reported success, leaving stale bytes and
checksums. The HTTP paths took overwrite and never read it. sbt 1.x did the
opposite in both cases: file repositories warned and overwrote (22f47be29),
remote ones refused.

Restore that. File targets now warn and write through a temp file; HTTP targets
refuse after a HEAD probe that fails open. Also route a file: URLRepository,
Ivy or Maven layout, to the filesystem instead of httpPut.
2026-09-22 17:02:43 -04:00
PhoenixmitX 31f571314a [2.x] fix: restore the pipelining early output on an action-cache hit (#9793)
Problem
compileIncremental declares the analysis file and the classes directory
as cache outputs, but not the early (pickle) jar or the early analysis.
A cache hit therefore leaves a subproject with a restored analysis and
no early jar. On the next incremental round Zinc has no jar to merge
scalac's pickles into, so the early jar ends up holding only that
round's TASTy/sig files, afterEarlyOutput(true) fires, and every
downstream subproject is compiled against it and fails with "Not found"
for each upstream type that was not just recompiled.

Solution
- Declare the early jar and the early analysis file as outputs of
  compileIncremental when exportPipelining produced them, so a hit
  restores them.
- Restored outputs are symlinks into the CAS, and Zinc rewrites the
  early jar in place when it merges a round's pickles. Replace a
  symlinked early jar by a real copy before Zinc runs so the cached
  blob is never modified.
- When a previous analysis exists but the early jar does not (a cache
  written before the jar was an output, exportPipelining switched on
  for an existing build, a deleted early directory), recompile the
  subproject from scratch, which writes a complete jar.
2026-09-22 14:49:30 -04:00
Matthias Kurz 0c6ffced79 [2.x] fix: Derive Maven paths from module and artifact names (#9811)
**Problem**

The non-Ivy Maven publisher derived the repository directory and every
filename from the first POM artifact. Custom-named artifacts could collide
with and replace the main JAR, while legacy sbt 1 plugin publishing depended
on artifact map order and collapsed crossed and uncrossed files.

**Solution**

Derive the directory from module coordinates and each filename from the
platform-aware cross-versioned artifact name. Reject target-path collisions
before publishing, de-duplicate remote snapshot metadata, and cover ordinary,
platform, snapshot, and legacy plugin layouts with unit, property, and
scripted tests.

Generated-by: OpenAI Codex
2026-09-22 14:07:40 -04:00
Albert Meltzer 3cd72defa0 [2.x] refactor: CrossVersionExtra: extra cross-version parser (#9790) 2026-09-22 14:06:43 -04:00