Skip to content

[2.x] fix: Fix pipelining flags applied to unsupported Scala versions#8499

Merged
eed3si9n merged 3 commits intosbt:developfrom
0xsatoshi99:fix-pipelining-version-check
Jan 13, 2026
Merged

[2.x] fix: Fix pipelining flags applied to unsupported Scala versions#8499
eed3si9n merged 3 commits intosbt:developfrom
0xsatoshi99:fix-pipelining-version-check

Conversation

@0xsatoshi99
Copy link
Copy Markdown
Contributor

Problem

When usePipelining := true is set with Scala 3.3.x or 3.4.x, sbt applies -Ypickle-java and -Ypickle-write compiler flags even though pipelining is only supported in Scala 3.5.0+. This causes confusing warnings:

[warn] bad option '-Ypickle-java' was ignored
[warn] bad option '-Ypickle-write' was ignored

Solution

Added version check to only apply pipelining compiler flags when Scala 3.5.0 or later is detected. The check uses existing utilities (ScalaArtifacts.isScala3 and VersionNumber.matchesSemVer) following the pattern already used elsewhere in the codebase.

Changes

  • Modified scalacOptions setting in Defaults.scala to check Scala version before applying pipelining flags
  • Flags are now only added for Scala 3.5.0+
  • For earlier versions, usePipelining setting is silently ignored

Fixes #8433

Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=162055292

Pipelining was introduced in Scala 3.5.0 but the build was applying
-Ypickle-java and -Ypickle-write flags to all Scala 3 versions when
usePipelining was enabled, causing warnings on Scala 3.3.x and 3.4.x.

This change adds version detection to only apply pipelining compiler
flags when Scala 3.5.0 or later is used.

Fixes sbt#8433

Generated-by: AI-assisted
@0xsatoshi99
Copy link
Copy Markdown
Contributor Author

@eed3si9n Can you please check this PR and give me feedback if you have any? Thanks.

@eed3si9n
Copy link
Copy Markdown
Member

Thanks for the contribution, I left a comment.

As pointed out by @eed3si9n, Scala 2.x has supported pipelining since 2020.
The fix now correctly allows:
- All Scala 2.x versions (pipelining supported)
- Scala 3.5.0+ (pipelining added in 3.5)

And only blocks Scala 3.0-3.4.x which lack pipelining support.
@0xsatoshi99
Copy link
Copy Markdown
Contributor Author

Thank you @eed3si9n for the correction! You are absolutely right - I misunderstood the issue. Scala 2.x has supported pipelining since 2020.

I have updated the logic to:

  • Allow all Scala 2.x versions (pipelining supported)
  • Allow Scala 3.5.0+ (pipelining added in 3.5)
  • Block only Scala 3.0-3.4.x (no pipelining support)

The fix now uses !ScalaArtifacts.isScala3(sv) || VersionNumber(sv).matchesSemVer(SemanticSelector(">=3.5.0")) which correctly handles all cases.

@0xsatoshi99 0xsatoshi99 requested a review from eed3si9n January 13, 2026 00:23
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!

@eed3si9n eed3si9n changed the title Fix pipelining flags applied to unsupported Scala versions [2.x] fix: Fix pipelining flags applied to unsupported Scala versions Jan 13, 2026
@0xsatoshi99
Copy link
Copy Markdown
Contributor Author

Applied scalafmt formatting to fix CI/CD check. The code logic remains the same, just properly formatted according to the project style guide.

@0xsatoshi99
Copy link
Copy Markdown
Contributor Author

@eed3si9n Can you please merge this PR?

@anatoliykmetyuk
Copy link
Copy Markdown
Member

CI didn't run for some reason, we need to approve workflows and run the CI.

@eed3si9n
Copy link
Copy Markdown
Member

CI didn't run for some reason, we need to approve workflows and run the CI.

First time contributors require approve-and-run each time they change the pull request.

@0xsatoshi99
Copy link
Copy Markdown
Contributor Author

Screenshot_18 Screenshot_19 Screenshot_20

When I try to sign Scala, I am getting 500 error, how I can fix this? @eed3si9n

@0xsatoshi99
Copy link
Copy Markdown
Contributor Author

The CI scripted tests are failing with errors in dependency-management/cache-resolver and other tests, but these appear unrelated to this PR:

  • The failures are in dependency resolution, caching, and project matrix tests
  • This PR only modifies scalacOptions logic in Defaults.scala
  • The error (sjsonnew.shaded.org.typelevel.jawn.IncompleteParseException) is a JSON parsing issue in the caching system
  • scalafmtCheckAll and compilation passed successfully

The code change is minimal and scoped to pipelining flag application. Could these be pre-existing test issues or flaky tests?

@eed3si9n
Copy link
Copy Markdown
Member

Looks like CLA worked after rerunning. I'm rerunning the failing tests.

@eed3si9n eed3si9n merged commit 3a9e1ec into sbt:develop Jan 13, 2026
22 of 24 checks passed
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.

usePipelining generates bad options when unsupported

3 participants