Skip to content

Conversation

@mrdziuban
Copy link

@mrdziuban mrdziuban commented Jan 27, 2026

This fixes an issue introduced in #24969 where the output generated by -Ydump-sbt-inc never includes any used names or dependencies.

The problem occurs because sendToZinc calls clear(), which calls _foundDeps.clear(). As a result, rec.foundDeps is always empty when generating the info to dump.

This fixes it by moving the call to sendToZinc to occur after dumping data using rec.foundDeps. This aligns with how -Ydump-sbt-inc worked when it was handled in ExtractDependencies.scala prior to being moved to Inlining.scala.

@mrdziuban mrdziuban changed the title Call sendToZinc after dumping sbt incremental compilation info. Fix behavior of -Ydump-sbt-inc Jan 27, 2026
This fixes an issue introduced in scala#24969 where the output generated by `-Ydump-sbt-inc` never includes any used names or dependencies.

The problem occurs because [`sendToZinc` calls `clear()`](https://github.com/scala/scala3/blob/388248140f264d52d9199c5a266e220b2be4433c/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala#L458), which calls [`_foundDeps.clear()`](https://github.com/scala/scala3/blob/388248140f264d52d9199c5a266e220b2be4433c/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala#L462). As a result, `rec.foundDeps` is always empty when generating the info to dump.

This fixes it by moving the call to `sendToZinc` to occur after dumping data using `rec.foundDeps`. This aligns with how `-Ydump-sbt-inc` worked [when it was handled in `ExtractDependencies.scala`](https://github.com/scala/scala3/pull/24969/changes#diff-5a8383a96e18900140707151f3f9f47cb9d89c3d64498f4bc70f554f9c780bccL81-L100) prior to being moved to `Inlining.scala`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant