Commit Graph

18120 Commits

Author SHA1 Message Date
Yannick Heiber ca20f68a14
[2.x] Optimize incremental test further (#9364)
This applies a range of optimisations local to ClassStamper that bring the time needed for refinedTestDigests down to acceptable levels (see #9108):
* Cache the digests of transitive dependencies (big impact)
* Avoid sorting of digest subsets that would later get sorted again (small)
* Pre-compute which Analysis instances are required for each class to avoid repeated scanning of the whole list (medium)
* Merge two loops on relations.externalDeps into one (small)
* Compute the set of extra digests outside loop (small)
* Track the digest closure of each test via a BitSet (big)
2026-06-28 15:20:08 -04:00
eugene yokota 0ef972706c
[2.x] fix: Fixes global plugin loading (#9391)
**Problem**
Global plugin loading doesn't work.

**Solution**
1. Use ModuleID from to supply the location of global-plugin module.
2. Update pluginData with the global plugin classpath.
2026-06-28 14:57:18 -04:00
Matt Dziuban 3d99cffd5a
[2.x] Improve performance of `ClassStamper` (#9253)
- Use Builders to avoid building intermediate collections
- Use a mutable.Set for alreadySeen
- Use plain Set instead of SortedSet
  - Sorting only needs to happen at the end of the computation in transitiveStamp
2026-06-27 19:04:33 -04:00
eugene yokota af37f1f765
[2.x] Update Coursier to version 2.1.25-M26 (#9393)
Includes performance improvements.

https://github.com/coursier/coursier/compare/v2.1.25-M25...v2.1.25-M26

Co-authored-by: Jason Zaugg <jzaugg@gmail.com>
2026-06-27 16:36:14 -04:00
eugene yokota 3dd7c92979
[2.x] Add devcontainer (#9392) 2026-06-27 15:21:49 -04:00
Merlin Hughes aa0cb95c48
[2.x] fix: Constrain job id parser to signed longs (#9353)
Job ids are long. The job id parser currently uses NotSpace to parse the ids, which fails with a NumberFormatException for short non-numeric values and OOMs SBT for long non-numeric values.
2026-06-27 00:15:43 -04:00
eugene yokota b1392daa60
[2.x] test: Refactor global plugin test (#9380) 2026-06-27 00:13:54 -04:00
eugene yokota 128697c73b
[2.x] ci: Modify bug report template for custom labels (#9384)
Updated bug report template to allow custom labels.
2026-06-27 00:13:34 -04:00
kenji yoshida 1e4fcd66b6
Update versions in TemplateCommandUtil (#9388) 2026-06-27 00:12:41 -04:00
kenji yoshida 22df8d9d49
[2.x] test: Enable scala-js tests (#9387) 2026-06-27 00:11:46 -04:00
Anatolii Kmetiuk 4ed16c96ce
[2.x] Fix publishDiagnostics propagation (#9376)
**Problem**
Test is based on https://github.com/sbt/sbt/issues/9345#issuecomment-4718229113 which gives us the following sequence:

1. Metals sends buildTarget/compile.
2. sbt publishes real non-empty diagnostics.
3. Metals sends buildTarget/scalaMainClasses.
4. During that request, sbt emits build/publishDiagnostics with diagnostics: [] and reset: true.
5. The following build/taskFinish still reports errors: 1.

Previously, errors for diagnostics reporting via bsp were collected from a live compilation run. In the sequence above, that is triggered by buildTarget/compile. Then, buildTarget/scalaMainClasses does not trigger such a run for the second time, it uses the cached compilation result. Therefore, the diagnostics is not populated.

**Solution**
The proposed fix modifies sendFailureReport to accept an optional CompileFailed object that contains the diagnostics even in case the actual compiler did not run because the cached result was used. If no problems were found for a file via default means, this CompileFailed object is queried to see if it has any information about problems in a given file.
2026-06-26 12:36:42 -04:00
Anatolii Kmetiuk 4766e4370d
[2.x] fix: Fixes runner parsing build.properties with whitespaces (#9374)
Problem
When build.properties contains whitespaces like sbt.version = 1.12.12, parsing fails and the detected sbt version falls back to 2.0.0.

Solution
Trim whitespaces in build.properties.
2026-06-25 02:48:40 -04:00
Rikito Taniguchi 10f98e6c01
[2.x] Fix macro expand for HKT type arguments (#9377)
Def.setting and Def.task macro expansion looks for internal wrapper
call generated for .value.

It visits all function calls in the macro. If the block contains
functions call whose type parameter is HKT, macro expansion crashed.

Macro expansion tries to match IO against '[a], and failed with MatchError.

This commit adds wildcard pattern, and leave unmatched type arguments unchanged.
2026-06-24 21:22:11 -04:00
Merlin Hughes 7575c5a1be
[2.x] Suppress multiple main classes warning when running tests (#9372)
In a project with multiple main classes, the "multiple main classes detected" warning is unwanted noise when running tests. This message is already suppressed for explicit run commands, now also suppress it for test.
2026-06-24 02:03:13 -04:00
Anatolii Kmetiuk 3a37da86f3
[2.x] fix: Fixes dependency tree rendering on some libraries (#9371)
For the purposes of matching resolved dependencies to reverse-dependency entries, do not use dependency overrides to check equality.
2026-06-23 14:35:44 -04:00
Anatolii Kmetiuk 1d7b0d66c3
Fix #9358: preserve --allow-empty and --sbt-create in sbtArguments (#9370) 2026-06-23 15:03:21 +09:00
dependabot[bot] d5e9888db9
[2.x] ci: bump actions/checkout from 6 to 7 (#9366)
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-22 01:10:42 -04:00
eugene yokota f468735c9f
[2.x] sbtn 2.0.0-2932685e (#9363) 2026-06-21 14:41:45 -04:00
eugene yokota 2932685ed2
[2.x] ipcsocket 1.7.0 (#9361) 2026-06-21 01:31:40 -04:00
eugene yokota d8929ad8d7
[2.x] ci: sbt-salad-days (#9360) 2026-06-21 01:08:31 -04:00
kenji yoshida f3d1090350
[2.x] test: Update sbt.version in launcher-package/citest2 (#9357) 2026-06-19 22:11:30 -04:00
Jozef Koval 73d164fa84
[2.x] fix: Substitute [organisation] literally by defaulting Patterns.isMavenCompatible to false (#9344)
**Problem**

In an Ivy resolver pattern, the [organisation]/[organization] token has its dots rewritten to slashes (org.example → org/example), behaving like Ivy's [orgPath] token rather than being literal. Per the [Apache Ivy spec](http://ant.apache.org/ivy/history/latest-milestone/concept.html), [organisation] should be substituted literally and [orgPath] is the slash-separated form.

Root cause: Patterns.isMavenCompatible defaulted to true, which sbt forwards to Apache Ivy as setM2compatible(true); with m2-compatibility on, Ivy rewrites the [organisation] token to slash form. A user supplying a custom Ivy pattern (e.g. for an SFTP/SSH resolver) inherited that default and got the wrong paths, with no obvious indication why. The only workaround was the non-obvious withIsMavenCompatible(false).

**Solution**

Flip the default of Patterns.isMavenCompatible from true to false, so a hand-written Patterns keeps [organisation] literal by default — matching the Ivy spec.
2026-06-15 23:54:28 -04:00
kenji yoshida c33b795c78
[2.x] ci: Update version and ivy tests (#9342) 2026-06-15 12:28:14 -04:00
kenji yoshida 29f2c8648f
[2.x] ci: Update mimaPreviousArtifacts (#9341) 2026-06-15 12:26:58 -04:00
eugene yokota 183ed46375
[2.x] sbtn 2.0.0-f0d2fae4 (#9333) 2026-06-14 01:32:02 -04:00
BrianHotopp f0d2fae4d8
[2.x] feat: Resolve dependencies in parallel under the super shell (#9295)
Building on #9270 (which parallelized resolution in non-interactive runs by
narrowing the lm-coursier lock to only fire while coursier renders its
interactive progress bar), this makes `update` resolve in parallel under the
interactive super shell as well.

Count distinct non-checksum urls instead and drop the module claim.
Report the elapsed time of the current burst so the super shell renders
a live counter rather than a frozen "0s". Tests now encode coursier's
per-session call pattern.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 15:17:03 -04:00
eugene yokota bb981d7e02
[2.x] fix: Fixes console / javaOptions (#9322)
**Problem**
console / javaOptions is ignored.

**Solution**
1. This enables forked console even for sbt --server mode.
2. This includes console / javaOptions to the forkOptions.
2026-06-10 12:23:43 -04:00
kenji yoshida ad6c7a35a8
Update mimaPreviousArtifacts (#9308) 2026-06-09 14:21:18 -04:00
eugene yokota 75f1d15a81
[2.x] fix: Fixes chunked upload/download (#9318)
**Problem**
Chunked upload/download doesn't work.

**Solution**
1. This fixes the SERVICE_NAME shading.
2. This fixes the resource name.
3. This fixes download stream processing.
2026-06-09 21:48:07 +09:00
kenji yoshida 4950462abb
[2.x] Remove type ascription in Continuous (#9314) 2026-06-09 05:22:09 -04:00
kenji yoshida 5310381bb4
[2.x] Avoid dollars in name (#9313) 2026-06-08 23:39:10 -04:00
eugene yokota 81ecab120a
[2.x] fix: Fixes cross build caching (#9305)
**Problem**
We can get into a situation where CompileInputs2 become identical for Scala 3.x and 2.13, which breaks the recovery of Zinc analysis.

**Solution**
This includes Scala version into CompileInput2 to workaround this issue.
2026-06-07 23:49:02 -04:00
eugene yokota b9e98b9e8a
[2.x] Update to Scala 3.8.4 (#9302) 2026-06-07 20:52:13 -04:00
eugene yokota ac320c7fd0
[2.x] fix: ByteStream chunked upload/download (#9298)
**Problem**

BatchUpdateBlobsRequest suffers from gRPC's message size limitation.

**Solution**

For larger files, we switch to using the ByteStream API, chunked to 1MB at a time.
2026-06-07 15:17:20 -04:00
Ali Rashid 3b097cc3cc
[2.x] fix: Fixes publishing platform-specific artifacts (like Scala Native)
**Problem**
Platform suffix is absent in published artifacts.
#9118 partially solved this. It didn't touch publish-side naming though, so the published files still drop the suffix in three places.

**Solution**
This fixes
- ivyless publication names - CoursierArtifactsTasks.coursierPublicationsTask
- ivyless POM <artifactId> (the coordinate written inside the .pom) - PomGenerator.crossVersionDep
- Ivy backend (useIvy := true) - CrossVersion.substituteCross via IvyActions
2026-06-03 21:07:02 -04:00
kenji yoshida e27f3df021
[2.x] ci: Remove duplicate scalaVersion setting (#9297) 2026-06-03 10:40:44 -04:00
kenji yoshida 7b73bd1f44
Update mima setting (#9294) 2026-06-01 23:26:07 -04:00
eugene yokota fcd247e7c6
[2.x] fix: Avoid updateFull (#9290)
**Problem**
updateFull is called in no-op compile.

**Solution**
Avoid it for the default dependency mode.
2026-06-01 07:00:21 -04:00
eugene yokota 25cb2f3e60
[2.x] fix: Add warning about trainsient key (#9288)
**Problem**
Transient key is silently excluded from caching.

**Solution**
Add a warning.
2026-06-01 06:29:44 -04:00
eugene yokota b34323c39e
Merge pull request #9282 from eed3si9n/wip/bump-sjsonnew
[2.x] sjson-new 0.15.0 + Contraband 0.9.0
2026-06-01 02:20:16 -04:00
eugene yokota 619e034ec9
[2.x] perf: Improve incremental test stamper (#9257)
**Problem**
Incremental stamper is still causing perf issue.

**Solution**
This further avoids SHA-256 calls to calculate the stamp.
2026-06-01 02:17:39 -04:00
Eugene Yokota f327ef14d0 [2.x] sjson-new 0.15.0 2026-06-01 01:52:50 -04:00
Eugene Yokota c1219702d5 Contraband 0.9.0 2026-06-01 01:52:50 -04:00
eugene yokota 5dd886e243
Merge pull request #9278 from eed3si9n/wip/access
[2.x] Reimplement FarmHash
2026-05-31 18:19:28 -04:00
Eugene Yokota 0bab2066df [2.x] Reimplement FarmHash
**Problem**
sbtn and server uses FarmHash.

**Solution**
This reimplements FarmHash using Scala.
2026-05-31 16:07:28 -04:00
Eugene Yokota e8a358373c Refactor VarHandle to Access typeclass 2026-05-31 16:07:28 -04:00
eugene yokota 315202181c
[2.x] ci: Scalafmt 3.11.1 (#9279)
Apply Scalafmt
2026-05-31 16:01:15 -04:00
kenji yoshida 7b0c87b7c0
[2.x] fix: Fixes backtick-quoted project handling (#9277) 2026-05-30 22:09:46 -04:00
BrianHotopp d4f54fd5b6
[2.x] fix: Report a missing input file clearly instead of an opaque SerializationException (#9271)
When a file referenced by a task's inputs/outputs (e.g. Compile / resources +=
file("nope.txt")) does not exist, hashing the task's cache key threw a
NoSuchFileException deep inside sjsonnew serialization. It surfaced as an opaque
sjsonnew.SerializationException that dumped the entire input list, with the real
cause buried several `Caused by:` levels down, so users routinely mistook it for
a corrupt cache and reached for `clean`.

ActionCache.mkInput now catches the hashing failure, detects a NoSuchFileException
anywhere in the cause chain (ActionCache.findMissingFile), and throws a
MessageOnlyException naming the file:

    [error] file referenced by the build does not exist: nope.txt

util-cache gains a dependency on util-control (a leaf module, no cycle) for
MessageOnlyException.

Fixes #9217.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 19:29:41 -04:00
eugene yokota ffa8c14ca6
[2.x] Migrate FarmHash usage to xxhash64 (#9267)
Problem
ZAHa, which we use for FarmHash, uses Unsafe.

Solution
This ports xxhash64 to Scala.
2026-05-30 19:14:53 -04:00