Commit Graph

2756 Commits

Author SHA1 Message Date
eugene yokota 81d3527913
Merge pull request #8468 from xuwei-k/tailrec-annotation
[2.x] Add `@tailrec` annotation
2026-01-11 03:19:19 -05:00
eugene yokota 271caaab37
Merge pull request #8471 from xuwei-k/BuildServerProtocol-nowarn
[2.x] Fix warnings in BuildServerProtocol.scala
2026-01-11 03:19:03 -05:00
xuwei-k 5667a46749 Fix warnings in BuildServerProtocol.scala 2026-01-11 16:50:36 +09:00
xuwei-k 3b4b7effc2 Remove redundant String#toString 2026-01-11 16:46:05 +09:00
xuwei-k c0fe4dfb10 Add tailrec annotation 2026-01-11 16:33:45 +09:00
MkDev11 37ee88d0fb
Merge branch 'develop' into fix/gc-monitor-warning-8002 2026-01-10 12:23:39 -08:00
mkdev11 9be376973d fix: Use 'CPU seconds' to clarify GC time can exceed wall clock
Address review feedback from eed3si9n to make it clearer that GC time
is cumulative CPU time across parallel collectors, which is why it can
exceed wall clock time.

Fixes #8002
2026-01-10 22:23:05 +02:00
mkdev11 1b2bc53bcf fix: Improve GCMonitor warning message clarity
Add 'seconds' unit to GC time and clarify that the percentage
represents cumulative GC pause time across all collectors.

Fixes #8002
2026-01-10 15:03:57 +02:00
Eugene Yokota a921a86440 [2.x] consoleProject
**Problem**
consoleProject doesn't work. REPL doesn't even start.

**Solution**
I made some progress into consoleProject.
At least Scala 3.7 repl session will now start.
The problem is that compiler bridge has not implemented binding,
so we can't forward the sbt build information into the repl.
2026-01-10 02:15:59 -05:00
MkDev11 061145e67b
[2.x] Add testForkedParallelism setting for forked test thread count (#8453)
**Problems**

When running forked tests, sbt uses `Runtime.getRuntime().availableProcessors()` to determine the thread pool size, ignoring `concurrentRestrictions`. This is inconsistent with non-forked parallel tests.

**Expectations**

Users should be able to control the number of parallel test threads in forked mode, similar to how `concurrentRestrictions` works for non-forked tests.

**Notes**

Added a new setting `testForkedParallelism` that allows explicit control:

```scala
testForkedParallelism := Some(2)  // Use 2 threads
testForkedParallelism := None     // Use availableProcessors() (default)
```
2026-01-09 12:43:50 -05:00
calm329 79b54a28ce Fix ParseKeySpec flaky test when task name matches project name (#8326) 2026-01-08 20:55:14 -08:00
eugene yokota b537afee76
Merge pull request #8452 from calm329/fix/8441-jna-nosys-conditional
[2.x] Fix #8441: Allow system JNA on OpenBSD by making jna.nosys conditional
2026-01-08 20:07:22 -05:00
calm 8c20401fb9
[2.x] Report eviction errors for Test dependencies (#8451)
Eviction warnings and errors were not reported for Test dependencies because
`EvictionError` only checked the Compile configuration.

This fix runs the eviction check for both Compile and Test configurations
separately, with distinct error messages:

- Compile: `found version conflict(s) in library dependencies`
- Test: `found version conflict(s) in Test dependencies`
2026-01-08 20:01:18 -05:00
calm329 1054ee851e Fix #8441: Allow system JNA on OpenBSD by making jna.nosys conditional 2026-01-08 15:19:36 -08:00
Francluob 4976ec7dc7 Fix #8344: Skip interactive prompt in batch mode when project loading fails
When project loading fails in batch mode, sbt was showing an interactive
prompt asking the user to choose between retry, quit, last, or ignore.
However, in batch mode there is no interactive terminal, causing the
process to hang waiting for input that will never come.

This fix checks if we're in batch mode (Prompt.Batch) and automatically
exits with failure (equivalent to 'q' quit option) without prompting the
user. This prevents infinite retry loops on persistent errors and allows
batch mode scripts to fail fast, which is appropriate for CI/CD environments.

The interactive behavior remains unchanged for non-batch mode.
2026-01-08 19:29:35 +01:00
aka James4u a4ad73ddf6
fix: prevent server boot when --no-server is used (#8444)
* fix: prevent server boot when --no-server is used
* refactor: move serverAutoStart to sysprops
* refact: scalafmt
2026-01-07 15:11:04 -05:00
Eugene Yokota e3f99d39cb Merge branch '1.12.x' into wip/merge-1.12.x 2026-01-05 00:08:21 -05:00
Eugene Yokota 0a15069e83 Show warnings when scalaVersion is missing
**Problem**
There's a disconnect between what is perceived to be the current
Scala version, and what sbt uses internally, and thus what it
chooses to be the default scalaVersion.

**Solution**
This displays a warning if scalaVersion setting is missing.
2026-01-04 15:23:05 -05:00
Eugene Yokota 6cb786d010 [2.x] Show warnings when scalaVersion is missing
**Problem**
There's a disconnect between what is perceived to be the current
Scala version, and what sbt uses internally, and thus what it
chooses to be the default scalaVersion.

**Solution**
This displays a warning if scalaVersion setting is missing.
2025-12-27 23:49:43 -05:00
eugene yokota b536bc037d
Merge pull request #8359 from eed3si9n/wip/dependency-tree
[1.x] Use internal config for dependency tree (for Provided)
2025-12-19 01:08:44 -05:00
Eugene Yokota e6492b771e [2.x] fix: Replace Scala version with u when crossPaths is false
**Problem**
sbt 2.x uses crossTarget by default, but it contains Scala version
even when crossPaths is false.

**Solution**
This replaces it with the letter "u" for unspecified.
2025-12-18 00:00:11 -05:00
eugene yokota 26b5ee457f
Merge pull request #8421 from eed3si9n/wip/matrix-cross
[2.x] projectMatrix crossVerson support
2025-12-16 23:45:43 -05:00
Eugene Yokota 4d6ddd50a6 [2.x] projectMatrix crossVerson support
**Problem**
crossVersion is missing from projectMatrix in sbt 2.x.

**Solution**
Port it from sbt-projectmatrix.
2025-12-16 01:33:43 -05:00
Eugene Yokota 3518ae497e [2.x] fix: Scala 3.8 REPL support 2025-12-15 23:48:36 -05:00
Aleksandra Zdrojowa 14f1839647 return build targets sources from `buildTarget/dependencySources` request #8403 2025-12-14 13:35:25 +01:00
Anatolii Kmetiuk 0acb12a978 Fix #8405: updateSbtClassifiers includes plugins in dependencies list
Preserve original direct dependencies (plugins) and merge with transitive dependencies
Original dependencies may include plugins that are NOT transitive dependencies of sbt
2025-12-11 10:50:29 +09:00
xuwei-k 70960744e7 Scala 2.12.21 2025-12-09 17:28:03 +09:00
Aleksandra Zdrojowa 0d9f40811b return build targets sources from `buildTarget/dependencySources` request #8403 2025-12-08 19:22:35 +01:00
Aleksandra Zdrojowa 1f269ad604 change the order of FailureWall & PopOnFailure in the reload command #8389
- it's done to prevent the sbt process from being killed in case of task failure after a load failure has been executed
2025-12-04 16:12:11 +01:00
Eugene Yokota ffc2f8c35d fix: Fixes managed resources missing from the JAR
**Problem**
RC-7 is missing the managed resources.

**Solution**
This triggers managed resources so they get generated.
2025-11-28 23:51:08 -05:00
Eugene Yokota f097a12f7e fix: Fixes JLine history
**Problem**
JLine history disappears if we change the Scala version.

**Solution**
Put it back into a non-crossed path.
2025-11-25 23:06:46 -05:00
eugene yokota b43b73c319
Merge branch 'develop' into wip/remove-old-remote 2025-11-25 02:34:16 -05:00
Eugene Yokota fe266cd59e Merge branch '1.12.x' into wip/merge-1.12.x 2025-11-25 02:13:03 -05:00
Hamza Remmal 531c5d18db
do not assume scala3_library to be a jar 2025-11-24 22:01:33 +01:00
Eugene Yokota 5730383340 Merge branch '1.12.x' into wip/merge-1.12.x 2025-11-24 02:14:17 -05:00
Eugene Yokota 77e74871ad Remove sbt 1.x remote cache imple 2025-11-23 22:47:21 -05:00
Eugene Yokota d1e0a5a35d cleanFull 2025-11-23 14:45:21 -05:00
Eugene Yokota c8edb171ee [2.x] Adds cleanExpunge command
**Problem**
We might want to clear the disk cache.

**Solution**
This adds cleanExpunge command.
2025-11-22 23:12:18 -05:00
eugene yokota fe6e9b4802
Merge pull request #8377 from eed3si9n/wip/compiler-bridge
[2.x] perf: Cache compiler bridge binary
2025-11-22 15:30:00 -05:00
Eugene Yokota 68b2b7d025 [2.x] perf: Cache compiler bridge binary
**Problem**
Compiler bridge resolution calls out to Coursier,
and it shows up on the profiler.

**Solution**
This uses sbt 2.x caching to cache the prebuilt compiler bridge binaries
to avoid calling Coursier from second time onwards.
2025-11-19 03:26:13 -05:00
eugene yokota df11b264db
Merge pull request #8375 from azdrojowa123/reload-on-source-changes
Trigger only load (without loadFailed) in the case of NetworkChannel
2025-11-19 00:44:47 -05:00
Aleksandra Zdrojowa da42031bb3 remove the `isInteractive` check when deciding whether to trigger an additional reload #8371 2025-11-18 21:48:11 +01:00
Eugene Yokota 6a2e0a9b04 [2.x] perf: Avoid copying directories
**Problem**
Directory copying is showing up as performance hot spots.

**Solution**
This avoid copying classes or resources.
2025-11-17 05:25:59 -05:00
Aleksandra Zdrojowa 8770ad9de8 trigger an additional reload only if it's a ConsoleChannel, an interactive NetworkChannel, or a NetworkChannel where the exec ID is known, to ensure the response can be propagated correctly #8371 2025-11-17 11:16:07 +01:00
Aleksandra Zdrojowa 5d42dd65c8 filter out `bspReload` to avoid triggering an additional reload if bspReload is in the remaining commands #8371 2025-11-17 10:19:45 +01:00
Eugene Yokota d0ae314748 scalaEarlyVersion setting and source directories
**Problem**
During the milestone releases of Scala, e.g. Scala 2.13.0-M1,
scalaBinaryVersion by design points to 2.13.0-M1,
and also the source directory uses scala-2.13.0-M1,
but in most cases we actually want to pretend compatibility
and use scala-2.13 directory.

**Solution**
This introduces a new setting called scalaEarlyVersion,
which is the scalaBinaryVersion of the release version of milestones.
We have been calling this "partial version", but that broke
down for Scala 3, which adopted semantic versioning.
2025-11-16 18:02:17 -05:00
Eugene Yokota 6daa99b2db fix: Parse with -Xsource:3
**Problem**
On IntelliJ the users are getting the hint to upgrade to -Xsource:3
style, however the supported syntax do not parse.

**Solution**
This adds -Xsource:3 to the parser. The metabuild compilation uses
-Xsource:3 since sbt 1.6.0.
2025-11-14 00:51:28 -05:00
Eugene Yokota 8023eeee20 perf: Cache Zinc Analysis across compilation
**Problem**
Protobuf reading shows up as one of the bottlenecks during no-op compilation.

**Solution**
This adds a local, in-memory cache of Zinc Analysis using the timestamp
and the file size of the persisted protobuf file.
2025-11-12 02:35:18 -05:00
Eugene Yokota 4265b92aa4 perf: Cache content hash of binary files
**Problem**
sha256 is currently a bottleneck for no-op compilation.

**Solution**
This adds a local, in-memory cache of sha256 hashes of binary files
using their timestamp and file size.
The size of the digest cache can be configured using localDigestCacheByteSize,
which is set to 1MB by default.
2025-11-11 15:59:42 -05:00
Eugene Yokota 1254bd33e5 Use internal config for dependency tree (for Provided)
**Problem**
dependency-tree currently doesn't include Provided configuration,
because technically it isn't part of the Compile configuration,
however, Provided does become part of the Compile classpath during compilation.

**Solution**
This changes the implementation to use the internal configuration,
e.g. CompileInternal, which includes the auxilary configurations.

There's a tradeoff here since it means that we lose the tree view of
the platonic Compile configuration.
2025-11-08 14:33:47 -05:00