Commit Graph

17929 Commits

Author SHA1 Message Date
eugene yokota e16d4b2441
[2.0.x] fix: Add warning about trainsient key (#9289)
**Problem**
Transient key is silently excluded from caching.

**Solution**
Add a warning.
2026-06-01 07:20:04 -04:00
eugene yokota f934219029
Merge pull request #9286 from eed3si9n/bport/bump-zinc
[2.0.x] Zinc 2.0.0-M19 + Opt bspBuildTargetOutputPathsItem out of caching
2026-06-01 05:55:28 -04:00
Eugene Yokota 6df13e3ede Zinc 2.0.0-M19 2026-06-01 05:04:32 -04:00
Anatolii Kmetiuk aed2c6125b [2.x] Opt bspBuildTargetOutputPathsItem out of caching (#9272)
Opt bspBuildTargetOutputPathsItem out of caching
2026-06-01 04:14:18 -04:00
eugene yokota 2ba33f3ff4
Merge pull request #9284 from eed3si9n/bport2/bump-sjsonnew
[2.0.x] bport: sjson-new 0.15.0
2026-06-01 03:13:50 -04:00
eugene yokota 09aca71007
[2.0.x] perf: Improve incremental test stamper (#9257) (#9283)
**Problem**
Incremental stamper is still causing perf issue.

**Solution**
This further avoids SHA-256 calls to calculate the stamp.
2026-06-01 02:58:25 -04:00
Eugene Yokota 8ea6042bab sbt 1.12.11 2026-06-01 02:42:50 -04:00
Eugene Yokota bbd3ef1f47 [2.0.x] sjson-new 0.15.0 2026-06-01 02:23:45 -04:00
Eugene Yokota 82bb44d543 [2.0.x] Contraband 0.9.0 2026-06-01 02:23:15 -04:00
eugene yokota fc4273d0d1
[2.0.x] fix: Fixes backtick-quoted project handling (#9277) (#9281)
Co-authored-by: kenji yoshida <6b656e6a69@gmail.com>
2026-06-01 00:56:32 -04:00
eugene yokota 275f97b7c6
Merge pull request #9276 from eed3si9n/bport/xx
[2.0.x] bport: Migrate FarmHash usage to xxhash64 (#9267)
2026-05-31 18:19:43 -04:00
Eugene Yokota 4637cdf33b Comment out part of ChannelCursorTest 2026-05-31 17:55:05 -04:00
Eugene Yokota f1c914f4ae [2.x] Reimplement FarmHash
**Problem**
sbtn and server uses FarmHash.

**Solution**
This reimplements FarmHash using Scala.
2026-05-31 16:57:12 -04:00
Eugene Yokota 82e5b28c9c Refactor VarHandle to Access typeclass 2026-05-31 16:41:54 -04:00
eugene yokota 27f09caba5 [2.0.x] Migrate FarmHash usage to xxhash64 (#9267)
Problem
ZAHa, which we use for FarmHash, uses Unsafe.

Solution
This ports xxhash64 to Scala.
2026-05-31 16:41:09 -04:00
eugene yokota ae1192109d
[2.0.x] ci: Scalafmt 3.11.1 (#9280)
Apply Scalafmt
2026-05-31 16:30:32 -04:00
eugene yokota f78a141dd5
[2.0.x] fix: Report a missing input file clearly instead of an opaque SerializationException (#9275)
When a file referenced by a task's inputs/outputs (e.g. `Compile / resources +=
file("nope.txt")`) does not exist, hashing the task's cache key threw a
NoSuchFileException deep inside sjsonnew serialization. It surfaced as an opaque
sjsonnew.SerializationException that dumped the entire input list, with the real
cause buried several `Caused by:` levels down, so users routinely mistook it for
a corrupt cache and reached for `clean`.

ActionCache.mkInput now catches the hashing failure, detects a NoSuchFileException
anywhere in the cause chain (ActionCache.findMissingFile), and throws a
MessageOnlyException naming the file:

    [error] file referenced by the build does not exist: nope.txt

util-cache gains a dependency on util-control (a leaf module, no cycle) for
MessageOnlyException.

Fixes #9217.

Co-authored-by: Brian Hotopp <brihoto@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 21:13:42 -04:00
eugene yokota a893b1c86d
[2.0.x] fix: Parallelize dependency resolution when no progress bar is rendered (#9274)
`update` held a process-global lock around coursier resolution and artifact
fetching whenever a logger was set OR coursier was not in fallback mode. That
lock exists only to serialize coursier's interactive progress bar, which is
rendered solely when no custom logger is supplied and coursier is not in
fallback mode. The `loggerOpt.nonEmpty` clause therefore over-serialized the
common non-interactive case (IntelliJ re-imports, CI, any non-TTY run, where
sbt supplies a quiet debug-only logger), making `update` scale with the number
of modules rather than the number of distinct artifacts.

Narrow the predicate to `!hasCustomLogger && !fallbackMode`
(Lock.progressBarActive), so resolution runs in parallel unless coursier is
actually drawing its progress bar. Interactive terminals stay serialized;
COURSIER_PROGRESS=false opts into parallelism there, and #5627 tracks fully
parallel resolution with live progress bars.

Safe: SbtCoursierCache is ConcurrentHashMap-backed, a CacheLogger is already
invoked concurrently within a single resolution (parallel downloads), and the
COURSIER_PROGRESS=false parallel path has been used in production for years.

Fixes #5508.

Co-authored-by: Brian Hotopp <brihoto@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 21:12:10 -04:00
eugene yokota e6666e4b10
[2.0.x] Fix duplicate autoplugins packageBin mappings (#9255) (#9273)
Deduplicate executable jar package entries. In the issue, the duplicate was something like:

(resource_managed/.../sbt/sbt.autoplugins, "sbt/sbt.autoplugins")
(classes/.../sbt/sbt.autoplugins,          "sbt/sbt.autoplugins")

This is because copyResources copied autoplugin metadata to the classes directory.

Solution: when composing the packageBinMappings, differentiate between artifacts that come from class directory and from outside of it. If there is a duplicate, prefer resource that comes from outside of it.

Co-authored-by: Anatolii Kmetiuk <anatoliykmetyuk@gmail.com>
2026-05-30 20:16:58 -04:00
eugene yokota 8ff4a8ecba
[2.0.x] fix: Make custom-scala-org scripted test hermetic (#9260) (#9263)
The original fixture pinned
  scalaOrganization := "io.github.scala-wasm"
  scalaVersion := "3.8.3-RC1-wasm-bin-SNAPSHOT"
and ran compile. The wasm fork never published a release of
scala3-library_3 -- only a snapshot to Sonatype's central-snapshots
repo, which has ~90-day retention. #8732 merged 2026-02-21; the
snapshot was GC'd ~2026-05-22 and develop CI began failing
deterministically.

Fixes #9259.

Co-authored-by: BrianHotopp <brihoto@gmail.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 03:56:27 -04:00
eugene yokota e547e15feb
Merge pull request #9251 from anatoliykmetyuk/bport/platform-artifact-name
[2.0.x] bport: Include platform suffix in Artifact.artifactName
2026-05-19 22:06:04 -04:00
Anatolii Kmetiuk 46e10f0b33 [2.x] fix: Add regression test (#9246) 2026-05-20 09:53:53 +09:00
Anatolii Kmetiuk afac251f28 [2.x] fix: Include platform suffix in Artifact.artifactName (#9118) 2026-05-20 09:53:50 +09:00
Eugene Yokota ef36bdaa15 sbt 2.0.0-RC13 2026-05-17 15:29:38 -04:00
eugene yokota 3ebed6e5e1
[2.0.x] Update sbtn to 2.0.0-RC14 for timeout fix (#9241) 2026-05-17 14:13:22 -04:00
eugene yokota 37ccb83b71
Merge pull request #9238 from eed3si9n/bport/exec_log
[2.0.x] bport: Backport execution log and cache version
2026-05-17 04:08:30 -04:00
eugene yokota deb8f6d767 [2.x] Add runner support for execution log (#9237)
**Problem/Solution**
This adds runner commandline option experimental_execution_log.
2026-05-17 03:39:16 -04:00
Dream 95702f43cf [2.0.x] feat: Support --autostart=false and --no-server in sbtn client (#8895)
**Problem**
When sbtn (native thin client) can't find a running sbt server, it prompts
to start one. There was no way to opt out of server auto-start from the
client side, which is needed for CI environments and scripting (sbt/sbt#7079).

**Solution**
Reuse the existing sbt.server.autostart system property in NetworkClient
to control whether sbtn should attempt to start a server. When no server is
running and sbt.server.autostart=false, sbtn exits with an error instead
of prompting.

Support setting this property via:
- sbtn --no-server compile (sets sbt.server.autostart=false)
- sbtn --autostart=false compile (new flag following sbt conventions)
- sbtn -Dsbt.server.autostart=false compile (direct system property)
- sbt --autostart=false compile (bash runner and sbtw)

This follows sbt's naming conventions for properties/options: positive
property names with =false opt-out (like --color=false, --supershell=false).

Fixes sbt/sbt#7079

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-17 03:38:08 -04:00
eugene yokota fc15e03c33 [2.0.x] feat: Execution log (#9203)
**Problem**
We need some tooling to debug caching issues.

**Solution**
This adds an exeprimental execution log support,
which shows input and output of cached tasks.
2026-05-17 03:34:20 -04:00
bitloi 217e0091f9 [2.x] fix: sbt -debug doesn't display loading log (#8819)
* Fix #4979: apply -debug (and other level options) at startup so loading shows debug log

- Parse log level from configuration.arguments in StandardMain.initialState
- Pass initialLevel to GlobalLogging.initial so console appender uses it from first log
- Set Keys.logLevel and BasicKeys.explicitGlobalLogLevels in initial state when level option present
- Add initialLevel parameter to GlobalLogging.initial (default Level.Info) for backward compatibility
- Add InitialLogLevelSpec tests for logLevelFromArguments
- Add docs/fix-4979-manual-verification.md for manual reproduction
2026-05-17 03:29:25 -04:00
Dream ecfbbba389 [2.x] feat: Add cacheVersion setting for global cache invalidation (#8993)
* [2.x] feat: Add cacheVersion setting for global cache invalidation

**Problem**
There was no escape hatch to invalidate all task caches when needed.

**Solution**
Add `Global / cacheVersion` setting that incorporates into the cache key
hash. Changing it invalidates all caches. Defaults to reading system
property `sbt.cacheversion`, or else 0L. When 0L, the hash is identical
to the previous behavior (backward compatible).

Fixes #8992

* [2.x] refactor: Simplify BuildWideCacheConfiguration and add cacheVersion test

- Replace auxiliary constructors with default parameter values
- Add unit test verifying cacheVersion invalidates the cache

* [2.x] fix: Restore auxiliary constructors for binary compatibility

* [2.x] test: Improve cacheVersion scripted test and add release note

- Scripted test now verifies cache invalidation via a counter
  that increments only when the task body actually executes
- Add release note documenting the cacheVersion setting
2026-05-17 03:17:12 -04:00
eugene yokota 26c7cd825e
Merge pull request #9235 from eed3si9n/bport2/bump-scala
[2.0.x] Scala 3.8.3
2026-05-17 01:13:21 -04:00
eugene yokota 8c5c1e6b6d
[2.0.x] fix: Ensure resources are copied atomically (#9234)
Bumps io to released 1.12.0 which contains the atomic-write changes
to IO.copyFile, IO.transfer(InputStream, File), and IO.jar/zip.
ActionCacheStore.putBlob now uses IO.transfer instead of duplicating
staging logic.

Co-authored-by: Anatolii Kmetiuk <anatoliykmetyuk@gmail.com>
2026-05-17 00:54:58 -04:00
Eugene Yokota c92ac232c0 Additional parens 2026-05-17 00:51:41 -04:00
kenji yoshida 3c64021190 [2.0.x] Scala 3.8.3 (#8997) 2026-05-17 00:13:13 -04:00
eugene yokota 2369a5e1af
Merge pull request #9233 from eed3si9n/bport2/bump-coursier
[2.0.x] bport: Update to Coursier 2.1.25-M25
2026-05-16 05:49:49 -04:00
Eugene Yokota e2b63dbb78 Revert "[2.x] fix: Skip Conflict when dependency relocations form a cycle (#8919)"
This reverts commit b24ecddbd6.
2026-05-16 05:00:42 -04:00
Eugene Yokota 53c83b4515 [2.x] Update to lm-coursier 2.1.25-M25 2026-05-16 05:00:08 -04:00
eugene yokota a5bf75354b
[2.0.x] fix: Include test arg into hash (#9231)
**Problem**
test -- foo passes on MUnit, allowing failing tests to be validated.

**Solution**
Include test args into the cache input.
2026-05-16 04:55:35 -04:00
eugene yokota 6c6d2542e5
[2.0.x] Zinc 2.0.0-M18 (#9220) 2026-05-15 00:37:57 -04:00
eugene yokota a8175c631c
[2.0.x] fix: Invalidate on JDK version (#9218)
**Problem**
sbt 2.x caching doesn't invalidate on JDK version.

**Solution**
Invalidate on JDK version.
2026-05-14 22:40:00 -04:00
eugene yokota 0051ab91f3
Merge pull request #9215 from eed3si9n/bport2/bump-zinc
[2.0.x] bport: Cache analysis using file last modified
2026-05-13 23:04:55 -07:00
Eugene Yokota b1eb5600d1 Remove tests that checks for the iteration 2026-05-14 01:36:03 -04:00
Eugene Yokota 0712811dff [2.0.x] Cache analysis using file last modified
**Problem**
Current MixedAnalyzingCompiler analysis cache caches using the last write,
assuming all writing happens via it. However, this doesn't work with
sbt 2.x caching system where the gz file under it can switch.

**Solution**
This switches to using caffeine caching, which includes file size
and file timestamp for local analysis caching.
2026-05-14 01:35:39 -04:00
eugene yokota 5ebc20ac32
Merge pull request #9209 from eed3si9n/bport2/scala-integration
[2.0.x] bport: Port tests to use lm-coursier
2026-05-11 23:28:06 -07:00
Eugene Yokota cb010d6da3 Backport ScalaTest bump 2026-05-11 21:13:02 -07:00
eugene yokota e017c49165 [2.0.x] test: Port tests to use lm-coursier (#9205)
**Problem**
Some tests are failing.

**Solution**

* Port EvictionErrorSpec to lm-coursier
* Port EvictionWarningSpec to lm-coursier
* Port InclExclSpec to lm-coursier
* Port ZincComponentCompilerSpec to lm-coursier
* Apparently we still need lmIvy
2026-05-11 21:13:02 -07:00
eugene yokota fa33157249
[2.0.x] Improve --help (#9183)
**Problem**
Some runner options are not documented in --help.

**Solution**
Fix it.
2026-05-03 22:35:15 -04:00
eugene yokota e059d999e6
[2.0.x] deps: Gigahorse 0.9.4 (#9182) 2026-05-03 22:02:32 -04:00
eugene yokota ce34b6231d
Merge pull request #9181 from eed3si9n/bport/console-plugin-virtualpath
[2.0.x] bport: Use rootPaths to replace virtual paths in console and doc
2026-05-03 22:01:53 -04:00