Commit Graph

17901 Commits

Author SHA1 Message Date
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
Matt Dziuban 02845c57f7 [2.x] fix: Use rootPaths to replace virtual paths in console and doc scalac options. (#9110)
Rather than using the FileConverter to replace virtual paths, this uses the rootPaths directly. It only replaces a virtual path in a scalac option if the given segment of the option begins with the root path key.
2026-05-03 21:29:55 -04:00
corevibe555 2b0ef70a26 [2.x] Fix: strip pipelining scalacOptions before launching the REPL (#8986)
**Problem**
When usePipelining := true in a multi-project build, sbt appends  
-Ypickle-java and -Ypickle-write <path>/early.jar to scalacOptions 
for fast parallel compilation. These flags were being leaked into the Scala  
REPL, causing failure on console

**Solution**
Strip pipelining flags before forwarding to the REPL  in Deafults.scala.
2026-05-03 21:21:52 -04:00
eugene yokota 7a5b5f67a2
[2.0.x] sjson-new 0.14.0 (#9177) (#9179) 2026-05-03 18:55:36 -04:00
eugene yokota 679032b9e7
[2.x] Add ForkOptions.connectionTimeout (#9178)
---------

Co-authored-by: kenji yoshida <6b656e6a69@gmail.com>
2026-05-03 16:50:26 -04:00
eugene yokota 700657451e
Merge pull request #9171 from eed3si9n/bport/raw
[2.0.x] bport: ClassLoaderStrategy.Raw + forked test classpath
2026-05-03 12:37:17 -04:00
eugene yokota 97299f1ff9 [2.x] fix: Adjust the forked test classpath (#9170)
**Problem**
We can't test WorkerMain using forked test.

**Solution**
Allow WorkerMain to be shadowed.
2026-05-03 02:40:50 -04:00
eugene yokota 532edd1716 [2.x] feat: ClassLoaderStrategy.Raw (#9161)
**Problem**
In sbt 2.x, forking still creates layered classloader in the worker process,
which doesn't work for some tests.

**Solution**
This provides an escape hatch to emulate the sbt 1.x semantics of
using the system classpath for testing.
2026-05-03 01:01:41 -04:00
eugene yokota 604d2ce129
[2.0.x] fix: Fix build.sbt file loading in subdirs (#9165) (#9168)
**Problem**
Projects defined in subdirectory build.sbt files are
not correctly resolved to the base directory relative to the file.

**Solution**
Call resolveBase.
2026-05-03 00:09:27 -04:00
eugene yokota 7088ad9884
Merge pull request #9169 from eed3si9n/bport/i9100
[2.0.x] bport: Run related fixes
2026-05-02 22:27:46 -04:00
Matt Dziuban 6e7565d28a [2.x] Fix console output not appearing with bgRun and run / fork := true (#9166)
Bug 1: bgRun forks with inheritIO() instead of LoggedOutput

bgRunTask / bgRunMainTask resolve their fork options via (run / forkOptions), which inherits run / connectInput := true. That has two downstream consequences:

1. ForkRun.configLogged (in run/src/main/scala/sbt/Run.scala) skips installing OutputStrategy.LoggedOutput(log) whenever config.connectInput == true.
2. Fork.apply (in run/src/main/scala/sbt/Fork.scala) sees connectInput && outputStrategy == StdoutOutput and takes the interactiveFork path, which calls jpb.inheritIO().

Bug 2: Background-job log relay drops messages after the spawning task ends

Even after Bug 1 is fixed, LoggedOutput routes the forked process's stdout into the background ManagedLogger, whose appenders include a shared RelayAppender. The relay calls CommandExchange.logMessage(event), which uses isChannelOwner(c) to pick the target channel.
2026-05-02 21:40:09 -04:00
bitloi a259262262 [2.x] feat: sbtn subscription level (#8796)
Closes #4399

- Add subscribeToAll to InitializeOption (protocol); default true for backward compatibility.
- CommandExchange: send broadcast notifyEvent/logMessage only to channels with subscribeToAll.
- TestServer: support subscribeToAll parameter for tests; AbstractServerTest: subscribeToAllForTest.
- ClientSubscriptionTest: assert default client receives build/logMessage when command runs.
- Scripted test server/client-subscription: run show name to exercise server client path.
2026-05-02 21:39:45 -04:00
Eugene Yokota 9bc47864fe [2.0.x] fix: Remove will-be-ignored warning 2026-05-02 21:30:28 -04:00
Renzo 9018c5a718 [2.x] feat: support passing JVM arguments via -- delimiter in run commands (#8868)
Summary
- Adds support for passing JVM arguments inline to `run`, `runMain`, `bgRun`, `bgRunMain`, and `fgRun`/`fgRunMain` using `--` as a delimiter
- Syntax: `run <jvmArgs> -- <appArgs>` (e.g., `run -Xmx2G -Dapp.mode=debug -- arg1 arg2`)
- Fully backward compatible — without `--`, all arguments are treated as app args as before
- When `fork` is `false`, a warning is logged that JVM arguments will be ignored
2026-05-02 21:29:42 -04:00
eugene yokota 06e53a0ae4
[2.0.x] fix: Fix error with "-language:postfixOps" (#9158)
Co-authored-by: kenji yoshida <6b656e6a69@gmail.com>
2026-04-30 01:13:13 -04:00
eugene yokota 5fe73c82fd
[2.x] perf: Use bytecodeHash for incremental test (#9152)
**Problem**
There's perf issue building ClassStamp for the incremental test.

**Solution**
This reuses the bytecodeHash created during compilation.
2026-04-29 23:10:59 -04:00
eugene yokota 7b7aba5245
[2.0.x] Update to Zinc 2.0.0-M16 (#9145) 2026-04-27 04:15:15 -04:00
eugene yokota ec497c38ca
[2.0.x] fix: Remove will-be-ignored warning (#9144)
**Problem**
run warns about jvm option not being applied,
but it is applied for client-side run.

**Solution**
Remove the warning.
2026-04-27 04:14:12 -04:00
eugene yokota cecf8bd6c2
[2.x] Bump sbtn to 2.0.0-RC13 (#9141) 2026-04-27 01:23:55 -04:00
eugene yokota b441710fd4
Merge pull request #9142 from eed3si9n/bport/scripted
[2.0.x] bport: Expose scripted / excludeFilter
2026-04-27 01:18:58 -04:00
eugene yokota d59a2be85a [2.x] refactor: Replace string Array with ju.List (#9138)
**Problem**
Scala 3 supposedly has problem with String array in structural types.

**Solution**
This works around the issue by using ju.List.
2026-04-27 00:40:45 -04:00
Ali Rashid 30aded8ced [2.x] feat: Expose `scripted / excludeFilter` and `scripted / includeFilter` keys for scripted test filtering. (#9131)
* [2.x] feat: Add scripted / includeFilter and scripted / excludeFilter

* [2.x] Add scripted-exclude-filter scripted test. Remove stale item from Scripted.sbtWindowsExcludeFilter
2026-04-27 00:40:03 -04:00
eugene yokota 56c3fdbd0b
[2.0.x] fix: Fixes compilerPlugin(...) to ignore platform (#9135) (#9136)
**Problem**
When using scala-native, we can't enable semanticdb etc
because of the platform-level platform.

**Solution**
Since compilerPlugin(...) is always going to be JVM,
just add an explicit JVM platform to the given ModuleID.
2026-04-26 19:03:55 -04:00
eugene yokota 03c371db5e
[2.0.x] Add Test configuration to evictionWarningOptions (#9134)
* Add Test configuration to evictionWarningOptions
* Add Test configuration to default evictionWarningOptions
* Deduplicate eviction errors based on callers.
* Update eviction error test for semantic versioning.
* Group evictions by configuration and update test.

Co-authored-by: Zainab Ali <zainab.ali.london@gmail.com>
2026-04-26 13:37:00 -04:00
eugene yokota 9e2cc51579
[2.0.x] fix: Fixes managedScalaInstance false support (#9121) (#9124)
**Problem**
When managedScalaInstance is set to false, we stopped creating
ScalaInstance, but the documentation says the user can
pull in their own dependencies.

**Solution**
Attempt to construct a ScalaInstance from update report
even when managedScalaInstance is set to false.
2026-04-23 03:19:20 -04:00
eugene yokota 5de1057488
[2.0.x] hide JDK warnings if JDK 26 or later (#9119)
Co-authored-by: kenji yoshida <6b656e6a69@gmail.com>
2026-04-21 23:40:39 -04:00
eugene yokota 1dc197dc27
[2.0.x] Update sbtn version to package (#9090) 2026-04-15 02:59:43 -04:00
Eugene Yokota c0dc4eb660 sbt 2.0.0-RC12 2026-04-13 03:00:27 -04:00
eugene yokota f2e1bf8be6
Merge pull request #9082 from eed3si9n/bport2/client-side-run-fix
[2.0.x] Backport sbtn related fixes
2026-04-13 01:31:07 -04:00