Commit Graph

18075 Commits

Author SHA1 Message Date
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
Anatolii Kmetiuk c70b86d5c9
[2.x] Opt bspBuildTargetOutputPathsItem out of caching (#9272)
Opt bspBuildTargetOutputPathsItem out of caching
2026-05-30 00:10:05 +09:00
BrianHotopp 0ee7323110
[2.x] fix: Parallelize dependency resolution when no progress bar is rendered (#9270)
update held a process-global lock around coursier resolution and artifact
fetching whenever a logger was set OR coursier was not in fallback mode. That
lock exists only to serialize coursier's interactive progress bar, which is
rendered solely when no custom logger is supplied and coursier is not in
fallback mode. The loggerOpt.nonEmpty clause therefore over-serialized the
common non-interactive case (IntelliJ re-imports, CI, any non-TTY run, where
sbt supplies a quiet debug-only logger), making update scale with the number
of modules rather than the number of distinct artifacts.

Fixes #5508.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-28 15:31:38 -04:00
Anatolii Kmetiuk 4ca516fd5f
[2.x] Fix duplicate autoplugins packageBin mappings (#9255)
Deduplicate executable jar package entries. In the issue, the duplicate was something like:

(resource_managed/.../sbt/sbt.autoplugins, "sbt/sbt.autoplugins")
(classes/.../sbt/sbt.autoplugins,          "sbt/sbt.autoplugins")

This is because copyResources copied autoplugin metadata to the classes directory.

Solution: when composing the packageBinMappings, differentiate between artifacts that come from class directory and from outside of it. If there is a duplicate, prefer resource that comes from outside of it.
2026-05-28 12:19:40 -04:00
kenji yoshida 9583a97e89
[2.x] test: Add test for issue 2188 (#9264) 2026-05-24 16:46:07 -04:00
BrianHotopp 5e4d2744a1
[2.x] fix: Make custom-scala-org scripted test hermetic (#9260)
The original fixture pinned
  scalaOrganization := "io.github.scala-wasm"
  scalaVersion := "3.8.3-RC1-wasm-bin-SNAPSHOT"
and ran compile. The wasm fork never published a release of
scala3-library_3 -- only a snapshot to Sonatype's central-snapshots
repo, which has ~90-day retention. #8732 merged 2026-02-21; the
snapshot was GC'd ~2026-05-22 and develop CI began failing
deterministically.

Fixes #9259.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 14:18:40 -04:00
BrianHotopp b71319a153
[2.x] fix: Apply dependencyMode filtering to internal project deps (#9250)
Fixes #9009.

dependencyMode := DependencyMode.PlusOne strips every internal
project dependency from the compile classpath, even direct ones --
LibA/compile fails with Not found: CoreClass despite
LibA.dependsOn(Core). Direct mode happens to work today, but only by
accident (filterByDirectDeps matches against allDependencies, which
includes projectDependencies -- the bug surface is one step removed).

Root cause: ClasspathImpl.filterByPlusOne resolves the
direct-dep key set from UpdateReport, which only contains externally
resolved (LM) modules. Internal project refs never appear there, so
resolvedDirectKeys is empty for internal entries; plusOneKeys is
likewise empty; the final filter strips every internal classpath
entry whose moduleIDStr identifies an internal project. Diagnosis on
the issue by eureka0928.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 23:20:56 -04:00
Anatolii Kmetiuk 03965281df
Improve deprecation UX for watchSources (#9247) 2026-05-20 09:44:51 +09:00
Anatolii Kmetiuk 696626e195
[2.x] fix: Add regression test (#9246) 2026-05-19 10:57:23 -04:00
BrianHotopp 3eeac9deae
[2.x] fix: Collapse duplicate subtrees in dependency tree rendering (#9226)
Fixes #6886.

dependencyTree, dependencyBrowseTree, and inspect tree re-explore
the same node once per incoming edge. In a DAG with N levels and M
children per node the rendered output is O(M^N) -- the OP needed
>16 GB heap, #7360 has a 6 GB heap dump, and Friendseeker's analysis
on the issue showed the exponential re-traversal directly.

Fix: track a visited set across the renderer's recursion. The first
time a node is encountered it is rendered in full; on subsequent
visits the entry collapses to a one-line +- <id> (*) (ASCII) or a
<id> (*) leaf (JSON), matching Maven's dependency:tree (*)
convention. Cycle detection (separate parents set, (cycle) marker)
is unchanged.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 19:15:47 -04:00
kenji yoshida 536e676481
[2.x] refactor: format launcherPackageIntegrationTest (#9245) 2026-05-18 14:41:52 -04:00
kenji yoshida 96bb1848da
[2.x] Update mimaSettings (#9242) 2026-05-17 18:59:44 -04:00
eugene yokota 2488e973db
[2.x] Update sbtn to 2.0.0-RC14 for timeout fix (#9240) 2026-05-17 14:12:57 -04:00
eugene yokota df038e78a7
[2.x] fix: Catch timeout on sbtn exit (#9239)
**Problem**
sbtn tries to wait on a thread on exit, and times out.

**Solution**
Shorten the timeout and catch it.
2026-05-17 05:44:40 -04:00
eugene yokota 46f0b89642
[2.x] Add runner support for execution log (#9237)
**Problem/Solution**
This adds runner commandline option experimental_execution_log.
2026-05-17 03:01:12 -04:00
kenji yoshida 6a1222ad06
[2.x] fix: Remove explicit equals and hashCode in LabeledFunctions (#9228) 2026-05-16 23:57:41 -04:00
kenji yoshida f454c05fe1
[2.x] refactor: Use scala.util.Using.resource instead of try-finally (#9230) 2026-05-16 05:51:07 -04:00
eugene yokota ae87d1a196
Merge pull request #9232 from eed3si9n/wip/bump-coursier
[2.x] Update to lm-coursier 2.1.25-M25
2026-05-16 04:59:06 -04:00
Eugene Yokota f8504f2a4d Revert "[2.x] fix: Skip Conflict when dependency relocations form a cycle (#8919)"
This reverts commit b24ecddbd6.
2026-05-16 04:25:37 -04:00
Eugene Yokota ade9885ce6 [2.x] Update to lm-coursier 2.1.25-M25 2026-05-16 04:24:11 -04:00
kenji yoshida eabfe1b5e8
[2.x] optimize InterfaceUtil (#9223) 2026-05-16 04:15:40 -04:00
eugene yokota 57495c28dc
[2.x] fix: Include test arg into hash (#9222)
**Problem**
test -- foo passes on MUnit, allowing failing tests to be validated.

**Solution**
Include test args into the cache input.
2026-05-16 04:12:33 -04:00
BrianHotopp 68dde13fdc
[2.x] feat: Print cross-project test failure recap at end of aggregated run (#9214)
Fixes #2998

When test is run at the prompt in a multi-project build,
sbt aggregates <proj>/test across subprojects. Each subproject's
TestResultLogger emits its own pass/fail summary inline, but the
aggregation layer never restated which projects failed. The final
"sbt.TestsFailedException" line surfaced no project names or failing
test classes, so on CI users had to scrollback-grep through thousands
of log lines to find what broke.

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 15:41:39 -04:00
eugene yokota b3d29b6bac
[2.x] Zinc 2.0.0-M18 (#9219) 2026-05-14 23:50:10 -04:00
eugene yokota d27c6a46df
[2.x] fix: Invalidate on JDK version (#9216)
**Problem**
sbt 2.x caching doesn't invalidate on JDK version.

**Solution**
Invalidate on JDK version.
2026-05-14 03:13:16 -04:00
eugene yokota 7681cb3980
[2.x] feat: Execution log (#9203)
**Problem**
We need some tooling to debug caching issues.

**Solution**
This adds an exeprimental execution log support,
which shows input and output of cached tasks.
2026-05-14 02:27:38 -04:00
kenji yoshida 56cdef09f7
[2.x] refactor: Use InputStream.transferTo (#9212) 2026-05-14 00:36:20 -04:00
eugene yokota 4630ddfb38
Merge pull request #9211 from xuwei-k/nio-Files-readString 2026-05-13 13:12:45 -07:00
xuwei-k 04d9f36414 Use Files.readString instead of readAllBytes 2026-05-13 21:21:18 +09:00
kenji yoshida 00bd61d411
Add definedTestNames test (#9210) 2026-05-11 20:01:59 -04:00
eugene yokota 49f19feef1
Merge pull request #9207 from eed3si9n/wip/bump-zinc
[2.x] Cache analysis using file last modified
2026-05-11 10:20:27 -04:00
Eugene Yokota e69e23aae1 Remove tests that checks for the iteration 2026-05-11 05:10:07 -04:00
Eugene Yokota 566f888045 [2.x] Cache analysis using file last modified
**Problem**
Current MixedAnalyzingCompiler analysis cache caches using the last write,
assuming all writing happens via it. However, this doesn't work with
sbt 2.x caching system where the gz file under it can switch.

**Solution**
This switches to using caffeine caching, which includes file size
and file timestamp for local analysis caching.
2026-05-11 04:29:28 -04:00
eugene yokota c491f035f8
[2.x] test: Port tests to use lm-coursier (#9205)
**Problem**
Some tests are failing.

**Solution**

* Port EvictionErrorSpec to lm-coursier
* Port EvictionWarningSpec to lm-coursier
* Port InclExclSpec to lm-coursier
* Port ZincComponentCompilerSpec to lm-coursier
* Apparently we still need lmIvy
2026-05-10 04:40:15 -04:00
kenji yoshida 412801fc54
[2.x] refactor: Use scala.jdk.OptionConverters instead of JavaInterfaceUtil (#9200) 2026-05-10 00:58:24 -04:00
kenji yoshida 76992ed3f6
[2.x] test: Enable run/fork-loader scripted test (#9199) 2026-05-08 01:00:08 -04:00
eugene yokota 59c007d6a4
[2.x] test: Add move-file test (#9197)
**Problem**
Moving files around seems to break compile task.
2026-05-07 11:23:22 -04:00
Anatolii Kmetiuk 1f151ad6e3
[2.x] Fix #9190: Ensure resources are copied atomically (#9193)
Bumps io to released 1.12.0 which contains the atomic-write changes
to IO.copyFile, IO.transfer(InputStream, File), and IO.jar/zip.
ActionCacheStore.putBlob now uses IO.transfer instead of duplicating
staging logic.
2026-05-07 01:22:22 -04:00
kenji yoshida 0638907349
[2.x] test: Enable actions/eval-is-safe-and-sound scripted test (#9192) 2026-05-06 20:29:06 -04:00
kenji yoshida f4ae966a22
[2.x] test: Enable project/source-plugins scripted test (#9191) 2026-05-06 16:02:40 -04:00
kenji yoshida 6b39acc892
[2.x] ci: Fix warnings in launcherPackage sub project (#9188) 2026-05-05 00:18:16 -04:00
eugene yokota 63d5a1103b
[2.x] Improve --help (#9180)
**Problem**
Some runner options are not documented in --help.

**Solution**
Fix it.
2026-05-03 21:24:16 -04:00
eugene yokota 0de038e20b
[2.x] sjson-new 0.14.0 (#9177) 2026-05-03 16:50:51 -04:00
kenji yoshida 21403eeefc
[2.x] Add ForkOptions.connectionTimeout (#9172)
---------

Co-authored-by: Eugene Yokota <eed3si9n@gmail.com>
2026-05-03 13:51:09 -04:00
kenji yoshida 2dbc85ffcf
[2.x] ci: Avoid deprecated replaceAllLiterally (#9173)
- b4aa12d2b0
- https://github.com/scala/scala/blob/v2.12.21/src/library/scala/collection/immutable/StringLike.scala#L177-L184
- https://github.com/scala/scala3/blob/3.8.2/library/src/scala/collection/StringOps.scala#L746-L747
2026-05-03 12:40:44 -04:00
kenji yoshida 590dbbacb8
Avoid infix syntax in build files (#9175) 2026-05-03 12:40:00 -04:00