Commit Graph

1223 Commits

Author SHA1 Message Date
eugene yokota 4d7e0633a8
Revert "[2.x] feat: Enable musl static linking for sbtn on JDK 17+ (#8464)" (#8557)
This reverts commit e16298521b.
2026-01-16 00:06:28 -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
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
MkDev11 81b6408f49
[2.x] feat: Add csrLocalArtifactsShouldBeCached setting for caching local artifacts (#8504)
This adds a new setting  that allows users to
configure Coursier's FileCache to cache local file:// artifacts. When enabled,
artifacts from local repositories are copied to the cache directory, which is
useful for scenarios like bundling compiler artifacts in a local repo for
offline use.

Fixes #7547
2026-01-12 19:17:55 -05:00
kenji yoshida 56c86a1684
[2.x] Delete TrapExitSecurityException (#8503) 2026-01-12 19:11:35 -05:00
MkDev11 add43bd230
feat: Set terminal window title when running applications (#8492)
Set window title to 'sbt <command>: <org> % <name> % <version>' when
running sbt run, runMain, bgRun, or bgRunMain.

For server-side runs, window title is set directly. For client-side runs (sbtn), window title is passed via RunInfo protocol
and set by NetworkClient.

Fixes #7586
2026-01-12 02:32:52 -05:00
MkDev11 0ec500392f
[2.x] ci: Handle undefined crossScalaVersions in publishLocalAllModule (#8491)
The publishLocalAllModule command fails with 'crossScalaVersions is
undefined' when the zinc submodule's compilerBridge project doesn't
have crossScalaVersions defined.

This is a long-standing issue that was reported in #4387 (2018) and
'magically resolved' when zinc happened to define the setting, then
resurfaced in #7607 (2024) when zinc changed.

The fix uses getOpt().getOrElse(Nil).toList instead of get().toList
to handle the case where crossScalaVersions is not defined, allowing
the command to proceed gracefully.

Fixes #7607
2026-01-12 01:42:39 -05:00
eugene yokota 4606c90f69
[2.x] ci: Integrate launcher package (#8485)
**Problem/Solution**
This is a follow up to launcher package migrating to sbt 1.x.
This joins the launcher package into the main build.
2026-01-11 20:57:59 -05:00
xuwei-k e5d05ca584 Update mimaPreviousArtifacts and mimaBinaryIssueFilters 2026-01-12 10:31:21 +09: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
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
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 c20d83a8e2 Use TCP for the fork test
**Problem**
Forked test currently uses stdio, but that println to be lost.

**Solution**
Use TCP for communication similar to sbt 1.x.
2026-01-04 01:48:45 -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 a9e38e3a1c [2.x] fix: Resolver.combineDefaultResolvers
**Problem**
combineDefaultResolvers loses information.

**Solution**
This fixes it.
2025-12-25 01:49:57 -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 9888aae7fa [2.x] Switch to using shaded-gson
Fixes https://github.com/sbt/sbt/issues/8334
2025-12-15 03:17:33 -05:00
Anatolii Kmetiuk e78d54af50 Bump RC to RC8-bin-SNAPSHOT 2025-12-10 11:37:25 +09:00
xuwei-k 70960744e7 Scala 2.12.21 2025-12-09 17:28:03 +09:00
xuwei-k 97700a4b76 Update mima setting 2025-11-27 07:16:46 +09:00
eugene yokota b43b73c319
Merge branch 'develop' into wip/remove-old-remote 2025-11-25 02:34:16 -05: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 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 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 840b851445 [1.x] Add Scala 3.8 REPL support
**Problem**
Scala 3.8 REPL won't work since they've split the repl artifact into another JAR.

**Solution**
This works around it by creating a yet-another sandbox configuration ScalaReplTool
(similar to ScalaTool and ScalaDocTool) and a separate scalaInstance for
console task, so when Zinc is invoked we'll be able to conjure the right array of JARs.
2025-11-01 21:06:32 -04:00
xuwei-k 49c8306091 Update semanticdbVersion 2025-10-23 16:38:26 +09:00
Eugene Yokota 9d2a5f478b sbt 1.11.7 2025-10-05 14:57:23 -04:00
xuwei-k 4b9cac1212 cleanup build.sbt setting 2025-10-04 19:48:10 +09:00
xuwei-k 4b1b7091ab update mima settings 2025-09-29 17:31:05 +09:00
Eugene Yokota 8f2160ba43 Adjust tests 2025-09-29 00:31:24 -04:00
Eugene Yokota 763b05fd91 Update mima setting 2025-09-28 23:41:01 -04:00
Eugene Yokota 27e6342bea Update mima 2025-09-28 21:44:16 -04:00
Eugene Yokota d10f6ee54e fix: Set contrabandScala3enum to false 2025-09-28 21:28:06 -04:00
xuwei-k ecf6be6b6b update scalafmt config. re-format build files 2025-09-23 10:28:38 +09:00
xuwei-k 40c29e9599 update mima setting 2025-09-22 12:34:32 +09:00
Eugene Yokota 2fa3159f18 Update to Contraband 0.8.0 2025-09-19 00:46:34 -04:00
Eugene Yokota 64dcdafc07 Merge branch '1.11.x' into wip/merge-1.11.x 2025-09-17 23:35:59 -04:00
xuwei-k 8e1cebc8fc delete internal/ProjectMatrixReference.scala 2025-09-07 18:19:57 +09:00
Eugene Yokota 9186f23839 sbt 1.11.6 2025-09-06 18:42:39 -04:00
xuwei-k 708fffa290 delete unused "internal" package code 2025-09-06 19:41:12 +09:00
Eugene Yokota cbecbadd2c [1.x] Building sbtn locally for Aarch64 2025-09-02 01:32:19 -04:00
eugene yokota 9ead0ebfd5
Merge pull request #8253 from eed3si9n/wip/log4j
[2.x] Remove log4j
2025-08-30 23:50:12 -04:00
xuwei-k 27594f22cb remove scala-xml libraryDependencySchemes 2025-08-31 11:43:32 +09:00
Eugene Yokota 683a559b37 Remove log4j 2025-08-30 20:29:44 -04:00
xuwei-k 501e2e3aa3 remove typesafe ivy resolver 2025-08-31 08:16:44 +09:00
Eugene Yokota ff328a092d Improve sbtn a bit
1. Remove experimental warning.
2. Buffer the boot log so ANSI output is fixed for JVM client.
3. Remove timestamp.
2025-08-24 03:58:13 -04:00
xuwei-k 478f501395 remove scala-reflect dependency 2025-08-17 08:23:34 +09:00