Commit Graph

17980 Commits

Author SHA1 Message Date
Eugene Yokota bd44b836c1 sbt 2.0.2 2026-07-12 23:54:12 -04:00
eugene yokota 6207378a49
Merge pull request #9446 from eed3si9n/bport2/mix2
[2.0.x] Backports
2026-07-12 23:03:33 -04:00
Anatolii Kmetiuk c1b289c934 [2.0.x] fix sjson downgrade (#9426)
Extend metabuild exclusion to all sbt-provided deps.
2026-07-12 22:28:37 -04:00
Anatolii Kmetiuk e00efb9d9c [2.x] Fix ivyless sbt plugin publish cross paths (#9416)
Problem:
When useIvy := false, ivyless publishing dropped the optional
scala_[scalaVersion]/ and sbt_[sbtVersion]/ path segments from Ivy-style
plugin publish patterns. This caused sbt 1 plugins published from sbt 2 builds
to land under non-plugin Ivy paths, so consumers looking under
scala_2.12/sbt_1.0/ could not resolve them.

Solution:
Read the plugin cross-version attributes from the CsrProject module and use
them when constructing ivyless Ivy-layout publish paths. Apply the same
substitution for local/file Ivy publishing and remote Ivy-style URL publishing,
while continuing to omit those optional segments when the attributes are absent.
Add scripted regressions for local and HTTP Ivy-style publishing of an sbt 1
plugin with useIvy := false.
2026-07-12 22:28:10 -04:00
eugene yokota f80e2c38c8
Merge pull request #9445 from eed3si9n/bport2/mix
[2.0.x] Backports
2026-07-12 21:50:11 -04:00
eugene yokota 03425046b4
[2.0.x] sbtn 2.0.0-b4d628dd (#9444) 2026-07-12 21:42:56 -04:00
eugene yokota 33a217ae6a [2.0.x] fix: Fixes shutdownall (#9435)
**Problem**
sbt shutdown all requires --server.

**Solution**
Fix it so it doesn't need extra flag.
2026-07-12 21:28:38 -04:00
Anatolii Kmetiuk 7d77f44cdc Fix #9343 route pipelined dependencyPicklePath through internalDependencyPicklePath (#9425) 2026-07-12 21:28:14 -04:00
BrianHotopp b5ecb37ae7 [2.x] fix: Discard a cancelled task's output backlog on cancel (#9411)
A task that floods stdout could not be stopped promptly: cancelling it
(Ctrl+C from the thin client) stopped the task, but the server kept
draining the already-queued output to the client for several seconds,
because onCancellationRequest never discarded the pending backlog.

onCancellationRequest now sets a per-channel isCanceled flag and clears the
queued frames and buffered stdout (discardPending), and jsonRpcNotify
drops the cancelled task's systemOut/systemErr while the flag is set, so
output stops promptly.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 21:27:57 -04:00
eugene yokota b61b778aff
[2.0.x] scala-dyn-version working again (#9440) 2026-07-12 12:04:34 -04:00
eugene yokota 13f584e2e4
[2.0.x] ipcsocket 1.8.0 (#9436) 2026-07-11 16:03:12 -04:00
eugene yokota 1125129bce
[2.0.x] Support given in build.sbt (#9432)
Co-authored-by: xuwei-k <6b656e6a69@gmail.com>
2026-07-11 14:30:27 -04:00
eugene yokota 35e99d27c1
[2.0.x] fix: apply ByteStream deadline per-call, not on the memoized stub (#9413) (#9431)
The byteStreamStub lazy val applied withDeadlineAfter once, baking in an
absolute deadline that was reused for the store's whole (session-long)
lifetime. remoteTimeoutInSec after the first blob transfer, every later
ByteStream read/write was rejected with DEADLINE_EXCEEDED, so the remote
cache could neither upload nor download blobs >chunkSizeBytes for the rest
of the sbt server's life.

Derive a fresh stub with the deadline per RPC so each call gets its own
relative timeout.

Co-authored-by: Yannick Heiber <yhe@famly.co>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-11 13:58:24 -04:00
eugene yokota 3c350df583
[2.0.x] Tweak server startup message (#9430)
**Problem/Solution**
sbt 2.x uses client-server by default.
This makes the message a bit more obvious when the build is using a client.
2026-07-11 13:28:07 -04:00
eugene yokota 80f768225e
[2.0.x] ivy 2.3.0-sbt-939a7ea82f140cdb1f51dc404bb43e00a8c43b83 (#9424) 2026-07-11 00:37:04 -04:00
eugene yokota 1bfb971e2d
[2.0.x] fix: Keep the output-flush timer alive across forceFlush (#9422)
NetworkChannel batches writes to the client at most once per 20ms to
reduce terminal flicker and byte volume. forceFlush(), used to order
buffered stdout ahead of a control-plane message, called
flushExecutor.shutdownNow() -- the only place the executor was ever
shut down. Once it ran during active output it tore the executor
down (and, if a coalesced flush was pending, cancelled its future
without resetting flushFuture, leaving the slot stuck), so the 20ms
coalescing was gone for the rest of the connection: stdout was then
flushed per write via the inline fallback instead of batched. Output
still reaches the client, so the effect is extra flushes rather than
lost output, but shutting the shared executor down on the first
forceFlush is clearly unintended.

Extract the flush state machine into CoalescingFlusher. forceFlush now
drains immediately and leaves the timer live (a pending coalesced
drain harmlessly drains the remainder when it fires); the executor is
shut down once, at channel teardown, so it no longer leaks. doFlush
now holds a lock across both the drain and the publish so an inline
forceFlush and the timer's drain can't deliver two stdout batches out
of order.

Fixes #9415

Co-authored-by: BrianHotopp <brihoto@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 16:05:25 -04:00
eugene yokota 0905578abf
Merge pull request #9421 from eed3si9n/bport2/url
[2.0.x] Backport url(...) deprecation
2026-07-10 20:13:55 +02:00
Eugene Yokota a690492a62 [2.0.x] Mark project/scala-dyn-version as pending
Scala 3.9.0-RC2 is missing scala3-directives-parser_3.
2026-07-10 12:58:13 -04:00
Eugene Yokota be3a396853 [2.0.x] Deprecate Resolver.url
This adds Resolver.uri instead.
2026-07-10 12:57:55 -04:00
Eugene Yokota 8bac5b9a82 [2.x] Deprecate url(...)
**Problem**
In sbt 2.x url already reaturns URI, but it's somewhat confusing.

**Solution**
Deprecate it instead.
2026-07-10 12:56:32 -04:00
Eugene Yokota b426b50dbb sbt 2.0.1 2026-06-28 23:29:14 -04:00
eugene yokota 05ad82ceaa
[2.0.x] deps: Zinc 2.0.1 (#9399) 2026-06-28 22:53:52 -04:00
eugene yokota 4813187525
[2.0.x] sbtn 2.0.0-69fa1968 (#9398) 2026-06-28 22:20:38 -04:00
eugene yokota 6180b34279
Merge pull request #9397 from eed3si9n/bport2/mix2
[2.0.x] backports
2026-06-28 21:09:26 -04:00
Eugene Yokota 93ec7cbe4c Fix mima 2026-06-28 20:44:32 -04:00
Yannick Heiber 27b659d584 [2.0.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 20:29:23 -04:00
eugene yokota a9741aaae8 [2.0.x] fix: Fixes sbt runner openbsd support (#9394)
**Problem**
sbt runner script defaults to sbtn, even on the operating system
where sbtn is not available.

**Solution**
This fallbacks to the jvm client.
2026-06-28 20:28:25 -04:00
eugene yokota fcb37b9c7b [2.0.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 20:21:28 -04:00
eugene yokota a566515aa7 [2.x] test: Refactor global plugin test (#9380) 2026-06-28 20:08:51 -04:00
eugene yokota ddbfe9702e
[2.0.x] Improve performance of `ClassStamper` (#9396)
- 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

Co-authored-by: Matt Dziuban <mrdziuban@gmail.com>
2026-06-27 19:38:01 -04:00
eugene yokota 032989f19f
Merge pull request #9395 from eed3si9n/bport2/mix
[2.0.x] backports
2026-06-27 19:23:33 -04:00
Rikito Taniguchi b51674eca0 [2.0.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-27 18:54:50 -04:00
Anatolii Kmetiuk 36aa899474 [2.0.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-27 18:53:40 -04:00
Anatolii Kmetiuk e3ceea5722 [2.0.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-27 18:24:38 -04:00
Anatolii Kmetiuk 9f09522381 Fix #9358: preserve --allow-empty and --sbt-create in sbtArguments (#9370) 2026-06-27 18:16:11 -04:00
Jason Zaugg fa6a25ab60
[2.0.x] Update Coursier to version 2.1.25-M26 (#9382)
Includes performance improvements.

https://github.com/coursier/coursier/compare/v2.1.25-M25...v2.1.25-M26
2026-06-27 16:36:42 -04:00
eugene yokota 197097f0b6
[2.0.x] ci: sbt-salad-days (#9362) 2026-06-21 01:53:34 -04:00
Eugene Yokota 5ed34be48c Update builtin_sbt_version to 2.0.0 2026-06-14 19:02:22 -04:00
eugene yokota 8944ae2741
[2.0.x] Zinc 2.0.0 (#9336) 2026-06-14 18:30:46 -04:00
eugene yokota 5779f24d7e
[2.0.x] sbtn 2.0.0-f0d2fae4 (#9333) (#9335) 2026-06-14 15:57:48 -04:00
eugene yokota 5f52e52dbf
[2.0.x] perf: short-circuit --version from build.properties (#9332)
Avoid launching sbt just to render --version by reading sbt.version directly from project/build.properties in the shell script, batch script, and sbtw wrapper. Tighten launcher integration assertions to verify version output no longer depends on the sbtVersion command output.

Co-authored-by: bitloi <89318445+bitloi@users.noreply.github.com>
2026-06-14 00:27:14 -04:00
eugene yokota de1b5ee9ea
[2.x] fix: Fixes console / javaOptions (#9324)
**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 21:23:11 -04:00
eugene yokota aacd98231d
[2.0.x] fix: Fixes chunked upload/download (#9318) (#9323)
**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-10 01:52:17 -04:00
Anatolii Kmetiuk 743fe18f46
[2.x] fix: Fix FileAlreadyExistsException in packageDirectory (#9315)
**Problem**
Intermittent java.nio.file.FileAlreadyExistsException when publishing
classes.sbtdir.zip during action-cache packaging under parallel tasks
(#9043). Copying from a temp directory straight into the final path races
on the fixed destination name.

**Solution**
Stage the built zip next to the destination with a unique temp file, then
replace the final path via Files.move with REPLACE_EXISTING and ATOMIC_MOVE,
falling back to a non-atomic move when needed. Add a concurrent
packageDirectory test.

Closes #9043

Generated-by: Cursor (AI-assisted)

Co-authored-by: bitloi <89318445+bitloi@users.noreply.github.com>
2026-06-08 23:37:56 -04:00
eugene yokota f94f987f1d
[2.0.x] fix: Fixes cross build caching (#9306)
**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:50:35 -04:00
eugene yokota 8519ebb559
[2.0.x] Update to Scala 3.8.4 (#9304) 2026-06-07 22:38:49 -04:00
eugene yokota 65a38f0fb8
[2.0.x] fix: Fixes publishing platform-specific artifacts (like Scala Native) (#9303)
**Problem**
Platform suffix is absent in published artifacts.

**Solution**
This fixes
- Ivy backend (useIvy := true) - CrossVersion.substituteCross via IvyActions

Co-authored-by: Ali Rashid <ali@shuwari.africa>
2026-06-07 21:16:14 -04:00
eugene yokota 06d7047003
[2.0.x] fix: ByteStream chunked upload/download (#9298) (#9301)
**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:47:38 -04:00
eugene yokota aae1a980fa
Merge pull request #9291 from eed3si9n/bport2/avoid-update-full 2026-06-01 10:45:55 -04:00
eugene yokota e16d4b2441
[2.0.x] fix: Add warning about trainsient key (#9289)
**Problem**
Transient key is silently excluded from caching.

**Solution**
Add a warning.
2026-06-01 07:20:04 -04:00