Commit Graph
18272 Commits
Author SHA1 Message Date
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> fe6bed7d47 build(deps): bump actions/setup-java from 5 to 6 (#9695)
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 5 to 6.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-31 10:36:48 -05:00
kenji yoshida d6f705fca1 [1.x] ci: Update dependabot.yml target-branch (#9697) 2026-08-31 10:36:06 -05:00
Albert MeltzerandClaude Opus 5 952b82e461 [2.x] fix: Share a holder for a closeable (#9692)
**Problem**
Four fields hold a closeable that a later caller replaces. Each one
reads the field, closes what it finds and writes the new value in its
own way.

**Solution**
AtomicCloseable holds such a value. It closes the value it replaces,
and closes the value that loses a race to fill an empty field.

Two things change for a caller. The client replaced its session
without closing the one it dropped, and now closes it. A close that
throws no longer escapes: each of these sites is discarding the value
it closes, and whatever led there matters more than the close.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-08-29 23:42:06 -05:00
Viktor Rudebeck 8c12215925 [2.x] Remove global.base setting in windows runner script (#9688)
This is essentially applying the same fix as in #8795 but for the Windows sbt.bat script. 
We now only set -Dsbt.global.base when explicitly asked for with the --sbt-dir option.
2026-08-29 00:19:11 -05:00
kenji yoshida 1c31b6ede0 [2.x] Update CLA url (#9686) 2026-08-27 21:26:17 -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
kenji yoshida 9595cd4204 [2.x] test: Fix MatchError in RunFromSourceMain if RC version (#9684) 2026-08-26 18:35:12 -04:00
Stas Shevchenko a1c67621ef [2.x] fix: keep worker classloader open for shutdown hooks (#9639) 2026-08-26 14:28:59 -04:00
eugene yokota 3d95e91b5f [2.x] fix: Fixes Windows runner (#9680)
**Problem**
1. On Windows, sbt.bat re-parses its own already-received arguments a second time internally, via call/goto with an unquoted variable splice (call :run !SBT_ARGS!, and similarly for -D/-XX flags, several _SBT_OPTS-sourced flags, and the native-client dispatch path). That extra re-tokenization could let &, |, (, or ) inside an argument escape their quoting and run as separate shell commands.
2. The -D/-XX/-- argument handling spliced the raw argument value into a for /F ... in ("%g%") do ( ... ) construct nested up to four levels deep inside multi-line if blocks. Apparently, that confuses cmd to miscount the parentheses.

**Solution**
1. Call :run without the argument.
2. Avoid for /F
2026-08-26 13:53:25 -04:00
Mai Huy HoàngandClaude Opus 5 53ffd7fc02 [2.x] perf: Copy instead of symlink when restoring the disk cache on APFS (#9623)
A cache-restored tree is a farm of symlinks into the shared CAS. Writing it is
cheap, but walking it is not: resolving each link reads an inode out of a
directory far too large to stay in the OS metadata cache. Measured against a
57 GB / 952k-blob CAS, a cold stat of a CAS blob costs 165 us against 3.6 us for
a regular file, which makes a cold classpath walk of a restored tree roughly 38x
slower than one of real files. On an 81-module build with exportJars, a no-op
compile drops from 14.75s to 5.96s once the tree is real files.

DiskActionCacheStore now seeds the existing symlinkSupported latch from the
filesystem holding the CAS, and materializes entries with copyFile on APFS.
Files.copy reaches clonefile(2) there, so each entry gets its own inode and walks
at full speed while its data blocks stay shared with the CAS: the restored tree
measured 11 MB against 137 MB for the symlinked one. Copies also cannot corrupt
a blob when a task overwrites its output, which a symlink into the CAS can.
On every other filesystem the behavior is unchanged.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-08-26 00:06:46 -04:00
Anatolii Kmetiukandeugene yokota 0da3f6b478 [2.x] Add test result cache opt-out (#9675)
* [2.x] Add test result cache opt-out

* Update main/src/main/scala/sbt/internal/SysProp.scala

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

* Use Boolean values for test cache opt-out

---------

Co-authored-by: eugene yokota <[email protected]>
2026-08-26 11:27:05 +09:00
kenji yoshida 34b9a52f18 [2.x] Fix sbt-native-packager compatibility (#9677) 2026-08-25 11:28:19 -04:00
Mai Huy HoàngandClaude Opus 5 e98ead410c [2.x] perf: write packageBin jars and action cache zips in parallel (#9661)
sbt writes two archives per module per build: the packageBin /
packageInternal jar, and the zip the disk action cache stores an output
directory as. Both deflate one entry at a time on the calling thread.

io 1.13.0 adds IO.jarParallel / IO.zipParallel, which deflate entries
concurrently and produce byte-identical archives. Switch both call sites
over, taking the executor from IO.Implicits.zipContext -- io keeps it
behind that object so the choice is explicit rather than an ambient
ExecutionContext.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-08-25 10:56:08 -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 108623f848 [2.x] fix: Fixes ThisBuild-scoped bare settings (#9674)
**Problem**
ThisBuild scoped baresettings are treated as a common setting,
which results in duplicate appends etc.

**Solution**
Only treat This-project and ThisProject scoped setting as a common setting.
2026-08-24 21:32:34 -04:00
9eb615556f [2.x] fix: Notify listeners before LinkageError escapes suites (#9667) (#9672)
TestRunner now calls endGroup(name, error) before rethrowing an otherwise escaping LinkageError. This completes the TestReportListener lifecycle while preserving the original error propagation and non-zero task result.

Previously, the outer suite catch handled only NonFatal errors. A suite failing with ExceptionInInitializerError could therefore start a listener group and terminate without a terminal callback, forcing integrations to infer failure from rendered output. The direct TestRunner regression checks the error callback, absence of a normal result callback, and rethrow of the same error.

Co-authored-by: Dmitrii Naumenko <[email protected]>
Co-authored-by: Codex <[email protected]>
2026-08-24 16:36:35 -04:00
azdrojowa123andClaude Opus 5 a25e9fe59a [2.x] fix: Fixes --addPluginSbtFile getting lost after reboot (#9669)
reboot restarts sbt with a fresh state, so the extra plugin sbt files registered in BasicKeys.extraMetaSbtFiles were dropped and their plugins disappeared. Prepend an early(addPluginSbtFile=<path>) command for each registered file to the arguments handed to the restarted sbt, so they are re-registered.

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-08-24 15:38:34 -04:00
Dmitrii NaumenkoandCodex b1ea80d066 [2.x] fix: Restore public test result report types (#9655)
**Problem**
Commit c8737b8e4f, "refactor: Change the test type" (PR #8181, Eugene Yokota), made Tests.Output and SuiteResult private[sbt] while changing test tasks to return TestResult. The stated rationale was to type test tasks; it did not describe restricting TestResultLogger customization.

TestResultLogger remains a public, documented extension point, but its run method accepts Tests.Output. External plugins consequently cannot implement it in source. This was noticed while working on TW-102637.

**Solution**
Restore public visibility for Tests.Output, SuiteResult, and its companion. Add a scripted external-build regression test that implements TestResultLogger, uses Output.events as Iterable[SuiteResult], runs test, and observes the logger.

---------

Co-authored-by: Codex <[email protected]>
2026-08-24 12:26:08 -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
Stas Shevchenko 46eca942a1 [2.x] fix: hash action cache inputs with full-width sha256 (#9641)
mkInput folded only a 32-bit murmur hash of the task input into the cache key, so distinct inputs collide at the birthday bound (~31 per 500k realistic inputs), silently resolving a task to the wrong cached output. A new DigestHasher hashes inputs into a full-width sha256 Merkle digest. Changes all cache keys, so the cache is repopulated once. Adds a regression test.
2026-08-21 17:33:22 -04:00
Mai Huy Hoàng 94acc76830 [2.x] fix: Populate the in-memory cache on a read (#9657)
**Problem**
InMemoryCacheStore.CacheStoreImpl.read returns cacheStore.read[T]() on a miss
without putting the value in the cache, so the only thing that ever fills the
cache is write. A task whose stored output is already up to date never writes,
so it re-reads and re-deserialises that output on every invocation for the life of
the server, and the cache can never warm up for it.

update is the costly instance: transitiveUpdate runs it once per project in
the dependency closure, and every call goes through
UpdateReportPersistence.readFrom.

**Solution**
Put the value in the cache after a successful disk read. The keying is unchanged
-- an entry is still (path, lastModified), read re-stats the file on every
call, and write still invalidates before rewriting -- so a populated read is
sound for the same reason a populated write is.

Measured on an 81-module workspace, no-op build, real output files (no
cache-restored symlinks), exportJars=true, alternating the two builds over 8
runs each:

    update task    398ms across 82 projects -> 30ms across 29
    task total     4797ms -> 4623ms
    wall (median)  5.15s -> 4.97s

This makes maximumWeight bind where it could not before: reads now admit
entries, so a build whose working set exceeds sbt.file.cache.size will evict
rather than never cache at all. That is the intended behaviour of a bounded cache.

Generated-by: Claude Opus 5
2026-08-21 14:24:05 -04:00
Jozef Koval ec99275000 [2.x] fix: Resolve Seq[Initialize[Task[T]]].join to Initialize[Task[Seq[T]]] (#9347)
Fixes #899

Add the task join as an extension method on Seq[Def.Initialize[Task[A]]] in
Def. Member resolution tries extension methods before implicit
conversions, so it is selected ahead of the generic conversion regardless of
whether sbt.Scoped is in scope.
2026-08-21 13:40:28 -04:00
Stas Shevchenko 08cc82ac85 [2.x] perf: avoid re-sorting watch inputs on every file event (#9650)
Watch mode copied and sorted the whole dynamic-input set on every file event, once per config (Continuous.inputs()). The sort is irrelevant to the glob match, so match against the set directly. Biggest relative gain on macOS, where FSEvents coalescing turns a git checkout into a burst of thousands of events.
2026-08-21 01:39:41 -04:00
eugene yokota 4700d305cc Merge commit from fork
fix: disable BSP over TCP and gate requests before auth
2026-08-20 23:13:00 -04:00
Christian Harrington 82705f1cd5 [2.x] fix: Fixes filesystem traversal order affecting cache stability (#9646)
**Problem**
CompileInputs2.sources and packageBin / mappings are hashed positionally but arrive in
filesystem traversal order, which differs between APFS, ext4 and overlayfs. Two machines
hash an identical tree into different cache keys and cannot use each other's entries.

**Solution**
Sort sourcesVF by virtualized id, and mappings where packageConfigurationTask reads
it. Both are where the keys are built, so nothing appended later escapes the sort.

Generated-by: Claude Opus 5
2026-08-20 15:52:50 -04:00
Stas Shevchenko 38b73189ef [2.x] fix: Verify remote cache blobs against their digest (#9643)
Blobs pulled from a gRPC remote cache were written to the CAS and synced into the build without re-hashing, so a compromised cache server or plaintext MITM could substitute bytes under the requested digest. Re-hash remote blobs on write and reject on mismatch, and warn when a plaintext grpc:// endpoint is configured.
2026-08-20 12:17:24 -04:00
stasimus 56f38a19a4 fix: disable BSP over TCP and gate requests before auth 2026-08-20 10:45:19 +02:00
Stas Shevchenko 1fbdde292f [2.x] test: Cover action cache traversal and content guards (#9640) 2026-08-19 17:29:51 -04:00
Anatolii Kmetiuk 893e22102b [2.x] fix: Fixes -V parsing in sbt runners (#9626)
Problem: -V is consumed by the launcher instead of sbt in sbt tasks -V.

Solution: in the parser's -V behavior, lookback to see if there are commands going before it, in which case, forward -V to sbt.
2026-08-19 13:25:00 -04:00
cdf6b25106 [2.x] fix: Avoid rewriting unchanged plugin descriptors (#9612) (#9624) (#9628)
Only rewrite generated plugin descriptors when their normalized lines change, preserving the descriptor timestamp and downstream cache inputs for unchanged plugin discovery.

Add unit coverage plus direct packageBin and assembly Scripted scenarios. The descriptor regressions fail with the former unconditional write and pass with this change; the packageBin fixture also preserves SBT 2’s existing cache-hit behavior.

Co-authored-by: Dmitrii Naumenko <[email protected]>
Co-authored-by: Codex <[email protected]>
2026-08-19 13:05:17 -04:00
eugene yokota 7115e7c36b [2.x] Update sbtn to 2.0.0-8753a981 (#9630) 2026-08-19 12:53:20 -04:00
azdrojowa123andClaude Opus 4.8 3045cd0c46 [2.x] Add a resolvedScalacOptions task that resolves cache placeholders (#9610)
Add a resolvedScalacOptions task that resolves cache placeholders in scalacOptions to absolute machine paths.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-08-19 05:36:38 -04:00
eugene yokota 8753a98161 [2.x] fix: sbtn to retry on corrupt active.json (#9617)
**Problem**
sbtn gets stuck when active.json is corrupt.

**Solution**
Delete active.json, and retry.
2026-08-19 02:26:44 -04:00
eugene yokota 6b3d7c6301 [2.x] fix: Fixes cache invalidation on version change (#9471)
**Problem**
packageBin includes version into the file name, which ends up
invalidating the cache.

**Solution**
Define packageInternal, which does not include version in the file name, and used during Compile or Test/compile. Note that publishing and Runtime classpath would continue to use packageBin.
2026-08-19 00:13:59 -04:00
Mai Huy HoàngandClaude Opus 5 a1114188b4 [2.x] perf: Stop re-converting the classpath in compileOptions (#9622)
Both compileOptions sites mapped the whole classpath through
converter.toPath -> converter.toVirtualFile. Going through toPath
defeats FileConverter.toVirtualFile(VirtualFileRef), which already
returns the ref unchanged when it is a VirtualFile, so every entry was
rebuilt from scratch. For a class directory that means walking the
entire output tree, once per dependent.

backendOutput is converted explicitly because it is a settingKey
evaluated once at project load, so reusing it would pin the listing
taken before anything compiled.

Co-authored-by: Claude Opus 5 <[email protected]>
2026-08-18 11:40:54 -04:00
Albert Meltzer 8c76375eab [2.x] fix: Name the platform in CrossVersion(module, scalaModuleInfo) (#9620)
**Problem**
CrossVersion(module, scalaModuleInfo) is handed everything needed to name an
artifact, including ScalaModuleInfo.platform, and the name it returns is what
a caller publishes or resolves under. Nothing covers what it does with the
platform.

**Solution**
Name the artifact in full: platform suffix before cross suffix, matching the
coordinate (sbt/sbt#9117), through addPlatformSuffix, which already knows that
jvm contributes no suffix.

Generated-by: Claude Opus 5
2026-08-18 02:04:57 -04:00
eugene yokota 27c3f035e5 [2.x] feat: Test summary (#9602)
**Problem/Solution**
This extends the idea started with TestRecap, and applies it to
both test success and failures.

1. Existing TestResultLogger trait is extended to handle the summary
   rendering.
2. TestSummary enum is added to control the verbosity via
   commandline option, system property, or a setting.
3. Script test captures the log.
2026-08-17 23:54:32 -04:00
Mai Huy HoàngandClaude Opus 5 f7f337033d [2.x] perf: Skip re-packaging the class directory when zinc recompiles nothing (#9609)
Reuse the sibling dirzip when zinc reports it wrote nothing. The output
is still declared, so the stored ActionResult stays complete and a later hit
restores the class directory exactly as before -- it is the same
HashedVirtualFileRef the packaging path would have produced, read off disk
rather than rebuilt.

Co-authored-by: Claude Opus 5 <[email protected]>
2026-08-17 21:55:57 -04:00
eugene yokota 0ae3c152bd [2.x] fix: Guard diskcache against path traversal (#9605)
**Problem**
There are several places in diskcache where resolve is called
without guards.

**Solution**
This adds guards to prevent path traversal.
2026-08-17 14:09:03 -04:00
BrianHotopp e8f40d68c3 [2.x] fix: sbtn to log connection errors
onClose now logs sbt server disconnected when the close wasn't initiated by the client.

Generated-by: Oh My Pi (kimi-code/k3)
2026-08-17 14:08:21 -04:00
eugene yokota c0ffc9dc60 [2.x] test: Add a regression test for incremental test (#9608)
**Problem/Solution**
This tests incremental test's stability post-version bump.
2026-08-17 00:07:28 -04:00
kenji yoshida 42f8b949f7 [2.x] ci: Update sbt and plugins (#9603) 2026-08-15 11:20:18 -04:00
kenji yoshida d560776a77 [2.x] refactor: Remove nowarn annotation in CoursierDependencyResolution (#9593) 2026-08-14 08:53:42 -04:00
eugene yokota a94ef44178 [2.x] fix: Forward build.sbt compilation errors to logger (#9599)
**Problem**
1. build.sbt was compiled with console reporter,
   so we couldn't capture the error.
2. Another problem was that reload deleted global log
   so we couldn't get to the previous load failure.

**Solution**
1. This forwards build.sbt compilation errors to the logger.
2. This retains the failed loading log.
3. Using the facility above, this adds negative test for loading.
2026-08-14 08:51:51 -04:00
kenji yoshida 1d6d6ea661 [2.x] refactor: Fix warning in ivyless-publish-http-plugin test (#9597) 2026-08-13 19:35:37 -04:00
kenji yoshida 98d17419d0 [2.x] test: Fix project-matrix test TODO (#9596) 2026-08-13 19:33:28 -04:00
eugene yokota c717609ab2 [2.x] doc: Start sbt 2.1.0 release note (#9595) 2026-08-13 17:00:17 -04:00
kenji yoshida c5eac14c14 [2.x] refactor: Remove unused code (#9589) 2026-08-13 14:50:30 -04:00