Skip to content

[2.x] fix: Restore bincompat for ScriptedRun methods#8654

Merged
eed3si9n merged 1 commit intosbt:developfrom
bitloi:fix/scripted-run-bincompat-8653
Jan 29, 2026
Merged

[2.x] fix: Restore bincompat for ScriptedRun methods#8654
eed3si9n merged 1 commit intosbt:developfrom
bitloi:fix/scripted-run-bincompat-8653

Conversation

@bitloi
Copy link
Copy Markdown
Contributor

@bitloi bitloi commented Jan 29, 2026

Fixes #8653

Problem

In PR #8621, I added a new keepTempDirectory parameter to ScriptedRun.run() and invoke() methods. To suppress MiMa warnings, I added mimaBinaryIssueFilters for:

  • DirectMissingMethodProblem("sbt.ScriptedRun.run")
  • DirectMissingMethodProblem("sbt.ScriptedRun.invoke")
  • DirectMissingMethodProblem for various internal RunV1, RunV2, RunInParallelV1, RunInParallelV2 classes

However, this broke binary compatibility, which prevents sbt 1.x from calling sbt 2.x for cross-building (building sbt 2.x plugins using sbt 1.x).

Solution

Instead of using MiMa filters to suppress the warnings, this PR restores binary compatibility by:

  1. Adding backward-compatible overloaded methods: Created overloaded run() and invoke() methods without the keepTempDirectory parameter that delegate to the new methods with keepTempDirectory=false

  2. Removing problematic MiMa filters: Removed all DirectMissingMethodProblem filters for ScriptedRun methods

  3. Keeping acceptable filter: Retained only ReversedMissingMethodProblem("sbt.ScriptedRun.invoke") filter, which is acceptable since the old method signatures are preserved

  4. Code cleanup: Removed unused @unused import

Changes

main/src/main/scala/sbt/ScriptedRun.scala

  • Added overloaded run() method without keepTempDirectory parameter (delegates to new method with false)
  • Added overloaded invoke() method without keepTempDirectory parameter (delegates to new method with false)
  • Removed @unused import (no longer needed)
  • Removed @unused annotations from internal class methods

build.sbt

  • Removed MiMa filters for DirectMissingMethodProblem on ScriptedRun methods
  • Kept ReversedMissingMethodProblem("sbt.ScriptedRun.invoke") filter

Testing

  • ✅ Compiles successfully
  • mainProj/mimaReportBinaryIssues passes
  • ✅ Binary compatibility maintained for cross-building

Checklist

  • Compiles successfully
  • Binary compatibility verified with MiMa
  • Backward-compatible method signatures preserved
  • New functionality still works with keepTempDirectory parameter

Copy link
Copy Markdown
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @bitloi!

@eed3si9n eed3si9n changed the title Restore binary compatibility for ScriptedRun methods [2.x] fix: Restore binary compatibility for ScriptedRun methods Jan 29, 2026
@eed3si9n eed3si9n merged commit 627c484 into sbt:develop Jan 29, 2026
15 checks passed
@eed3si9n eed3si9n changed the title [2.x] fix: Restore binary compatibility for ScriptedRun methods [2.x] fix: Restore bincompat for ScriptedRun methods Jan 29, 2026
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.

ScriptedRun bincompat issues

2 participants