Commit Graph

17910 Commits

Author SHA1 Message Date
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
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