Commit Graph

17617 Commits

Author SHA1 Message Date
kenji yoshida bc32efbea6
refactor: Add parentheses to PathFinder.get (#8497) 2026-01-12 15:19:40 -05:00
kenji yoshida 0fa17f7705
Update sbt plugins (#8496) 2026-01-12 15:19:07 -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 88812f27a3
Merge pull request #8494 from calm329/fix/8442-server-subprocess-hang-linux
[2.x] fix: Prevent server subprocess hang on Linux (#8442)
2026-01-12 00:50:42 -05:00
calm329 476730aba2 fix: Prevent server subprocess hang on Linux (#8442) 2026-01-11 21:00:57 -08:00
calm e7323171a2
fix: Handle relocated dependencies in dependencyTree (#8400) (#8489) 2026-01-11 21:27:11 -05:00
MkDev11 21b5c3b8df
[2.x] fix: Fix snapshot sbt version invalidation 7713 (#8486)
When using a SNAPSHOT version of sbt, if the sbt jars are republished
with breaking binary changes, the build definition should be recompiled.
Previously, the cache key only considered the source content, not the
classpath, causing NoSuchMethodError when cached classes referenced
methods that no longer exist.

This fix includes a hash of SNAPSHOT and -bin- jars (including their
modification times) in the cache key. When these jars change, the build
definition is recompiled.

Fixes #7713
2026-01-11 21:01:05 -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
xuwei-k d3f7f6bf90 Add test for 8458 2026-01-12 10:03:00 +09:00
byteforge bd03184cf5
[2.x] Fix ProjectMatrix invalid project ID with CrossVersion.full (#8484)
When using `ProjectMatrix` with `CrossVersion.full` and Scala 2 versions like `2.13.18`, the project ID incorrectly became `$1$2_13_18` instead of `foo2_13_18`.

**Root cause:** The Scala 3 compiler creates synthetic intermediate vals (e.g., `$1`) during macro expansion. The `enclosingTerm` function in the macros was stopping at these synthetic symbols instead of continuing up the symbol tree to find the actual val name.

**Fix:** Added `Flags.Synthetic` check to skip compiler-generated symbols in:
- `main-settings/src/main/scala/sbt/std/KeyMacro.scala`
- `lm-core/src/main/scala/sbt/librarymanagement/ConfigurationExtra.scala`

---------

Co-authored-by: byteforge38 <joseph.mc0803@gmail.com>
2026-01-11 19:17:26 -05:00
xuwei-k 813078695f Avoid deprecated java.net.URL constructor
- https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/net/URL.html#%3Cinit%3E(java.lang.String)
- https://bugs.openjdk.org/browse/JDK-8295949
2026-01-12 08:46:04 +09:00
MkDev11 4fba87a757
fix: Filter out JAR paths in BSP diagnostics on Windows (#8482)
When Java compiler generates warnings about missing annotations from
JAR files, the path format is jar:file:///C:/... which causes
InvalidPathException on Windows due to the : character.

The fix filters out jar: paths in toDocument(), similar to how fake
positions like <macro> are already filtered out. This prevents the
exception and allows compilation to continue.

Diagnostics for files inside JARs are not shown in the IDE, which is
correct behavior since they cannot be edited.

Fixes #7665

Generated-by: Cascade (AI pair programmer)
2026-01-11 16:37:13 -05:00
eugene yokota 61899ecd16
ci: Use slash syntax in build.sbt (#8481) 2026-01-11 15:46:00 -05:00
eugene yokota 697e32e496
[2.x] docs: Minor tweaks to the docs (#8480) 2026-01-11 15:08:20 -05:00
MkDev11 985cf94bb7
fix: Only disable symlinks when truly not supported (#8479) 2026-01-11 13:04:37 -05:00
kenji yoshida 113b6eb103
Use SAM-conversion if possible (#8477) 2026-01-11 07:21:28 -05:00
kenji yoshida 2338d5f4ee
Fix scaladoc (#8476) 2026-01-11 07:20:40 -05:00
kenji yoshida 072181499a
Fix BuildServerTest (#8475) 2026-01-11 07:20:10 -05:00
MkDev11 db06acb31e
test: Migrate CacheSpec to verify.BasicTestSuite (#8474)
Migrate CacheSpec from ScalaTest AnyFlatSpec to verify.BasicTestSuite
following the project's test framework standardization.

Changes:
- Convert class to object extending BasicTestSuite
- Replace ScalaTest 'should/in' syntax with test() method
- Replace fail() with assert(false, message)
- Replace === with ==
- Use Scala 3 indentation-based syntax
- Remove ScalaTest import, add verify.BasicTestSuite import

All tests pass successfully.

Fixes #8466

Generated-by: Cascade (AI pair programmer)
2026-01-11 07:19:22 -05:00
MkDev11 bbeeb25422
[2.x] fix: Upgrade launcher-package to sbt 1.10.7 and replace dispatch-http (#8465)
Fixes #7826

Changes:
- Upgrade sbt version from 0.13.18 to 1.10.7 in launcher-package/project/build.properties
- Remove dead dispatch-http 0.8.10 dependency from plugins.sbt
- Update sbt-native-packager from 1.7.6 to 1.10.4 (com.github.sbt)
- Update sbt-pgp from 2.1.2 to 2.3.1
- Replace all dispatch.classic._ HTTP calls with Java URL.openStream()

The dispatch-http library is dead and doesn't support sbt 1.x. This change
uses standard Java networking APIs for HTTP downloads, eliminating the
dependency on outdated libraries.

All HTTP download operations now use:
- java.net.URL.openConnection()
- InputStream with buffered reading
- Proper resource cleanup with try-finally blocks

- Removes the sbt-export-repo plugin dependency
- Defines exportRepo and exportRepoDirectory settings locally
- Removes ExportRepoPlugin from dist project
- Fixes exportRepo task to not reference itself

* fix: Update PackageSignerPlugin.scala for sbt 1.x compatibility
- Use withExtension instead of copy(extension = ...) for Artifact
- Update Classpaths.publishConfig to use sbt 1.x signature with all required parameters
- Use new slash syntax for scoped keys (pgpSigner / skip instead of skip in pgpSigner)

* fix: Use computed status instead of status key in PackageSignerPlugin

* fix: Use withRevision instead of copy for ModuleID in build.sbt

- Add scala.sys.process._ import for shell command execution (! method)
- Fix resolvers setting to use new slash syntax and proper Option handling
- Fix publish/publishLocal to use {} instead of () to avoid deprecation warning
- Fix Classpaths.publishTask to use variant without delivery key (deprecated since 1.1.1)
- Add scala.sys.process._ import for shell command execution
- Fix publish/publishLocal to use {} instead of ()
- Remove problematic resolvers setting that caused task/setting dependency issues
- Use IvyActions.publish directly instead of deprecated Classpaths.publishTask
- Fix ModuleID.copy to use withRevision
- Fix Artifact.copy to use withExtension
- Use computed status value instead of status key

Build now compiles successfully with sbt 1.10.7.
2026-01-11 07:17:24 -05:00
eugene yokota 877ea0435c
Merge pull request #8473 from sbt/eed3si9n-patch-1
Fix typo in link to CONTRIBUTING.md
2026-01-11 03:57:26 -05:00
eugene yokota 39a5c804ed
Fix typo in link to CONTRIBUTING.md 2026-01-11 03:57:14 -05:00
eugene yokota 4c88d27397
Merge pull request #8472 from eed3si9n/wip/contributing-docs
[2.x] docs: Contributor's Guide
2026-01-11 03:54:57 -05:00
eugene yokota d7fde4d376
Merge pull request #8456 from tellorian/fix/8429-actioncache-symlink-optimization
[2.x] Fix #8429: Add symlink optimization to ActionCache.get
2026-01-11 03:40:54 -05:00
Eugene Yokota 51638d342c docs: Contributor's Guide
**Problem**
We probably need some guidance on contributions.

**Solution**
Here's a contributor guide.
2026-01-11 03:24:30 -05:00
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
eugene yokota 2b819e24d1
Merge pull request #8470 from xuwei-k/String-toString
[2.x] refactor: Remove redundant `String#toString`
2026-01-11 03:17:57 -05:00
eugene yokota 4ff1d77e26
Merge pull request #8469 from xuwei-k/redundant-asInstanceOf
[2.x] Remove redundant `asInstanceOf`
2026-01-11 03:16:56 -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 3015bab1d7 Remove redundant asInstanceOf 2026-01-11 16:43:17 +09:00
xuwei-k c0fe4dfb10 Add tailrec annotation 2026-01-11 16:33:45 +09:00
eugene yokota 4bee8747e9
Merge pull request #8463 from MkDev11/fix/dependency-overrides-ivy-7951
[2.x] Fix #7951: Apply dependencyOverrides to delivered Ivy XML
2026-01-10 21:09:09 -05:00
tellorian d63191bb16
Merge branch 'develop' into fix/8429-actioncache-symlink-optimization 2026-01-11 09:39:49 +09:00
mkdev11 7389f1e059 Merge develop and resolve conflicts 2026-01-11 01:45:38 +02:00
mkdev11 e63a4b8f8c Refactor applyDependencyOverrides into testable function 2026-01-11 01:40:51 +02:00
eugene yokota 9ba3966ad2
Merge pull request #8460 from MkDev11/fix/gc-monitor-warning-8002
[2.x] fix: Improve GCMonitor warning message clarity
2026-01-10 16:24:01 -05:00
MkDev11 9475f278b5
Merge branch 'develop' into fix/dependency-overrides-ivy-7951 2026-01-10 12:51:54 -08:00
mkdev11 a9ffa59baf Fix #7951: Apply dependencyOverrides to delivered Ivy XML
Post-process the delivered Ivy XML file to apply dependency overrides.
This is necessary because Ivy's deliver() method doesn't automatically
apply DependencyDescriptorMediators when writing the XML.

The fix:
- Adds applyOverridesToDeliveredIvy() method in IvyActions
- Reads the delivered Ivy XML and transforms dependency elements
- Updates rev attributes for dependencies that have overrides
- Ensures consistency between Maven POM and Ivy XML publishing

Added unit tests to verify:
- Overrides are correctly applied to matching dependencies
- All other attributes are preserved
- Non-matching dependencies remain unchanged
2026-01-10 22:44:57 +02: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
eugene yokota 4609b62d87
Merge pull request #8459 from eed3si9n/wip/consoleproject
[2.x] Make some consoleProject progress
2026-01-10 14:08:57 -05: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
john0030710 3abddf461a Fix side-effect file syncing when using symlink optimization
- Ensure output files are synced even when reading from symlink
- Call findActionResult to get ActionResult for side-effect files
- Maintains performance benefit while ensuring correctness
- Addresses @eed3si9n's concern about tasks generating files on the side
2026-01-10 00:25:59 +01:00
john0030710 08fe019dc0 Use proper exception handling with Exception.nonFatalCatch.opt
- Replace try-catch with Exception.nonFatalCatch.opt for cleaner code
- Follows Scala best practices for non-fatal exception handling
- More functional and idiomatic approach
- Avoids catching fatal exceptions like VirtualMachineError
2026-01-10 00:23:05 +01:00
john0030710 6a63565b0e Improve symlink optimization using FileConverter
- Use config.fileConverter.toPath() instead of string manipulation
- Avoid hardcoded '/' prefix removal
- More robust and maintainable approach
- Fix IO.read() to include UTF-8 charset parameter
2026-01-10 00:20:32 +01:00