Commit Graph

17692 Commits

Author SHA1 Message Date
bitloi f8704752e0
[2.x] feat: Add scriptedKeepTempDirectory setting (#8621)
CI / test (temurin, 11, 10, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 11, 10, windows-latest) (push) Waiting to run Details
CI / test (temurin, 11, 11, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 21, 1, ubuntu-22.04) (push) Waiting to run Details
CI / test (zulu, 25, 3, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 4, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 5, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 7, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 8, 2, ubuntu-latest) (push) Waiting to run Details
Client Test / test (temurin, 17, macos-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, ubuntu-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, windows-latest) (push) Waiting to run Details
Submit Dependency Graph / Submit Dependency Graph (push) Waiting to run Details
Server Test / test (push) Waiting to run Details
**Problem**

When running scripted tests to debug sbt plugins, the temporary directories (`/private/var/folder/...`) are automatically deleted after tests complete. This makes it difficult to inspect the test state for debugging purposes, requiring workarounds like adding `$ pause` commands and manually copying directories.

**Solution**

Added a new `scriptedKeepTempDirectory` setting that allows users to preserve temporary directories after scripted tests complete. When enabled, the temporary directory path is logged so users can inspect it.

Usage:
```scala
scriptedKeepTempDirectory := true
```
2026-01-23 21:22:50 -05:00
bitloi 64dadd6459
[2.x] fix: Throw on addCompilerPlugin(foo % Test) (#8622)
CI / test (temurin, 11, 10, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 11, 10, windows-latest) (push) Waiting to run Details
CI / test (temurin, 11, 11, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 21, 1, ubuntu-22.04) (push) Waiting to run Details
CI / test (zulu, 25, 3, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 4, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 5, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 7, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 8, 2, ubuntu-latest) (push) Waiting to run Details
Client Test / test (temurin, 17, macos-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, ubuntu-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, windows-latest) (push) Waiting to run Details
Submit Dependency Graph / Submit Dependency Graph (push) Waiting to run Details
Server Test / test (push) Waiting to run Details
Problem

When using `addCompilerPlugin((dependency) % Test)`, the compiler plugin was incorrectly added to BOTH `test:scalacOptions` AND `compile:scalacOptions`, instead of only `test:scalacOptions`.

Solution

Throw when the dependency is scoped, since we do not support this use case.
2026-01-23 11:41:16 -05:00
calm 8a518dfb98
[2.x] fix: Skip eviction warning when winner satisfies version range (#8616)
CI / test (temurin, 11, 10, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 11, 10, windows-latest) (push) Waiting to run Details
CI / test (temurin, 11, 11, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 21, 1, ubuntu-22.04) (push) Waiting to run Details
CI / test (zulu, 25, 3, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 4, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 5, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 7, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 8, 2, ubuntu-latest) (push) Waiting to run Details
Client Test / test (temurin, 17, macos-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, ubuntu-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, windows-latest) (push) Waiting to run Details
Submit Dependency Graph / Submit Dependency Graph (push) Waiting to run Details
Server Test / test (push) Waiting to run Details
- Add `versionSatisfiesRange()` function to `VersionRange.scala` supporting Maven-style ranges (`[x,y)`, `(x,y]`, `[x,)`, etc.) and plus ranges (`1.0+`)
- Check if winner version satisfies evicted module's version range in `guessCompatible()`
2026-01-22 15:52:58 -05:00
calm 398af2eaaa
[2.x] fix: Suppress "Multiple main classes" warning for runMain commands (#8613)
CI / test (temurin, 11, 10, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 11, 10, windows-latest) (push) Waiting to run Details
CI / test (temurin, 11, 11, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 21, 1, ubuntu-22.04) (push) Waiting to run Details
CI / test (zulu, 25, 3, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 4, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 5, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 7, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 8, 2, ubuntu-latest) (push) Waiting to run Details
Client Test / test (temurin, 17, macos-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, ubuntu-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, windows-latest) (push) Waiting to run Details
Submit Dependency Graph / Submit Dependency Graph (push) Waiting to run Details
Server Test / test (push) Waiting to run Details
Changed the scope separator parsing from `/` only to `[/:]` to handle both new slash syntax (`Test/runMain`) and old colon syntax (`test:runMain`).
2026-01-22 12:58:53 -05:00
circlecrystalin 55e75faee2
[2.x] fix: Fix flaky client tests (#8580) 2026-01-22 05:35:13 -05:00
calm 2380ab84b6
[2.x] feat: testOnly as a command (#8607)
CI / test (temurin, 11, 10, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 11, 10, windows-latest) (push) Waiting to run Details
CI / test (temurin, 11, 11, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 21, 1, ubuntu-22.04) (push) Waiting to run Details
CI / test (zulu, 25, 3, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 4, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 5, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 7, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 8, 2, ubuntu-latest) (push) Waiting to run Details
Client Test / test (temurin, 17, macos-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, ubuntu-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, windows-latest) (push) Waiting to run Details
Submit Dependency Graph / Submit Dependency Graph (push) Waiting to run Details
Server Test / test (push) Waiting to run Details
Adds `testOnly` command that fails when no tests match the specified patterns across all aggregated subprojects.
2026-01-22 04:53:54 -05:00
eugene yokota 089d56c50e
[2.x] doc: tech stack (#8609)
Problem/Solution

Document sbt's tech stack.
2026-01-22 04:20:06 -05:00
calm f4ab500d19
[2.x] fix: Use -external-mappings for Scala 3 doc task #6652 (#8602)
**Problem**

When `autoAPIMappings := true` is set on a Scala 3 project, running `sbt doc` emits warnings:

```
[warn] bad option '-doc-external-doc:/modules/java.base#https://docs.oracle.com/...
```

This happens because Scala 3's scaladoc doesn't recognize Scala 2's `-doc-external-doc` option.

Fixes #6652

**Solution**

- Added `Opts.doc.externalAPIScala3` that generates the Scala 3 format: `-external-mappings:regex::[scaladoc3|javadoc]::url`
- Modified `Defaults.scala` to use the appropriate method based on Scala version
- Added heuristics to detect javadoc vs scaladoc based on file/URL patterns
2026-01-22 02:13:10 -05:00
calm c099be5f18
[2.x] fix: Race condition in WorkerExchangeTest.propBye (#8606) 2026-01-22 00:49:41 -05:00
calm 527f109671
[2.x] fix: Lazy cache hostname resolution at object level (#8603)
CI / test (temurin, 11, 10, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 11, 10, windows-latest) (push) Waiting to run Details
CI / test (temurin, 11, 11, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 21, 1, ubuntu-22.04) (push) Waiting to run Details
CI / test (zulu, 25, 3, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 4, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 5, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 7, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 8, 2, ubuntu-latest) (push) Waiting to run Details
Client Test / test (temurin, 17, macos-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, ubuntu-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, windows-latest) (push) Waiting to run Details
Submit Dependency Graph / Submit Dependency Graph (push) Waiting to run Details
Server Test / test (push) Waiting to run Details
- Move hostname resolution to object-level lazy val to prevent blocking sbt startup
- On macOS with misconfigured hostname, `InetAddress.getLocalHost.getHostName` can take ~5 seconds due to DNS timeout
- Now resolution only happens once per session and is deferred until tests actually run
2026-01-21 20:01:28 -05:00
calm 37c6eb2cd9
[2.x] test: Add test for sbt --client startup time (#8599)
* Add test for sbt --client startup time
* Skip startup time test on macOS due to slow hostname resolution
2026-01-21 20:00:00 -05:00
MkDev11 2a5746cf6c
[2.x] feat: Add dependency lock file support (#2989) (#8581)
**What it does**

When you run `dependencyLock`, sbt generates a `deps.lock` file that captures your resolved dependencies. This file can be checked into version control to ensure reproducible builds across different machines and CI environments.

**New tasks**

- **`dependencyLock`** - Generates the lock file from the current resolution
- **`dependencyLockCheck`** - Validates the lock file is up-to-date (fails build if stale)

**How it works**

The lock file stores a hash of your declared dependencies and resolvers. When dependencies change, the hash changes, and `dependencyLockCheck` will fail until you regenerate the lock file.

If no lock file exists, `dependencyLockCheck` passes silently - this allows gradual adoption.
2026-01-21 19:08:59 -05:00
calm 1b8e3317f9
[2.x] feat: Add "3-latest.candidate" support for Scala 3 release candidates (#8596)
CI / test (temurin, 11, 10, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 11, 10, windows-latest) (push) Waiting to run Details
CI / test (temurin, 11, 11, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 21, 1, ubuntu-22.04) (push) Waiting to run Details
CI / test (zulu, 25, 3, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 4, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 5, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 7, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 8, 2, ubuntu-latest) (push) Waiting to run Details
Client Test / test (temurin, 17, macos-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, ubuntu-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, windows-latest) (push) Waiting to run Details
Submit Dependency Graph / Submit Dependency Graph (push) Waiting to run Details
Server Test / test (push) Waiting to run Details
Add support for `"3-latest.candidate"` to automatically resolve to the latest Scala 3 RC from Maven Central.

```scala
scalaVersion := "3-latest.candidate"
```

Ref https://github.com/sbt/sbt/discussions/8590
2026-01-21 03:42:50 -05:00
calm 642be58d44
Add scripted test for #6175 (#8598)
This PR adds a scripted test to prevent regression of issue #6175, where `MethodHandle.invokeExact` failed to compile on JDK 15+ when using `-release 11`.

Changes:
- Added `sbt-app/src/sbt-test/java/method-handle-release/` scripted test
- Test uses Scala 2.13.16 with `-release:11` to reproduce the original issue scenario
- Verifies that polymorphic signature methods compile correctly under cross-version targeting
2026-01-21 02:31:07 -05:00
Dairus d2cd284e5e
[2.x] Add scripted test for #7838 (#8541)
CI / test (temurin, 11, 10, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 11, 10, windows-latest) (push) Waiting to run Details
CI / test (temurin, 11, 11, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 21, 1, ubuntu-22.04) (push) Waiting to run Details
CI / test (zulu, 25, 3, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 4, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 5, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 7, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 8, 2, ubuntu-latest) (push) Waiting to run Details
Client Test / test (temurin, 17, macos-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, ubuntu-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, windows-latest) (push) Waiting to run Details
Submit Dependency Graph / Submit Dependency Graph (push) Waiting to run Details
Server Test / test (push) Waiting to run Details
This PR adds a new scripted test `watch-termination-reload` to prevent regression of the fix in PR #7838. The test verifies that the `Reload` action is correctly passed to the `watchOnTermination` callback when a reload is triggered in watch mode, instead of falling back to `CancelWatch` (which was the root cause of issue #7017).
2026-01-20 12:13:27 -05:00
azdrojowa123 6493707d2f
[2.x] fix: Create `project` directory if extra sbt files are added to the meta-build #8570 (#8586)
CI / test (temurin, 11, 10, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 11, 10, windows-latest) (push) Waiting to run Details
CI / test (temurin, 11, 11, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 21, 1, ubuntu-22.04) (push) Waiting to run Details
CI / test (zulu, 25, 3, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 4, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 5, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 7, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 8, 2, ubuntu-latest) (push) Waiting to run Details
Client Test / test (temurin, 17, macos-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, ubuntu-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, windows-latest) (push) Waiting to run Details
Submit Dependency Graph / Submit Dependency Graph (push) Waiting to run Details
Server Test / test (push) Waiting to run Details
2026-01-20 10:02:58 -05:00
MkDev11 6f14de514b
[2.x] feat: Add setup-java action support in CrossJava (#8574)
Add SetupJavaDiscoverConfig to detect JDKs installed by GitHub's
setup-java action at paths like:
- /opt/hostedtoolcache/Java_Zulu_jdk/25.0.1-8/x64 (Linux)
- C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\11.0.29-7\x64 (Windows)

These JDKs are now available in fullJavaHomes as zulu@25.0.1,
temurin@11.0.29, etc.

Supported vendors: Zulu, Temurin, Adopt, Corretto, Liberica,
Microsoft, Semeru. Temurin-Hotspot and Adopt are normalized to
temurin.

Fixes #8582

* test: Refactor setup-java tests to use real directory structure

---------

Co-authored-by: mkdev11 <noreply@users.noreply.github.com>
2026-01-20 09:35:43 -05:00
MkDev11 b6cdfe0d81
[2.x] test: Test transitive cached task (#8579)
Co-authored-by: mkdev11 <noreply@users.noreply.github.com>
2026-01-19 22:40:37 -05:00
byteforge c5af677632
[2.x] feat: Support ... as testOnly pattern (#8577) 2026-01-19 18:45:29 -05:00
Dream a5f915bf87
[2.x] test: Migrate ClassLoaderCacheTest to verify.BasicTestSuite (#8534) 2026-01-19 17:13:21 -05:00
circlecrystalin 2f348a09b9
[2.x] fix: Fixes the handling of special characters in dot files (#8558)
- Replace 'eval echo $line' with 'printf "%s\n" "$line"' in loadConfigFile()
- Prevents shell expansion of special characters like |, *, &, etc.
- Fixes issue where properties with pipes, wildcards, and ampersands
  caused 'command not found' or 'unexpected' errors
- Add test to verify special characters are handled correctly on all platforms
2026-01-19 14:37:08 -05:00
eugene yokota 215e9d6325
[2.x] fix: Prevent fork test cross talk (#8575)
CI / test (temurin, 11, 10, ubuntu-latest) (push) Has been cancelled Details
CI / test (temurin, 11, 10, windows-latest) (push) Has been cancelled Details
CI / test (temurin, 11, 11, ubuntu-latest) (push) Has been cancelled Details
CI / test (temurin, 21, 1, ubuntu-22.04) (push) Has been cancelled Details
CI / test (zulu, 25, 3, ubuntu-latest) (push) Has been cancelled Details
CI / test (zulu, 25, 4, ubuntu-latest) (push) Has been cancelled Details
CI / test (zulu, 25, 5, ubuntu-latest) (push) Has been cancelled Details
CI / test (zulu, 25, 7, ubuntu-latest) (push) Has been cancelled Details
CI / test (zulu, 8, 2, ubuntu-latest) (push) Has been cancelled Details
Client Test / test (temurin, 17, macos-latest) (push) Has been cancelled Details
Client Test / test (zulu, 8, ubuntu-latest) (push) Has been cancelled Details
Client Test / test (zulu, 8, windows-latest) (push) Has been cancelled Details
Submit Dependency Graph / Submit Dependency Graph (push) Has been cancelled Details
Server Test / test (push) Has been cancelled Details
**Problem**
currently all notifications go to all listeners.

**Solution**
This adds "re" field so we can check if it matches with the id.
2026-01-19 00:55:16 -05:00
E.G 0ec5144a63
[2.x] test: Migrate parser specs to verify.BasicTestSuite (#8551)
CI / test (temurin, 11, 10, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 11, 10, windows-latest) (push) Waiting to run Details
CI / test (temurin, 11, 11, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 21, 1, ubuntu-22.04) (push) Waiting to run Details
CI / test (zulu, 25, 3, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 4, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 5, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 7, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 8, 2, ubuntu-latest) (push) Waiting to run Details
Client Test / test (temurin, 17, macos-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, ubuntu-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, windows-latest) (push) Waiting to run Details
Submit Dependency Graph / Submit Dependency Graph (push) Waiting to run Details
Server Test / test (push) Waiting to run Details
Migrate the following test files from ScalaTest's AnyFlatSpec to
verify.BasicTestSuite, following the pattern established by other
test files in the sbt codebase:

- SizeParserSpec.scala (util-complete)
- MultiParserSpec.scala (main-command)

Changes in all files:
- Replace AnyFlatSpec class with BasicTestSuite object
- Convert 'should ... in' syntax to 'test(...)' syntax
- Use Scala 3 syntax with colon indentation
- Add 'end' markers
- Add explicit types where needed

Related to the ongoing test migration effort.
2026-01-18 14:33:04 -05:00
E.G 574654900f
[2.x] test: migrate SonaClientTest from ScalaTest to verify.BasicTestSuite (#8562)
- Convert class to object with BasicTestSuite
- Use test() syntax instead of 'should ... in'
- Move RecordingLogger and extension to top-level
- Use Scala 3 colon indentation syntax

Co-authored-by: GlobalStar117 <GlobalStar117@users.noreply.github.com>
2026-01-18 14:31:06 -05:00
E.G 402619fc45
[2.x] fix: Format Seq values consistently in multi-project builds (fixes #7339) (#8567)
CI / test (temurin, 11, 10, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 11, 10, windows-latest) (push) Waiting to run Details
CI / test (temurin, 11, 11, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 21, 1, ubuntu-22.04) (push) Waiting to run Details
CI / test (zulu, 25, 3, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 4, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 5, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 7, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 8, 2, ubuntu-latest) (push) Waiting to run Details
Client Test / test (temurin, 17, macos-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, ubuntu-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, windows-latest) (push) Waiting to run Details
Submit Dependency Graph / Submit Dependency Graph (push) Waiting to run Details
Server Test / test (push) Waiting to run Details
When running commands like 'Test/definedTests' on multi-project builds,
the output was showing raw Vector(...) format instead of nicely formatted
per-item output.

Before:
  [info] svc / Test / definedTests
  [info]   Vector(Test FooSpec : ..., Test BarSpec : ..., ...)

After:
  [info] svc / Test / definedTests
  [info]   * Test FooSpec : ...
  [info]   * Test BarSpec : ...

The fix extends printSettings to check if values are Seq types in
the multi-project case and format each item on its own line with
a '* ' prefix, matching the single-project behavior.
2026-01-17 14:37:42 -05:00
E.G 1efebeaa98
fix: Handle -X JVM options on command line (fixes #5742) (#8566)
Previously, passing JVM options like -Xmx1G directly on the command
line would result in an error:

  sbt -v -Xmx1G
  [error] Expected ';'
  [error] -Xmx1G
  [error]       ^

This was because -X options were being passed to sbt as commands
instead of being recognized as JVM arguments.

Changes:
- Added handling for -X options in sbt.bat to pass them to the JVM
- Updated help text to document this feature
- Added integration tests for the new functionality
2026-01-17 14:29:30 -05:00
eugene yokota 8b4b89c395
[2.x] Disable delegation on shell (#8539)
CI / test (temurin, 11, 10, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 11, 10, windows-latest) (push) Waiting to run Details
CI / test (temurin, 11, 11, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 21, 1, ubuntu-22.04) (push) Waiting to run Details
CI / test (zulu, 25, 3, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 4, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 5, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 7, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 8, 2, ubuntu-latest) (push) Waiting to run Details
Client Test / test (temurin, 17, macos-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, ubuntu-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, windows-latest) (push) Waiting to run Details
Submit Dependency Graph / Submit Dependency Graph (push) Waiting to run Details
Server Test / test (push) Waiting to run Details
**Problem**
Currently the shell delegates request tasks even when a non-existent
task like Compile / update is requested.

**Solution**
This removes the delegation, if the input key is scoped, so it will fail.
We will, however, continue to delegate on the subproject axis,
since it's useful to use Global or ThisBuild scoping.
2026-01-17 00:05:21 -05:00
bitloi c832fad7b5
[2.x] feat: Notify sbtn client when command is queued (#8568)
CI / test (temurin, 11, 10, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 11, 10, windows-latest) (push) Waiting to run Details
CI / test (temurin, 11, 11, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 21, 1, ubuntu-22.04) (push) Waiting to run Details
CI / test (zulu, 25, 3, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 4, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 5, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 7, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 8, 2, ubuntu-latest) (push) Waiting to run Details
Client Test / test (temurin, 17, macos-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, ubuntu-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, windows-latest) (push) Waiting to run Details
Submit Dependency Graph / Submit Dependency Graph (push) Waiting to run Details
Server Test / test (push) Waiting to run Details
Fixes #8356

**Problem**

When `sbtn` sends a command while another long-running task (like `console`) is already executing, the client silently blocks with no indication that the command is waiting in a queue.

**Solution**

When a new command arrives via the network channel and another command is currently running, the server now sends an `ExecStatusEvent` notification with status `"Queued"` to the client. The client displays a message like:

```
[info] waiting for: console
```
2026-01-16 16:17:00 -05:00
eugene yokota 4d7e0633a8
Revert "[2.x] feat: Enable musl static linking for sbtn on JDK 17+ (#8464)" (#8557)
CI / test (temurin, 11, 10, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 11, 10, windows-latest) (push) Waiting to run Details
CI / test (temurin, 11, 11, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 21, 1, ubuntu-22.04) (push) Waiting to run Details
CI / test (zulu, 25, 3, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 4, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 5, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 7, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 8, 2, ubuntu-latest) (push) Waiting to run Details
Client Test / test (temurin, 17, macos-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, ubuntu-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, windows-latest) (push) Waiting to run Details
Submit Dependency Graph / Submit Dependency Graph (push) Waiting to run Details
Server Test / test (push) Waiting to run Details
This reverts commit e16298521b.
2026-01-16 00:06:28 -05:00
E.G 282719f796
[2.x] test: Migrate ManagedLoggerSpec.scala to verify.BasicTestSuite (#8548)
Migrate ManagedLoggerSpec.scala from ScalaTest's AnyFlatSpec + Matchers
to verify.BasicTestSuite, following the pattern established by other
test files in the sbt codebase.

Changes:
- Replace AnyFlatSpec class with BasicTestSuite object
- Remove ScalaTest Matchers dependency
- Convert 'should ... in' syntax to 'test(...)' syntax
- Use Scala 3 syntax with colon indentation
- Add explicit types for val definitions
- Convert for comprehension to for-do syntax
- Add 'end ManagedLoggerSpec' marker
2026-01-15 23:16:54 -05:00
Pegasus 79c60ca4c1
[2.x] fix: Allow dependencyTree to run despite eviction errors (#8554)
CI / test (temurin, 11, 10, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 11, 10, windows-latest) (push) Waiting to run Details
CI / test (temurin, 11, 11, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 21, 1, ubuntu-22.04) (push) Waiting to run Details
CI / test (zulu, 25, 3, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 4, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 5, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 7, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 8, 2, ubuntu-latest) (push) Waiting to run Details
Client Test / test (temurin, 17, macos-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, ubuntu-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, windows-latest) (push) Waiting to run Details
Submit Dependency Graph / Submit Dependency Graph (push) Waiting to run Details
Server Test / test (push) Waiting to run Details
**Problem**
When binary compatibility eviction errors occur, users cannot run
`dependencyTree` to debug the dependency conflict because it fails
with the same eviction error.

**Solution**
Set `evictionErrorLevel` and `assumedEvictionErrorLevel` to `Level.Warn`
for the `dependencyTreeIgnoreMissingUpdate` task, allowing the dependency
tree to be displayed even when eviction errors are present.

Fixes #7255
2026-01-15 22:52:38 -05:00
E.G 710d4a911b
[2.x] test: Migrate TrackedSpec.scala to verify.BasicTestSuite (#8547)
* test: Migrate TrackedSpec.scala to verify.BasicTestSuite

Migrate TrackedSpec.scala from ScalaTest's AnyFlatSpec to
verify.BasicTestSuite, following the pattern established by other
test files in the sbt codebase.

Changes:
- Replace AnyFlatSpec class with BasicTestSuite object
- Convert 'should ... in' syntax to 'test(...)' syntax
- Use Scala 3 syntax with colon indentation
- Change === to == for assertions (BasicTestSuite style)
- Replace fail() with throw new AssertionError for explicit failures
- Add 'end TrackedSpec' marker
- Convert braces to colon-style for if expressions
2026-01-15 22:51:29 -05:00
E.G f4bd7689a3
[2.x] test: Migrate FileInfoSpec.scala to verify.BasicTestSuite (#8544)
* test: Migrate FileInfoSpec.scala to verify.BasicTestSuite (#8542)

Migrate FileInfoSpec.scala from ScalaTest's AnyFlatSpec to
verify.BasicTestSuite, following the pattern established by other
test files in the util-cache module.

Changes:
- Replace AnyFlatSpec class with BasicTestSuite object
- Convert 'it should ... in' syntax to 'test(...)' syntax
- Use Scala 3 syntax with colon indentation
- Change === to == for assertions (BasicTestSuite style)
- Add explicit Unit return types for consistency
- Add 'end FileInfoSpec' marker

Fixes #8542
2026-01-15 22:19:30 -05:00
E.G b107fb6c5c
[2.x] test: Migrate IvyActionsOverrideSpec.scala to verify.BasicTestSuite (#8553)
Co-authored-by: GlobalStar117 <GlobalStar117@users.noreply.github.com>
2026-01-15 15:09:58 -05:00
E.G ba9b5155e1
[2.x] test: Migrate UpdateReportSpec to verify.BasicTestSuite (#8545)
* test: Migrate UpdateReportSpec to verify.BasicTestSuite (#8543)

Migrate UpdateReportSpec.scala from ScalaTest's AnyFlatSpec + Matchers
to verify.BasicTestSuite, following the pattern established by other
test files in the lm-core module.

Changes:
- Replace AnyFlatSpec class with BasicTestSuite object
- Remove ScalaTest Matchers dependency
- Convert 'should ... in' syntax to 'test(...)' syntax
- Use Scala 3 syntax with colon indentation
- Change === to == for assertions (BasicTestSuite style)
- Add explicit types for lazy vals
- Add 'end UpdateReportSpec' marker

Fixes #8543

* Update lm-core/src/test/scala/UpdateReportSpec.scala

---------

Co-authored-by: GlobalStar117 <GlobalStar117@users.noreply.github.com>
2026-01-15 15:07:48 -05:00
E.G 009b0e1276
[2.x] test: Migrate FileStampJsonSpec.scala to verify.BasicTestSuite (#8552)
Co-authored-by: GlobalStar117 <GlobalStar117@users.noreply.github.com>
2026-01-15 15:01:57 -05:00
E.G eaea5f83ad
[2.x] test: Migrate util-logging specs to verify.BasicTestSuite (#8550)
CI / test (temurin, 11, 10, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 11, 10, windows-latest) (push) Waiting to run Details
CI / test (temurin, 11, 11, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 21, 1, ubuntu-22.04) (push) Waiting to run Details
CI / test (zulu, 25, 3, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 4, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 5, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 7, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 8, 2, ubuntu-latest) (push) Waiting to run Details
Client Test / test (temurin, 17, macos-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, ubuntu-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, windows-latest) (push) Waiting to run Details
Submit Dependency Graph / Submit Dependency Graph (push) Waiting to run Details
Server Test / test (push) Waiting to run Details
* test: Migrate util-logging specs to verify.BasicTestSuite

Migrate the following test files from ScalaTest's AnyFlatSpec to
verify.BasicTestSuite, following the pattern established by other
test files in the sbt codebase:

- UTF8DecoderSpec.scala
- StackTraceSpec.scala
- TerminalColorSpec.scala

Changes in all files:
- Replace AnyFlatSpec class with BasicTestSuite object
- Convert 'should ... in' syntax to 'test(...)' syntax
- Use Scala 3 syntax with colon indentation
- Add 'end' markers
- Add explicit types where needed

Related to the ongoing test migration effort.

---------

Co-authored-by: GlobalStar117 <GlobalStar117@users.noreply.github.com>
2026-01-15 14:21:00 -05:00
E.G 0afc624009
[2.x] test: Migrate SingletonCacheSpec.scala to verify.BasicTestSuite (#8546)
Migrate SingletonCacheSpec.scala from ScalaTest's AnyFlatSpec to
verify.BasicTestSuite, following the pattern established by other
test files in the util-cache module.

Changes:
- Replace AnyFlatSpec class with BasicTestSuite object
- Convert 'should ... in' syntax to 'test(...)' syntax
- Use Scala 3 syntax with colon indentation
- Change === to == for assertions (BasicTestSuite style)
- Replace intercept[Exception] with scala.util.Try pattern
- Add 'end SingletonCacheSpec' and 'end ComplexType' markers

Related to the ongoing test migration effort.

Co-authored-by: GlobalStar117 <GlobalStar117@users.noreply.github.com>
2026-01-15 14:09:25 -05:00
E.G 0760f77881
[2.x] test: Migrate ProgressStateSpec.scala to verify.BasicTestSuite (#8549)
Migrate ProgressStateSpec.scala from ScalaTest's AnyFlatSpec with
BeforeAndAfterAll to verify.BasicTestSuite, following the pattern
established by other test files in the sbt codebase.

Changes:
- Replace AnyFlatSpec class with BasicTestSuite object
- Remove BeforeAndAfterAll trait and convert afterAll to try-finally
- Use scala.util.Using.resource for proper resource management
- Convert 'should ... in' syntax to 'test(...)' syntax
- Use Scala 3 syntax with colon indentation
- Change === to == for assertions
- Add 'end ProgressStateSpec' marker

Related to the ongoing test migration effort.

Co-authored-by: GlobalStar117 <GlobalStar117@users.noreply.github.com>
2026-01-15 14:04:38 -05:00
aka James4u dce915e794
[2.x] fix: Error "Exception in thread "sbt-socket-server" java.lang.NullPointerException" on exit (#8448)
Fixes #8538

The code was calling e.getMessage.contains() without checking if getMessage()
returns null. Changed to use Option(e.getMessage).exists() to safely handle
null values.
2026-01-15 11:06:51 -05:00
Dairus 7368252678
[2.x] fix: Skip checksums for PGP signature files (.asc) (#8535)
CI / test (temurin, 11, 10, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 11, 10, windows-latest) (push) Waiting to run Details
CI / test (temurin, 11, 11, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 21, 1, ubuntu-22.04) (push) Waiting to run Details
CI / test (zulu, 25, 3, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 4, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 5, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 7, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 8, 2, ubuntu-latest) (push) Waiting to run Details
Client Test / test (temurin, 17, macos-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, ubuntu-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, windows-latest) (push) Waiting to run Details
Submit Dependency Graph / Submit Dependency Graph (push) Waiting to run Details
Server Test / test (push) Waiting to run Details
## Problem
When using `publishSigned` (via sbt-pgp), sbt creates checksum files (e.g., `.pom.asc.sha1`) for PGP signature files (`.asc`). This violates Maven norms, where checksums should only be generated for raw artifacts like JARs and POMs, not for signatures.

## Solution
Modified the checksum generation logic in `ChecksumFriendlyURLResolver.put` (in `lm-ivy/src/main/scala/sbt/internal/librarymanagement/ConvertResolver.scala`) to skip generating checksums for artifacts whose names end with `.asc`.
2026-01-15 01:04:33 -05:00
MkDev11 b2db55768c
[2.x] fix: Log server response body on publish failure (#8537)
When publishing to a repository fails with an HTTP error (e.g., 403, 409), the server often includes helpful error details in the response body. Previously, sbt only showed the HTTP status code without the response body.

This reimplements the upload method.

Fixes #7423
2026-01-15 00:23:31 -05:00
MkDev11 fb53925fb6
[2.x] fix: Prevent sbt test from hanging when forked process crashes (#8536)
When a forked test process crashes (e.g., due to UnsupportedClassVersionError),
sbt would hang forever waiting for test results. This happened because
notifyExit only completed the promise with success, regardless of the
exit code.

This fix checks the exit code and fails the promise if the process
exited with a non-zero code, allowing sbt to properly report the failure
and exit.

Fixes #7429
2026-01-14 21:54:17 -05:00
MkDev11 b58c0fb37f
[2.x] fix: Cleanup child processes on sbt exit (#8532)
CI / test (temurin, 11, 10, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 11, 10, windows-latest) (push) Waiting to run Details
CI / test (temurin, 11, 11, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 21, 1, ubuntu-22.04) (push) Waiting to run Details
CI / test (zulu, 25, 3, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 4, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 5, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 7, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 8, 2, ubuntu-latest) (push) Waiting to run Details
Client Test / test (temurin, 17, macos-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, ubuntu-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, windows-latest) (push) Waiting to run Details
Submit Dependency Graph / Submit Dependency Graph (push) Waiting to run Details
Server Test / test (push) Waiting to run Details
When using fork := true, sbt spawns child processes that may become
stale if cancelled. Previously, these processes were not cleaned up
when running the exit command.

This fix adds RunningProcesses.killAll() to the shutdown hook so that
all tracked forked processes are terminated when sbt exits.

Fixes #7468
2026-01-14 15:57:50 -05:00
MkDev11 1ed08f0034
[2.x] fix: Propagate SBT_OPTS to BSP config (#8531)
Fixes #7469

When running 'sbt bspConfig', the generated .bsp/sbt.json now includes
JVM options from the SBT_OPTS environment variable. This ensures that
options like -Dsbt.boot.directory are propagated to the BSP server.

The parseSbtOpts method extracts -D, -X, and -J prefixed options from
SBT_OPTS and includes them in the BSP connection argv.
2026-01-14 14:20:30 -05:00
Dairus 8433dd8db6
[2.x] test: Migrate CleanStringSpec to verify.BasicTestSuite (#8526)
CI / test (temurin, 11, 10, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 11, 10, windows-latest) (push) Waiting to run Details
CI / test (temurin, 11, 11, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 21, 1, ubuntu-22.04) (push) Waiting to run Details
CI / test (zulu, 25, 3, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 4, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 5, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 7, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 8, 2, ubuntu-latest) (push) Waiting to run Details
Client Test / test (temurin, 17, macos-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, ubuntu-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, windows-latest) (push) Waiting to run Details
Submit Dependency Graph / Submit Dependency Graph (push) Waiting to run Details
Server Test / test (push) Waiting to run Details
2026-01-14 11:10:40 -05:00
MkDev11 f85ced45f2
[2.x] fix: Start server when explicitly requested via BSP/thin client (#8529)
Fixes #7481

When sbt is started by a remote client (BSP or thin client via --server flag),
always start the server regardless of autoStartServer setting. The autoStartServer
setting is meant for automatic server startup, not for blocking explicit server
start requests.
2026-01-14 04:57:05 -05:00
MkDev11 7b33362245
[2.x] fix: Preserve user-defined scalacOptions in doc task scope (#8528)
CI / test (temurin, 11, 10, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 11, 10, windows-latest) (push) Waiting to run Details
CI / test (temurin, 11, 11, ubuntu-latest) (push) Waiting to run Details
CI / test (temurin, 21, 1, ubuntu-22.04) (push) Waiting to run Details
CI / test (zulu, 25, 3, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 4, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 5, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 25, 7, ubuntu-latest) (push) Waiting to run Details
CI / test (zulu, 8, 2, ubuntu-latest) (push) Waiting to run Details
Client Test / test (temurin, 17, macos-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, ubuntu-latest) (push) Waiting to run Details
Client Test / test (zulu, 8, windows-latest) (push) Waiting to run Details
Submit Dependency Graph / Submit Dependency Graph (push) Waiting to run Details
Server Test / test (push) Waiting to run Details
Fixes #7482
2026-01-14 00:57:42 -05:00
MkDev11 82e370b4cb
[2.x] fix: inputFileChanges with nested task scopes (#8516)
Fixes #7489

When using nested task scopes like otherTask / testTask, the
inputFileChanges macro was returning the wrong scope. It checked
if the scope already had a task axis and returned it as-is, but
this meant it would use otherTask's scope instead of testTask's.

The fix always sets the task axis to the key being queried,
ensuring fileInputs settings are found at the correct scope.
2026-01-14 00:10:23 -05:00
MkDev11 e16298521b
[2.x] feat: Enable musl static linking for sbtn on JDK 17+ (#8464)
** Problem **

The sbtn (sbt thin client) native image on Linux currently depends on glibc because ipcsocket uses JNI for Unix domain sockets. When building with musl for static linking, the JNI library fails to load since musl doesn't support `dlopen`.

** Solution **

Instead of upgrading to ipcsocket 2.x (which isn't ready for production), I created a `UnixDomainSocketFactory` that detects JDK 17+ at runtime and uses the native `java.net.UnixDomainSocketAddress` API directly via reflection. This completely bypasses JNI on modern JDKs.

For older JDKs (8 and 11), the factory falls back to ipcsocket 1.6.3, which is stable and well-tested.

** How It Works **

The factory checks at startup whether `java.net.UnixDomainSocketAddress` is available:

- **JDK 17+**: Uses native NIO Unix domain sockets (no JNI, no native libraries)
- **JDK 8/11**: Falls back to ipcsocket's JNI-based implementation

This approach:
- Enables musl static linking on JDK 17+ without any native dependencies
- Maintains full backward compatibility with older JDKs
- Keeps the stable ipcsocket 1.6.3 instead of the unstable 2.x
2026-01-13 23:14:45 -05:00