Skip to content

scala: let the root module choose Scala versions with scala_config.settings - #14441

Merged
TrapsterDK merged 4 commits into
mainfrom
cloud/14401
Nov 21, 2026
Merged

TrapsterDK merged 4 commits into
mainfrom
cloud/14401

Conversation

@TrapsterDK

Copy link
Copy Markdown
Collaborator

Pull Request

Linked Issue

Closes #14401

Changes

  • New public @rules_dx//scala:extensions.bzl exports scala_config. It has a root-only settings(scala_version, scala_versions) tag. With no tag, the versions stay Scala 2.13.18 (default) and 3.3.9. More than one settings tag fails, and so does a version that isn't <major>.<minor>.<patch>.
  • The extension writes @rules_scala_config and a load-free hub repo, @dx_scala_toolchains. For each version the hub has:
    • one semanticdb toolchain(), gated on //config:toolchains (semanticdb_scala3_impl for 3.x, semanticdb_impl otherwise),
    • one ungated upstream toolchain,
    • one ungated testing toolchain.
  • MODULE.bazel now uses the public extension and registers @dx_scala_toolchains//:all. scala/private/toolchain/hub/BUILD.bazel keeps only the two toolchain_types.
  • rules_dx adds Scala 2.12.21 as a dev-only third version. The new //scala/tests:third_version_test checks that it resolves the dx semanticdb toolchain and a testing toolchain.
  • scala/README.md gains a "Scala versions" section. api/starlark.json and docs/supported-surface.md are regenerated with bazel run //tools/api:update. That also picks up apple testonly and php from_source drift that was already on main.

Verification

Tested: //scala/... (including the new //scala/tests:third_version_test), //tools/api:api_test, //core/modules:versions_contract, //tools/ci:bzl_visibility_test: all passed.

tools/dx check --apply on the touched files: format is clean. The two lint warnings are on lines already on main: the docs/languages/scala.md link in scala/README.md, and the implicits scalacopt. Typecheck fails on main's docs site: "dangling link '../deploy/README.md#pypi_deploy'".

Not run: the nested consumer tests (//tools/testing/consumer:cold_start_test). They can't run in this container.


Generated by Claude Code

@TrapsterDK TrapsterDK added needs-review Touches review paths; needs a second-session Review: comment train Tested; land via merge train api labels Nov 21, 2026 — with Claude

Copy link
Copy Markdown
Collaborator Author

analysis (PR-time checks on linux_x86_64) fails in //tools/docs/site:user_api with docs_site: dangling link '../deploy/README.md#pypi_deploy'. This PR doesn't touch deploy/README.md or the docs-site prose. The same error appears on main and on #14430, so it's a main failure, not this PR's.


Generated by Claude Code

@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Merge train: dropped, //tools/ci:starlark_docs_test fails: scala/private/toolchain/config_extension.bzl:65: attr "scala_version" has no doc; add doc = "" (also //tools/ci:test_budget_test: scala/tests/BUILD.bazel no-size 3, one more than on main)

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hzWDHEg9zNhhTJrJ7t

claude and others added 2 commits November 21, 2026 11:44
…ttings

The scala_config extension moves to the public @rules_dx//scala:extensions.bzl
and takes a root-only settings(scala_version, scala_versions) tag. It writes
@rules_scala_config and a load-free @dx_scala_toolchains hub with a gated
semanticdb, an upstream and a testing toolchain per version; MODULE.bazel
registers @dx_scala_toolchains//:all. rules_dx adds Scala 2.12.21 as a dev
version, and //scala/tests:third_version_test checks it resolves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hzMfZnvvugXUYigRmF
@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Fixed: added doc to the scala_version and scala_versions attrs of the _config_repository rule, and gave the third_version_test macro an explicit size so scala/tests/BUILD.bazel is back to 2 no-size sites like main. Rebased onto origin/main. starlark_docs_test and test_budget_test no longer report any scala finding (other findings are on main). The code changed, so the earlier needs-review review is stale and needs a fresh Review: comment.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hzWDHEg9zNhhTJrJ7t

@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Merge train: dropped, //tools/testing:toolchain_gate_test fails with this PR in the stack and passes on main and with the PR reverted: register_toolchains for a shared toolchain type needs //config:toolchains_on in target_settings: ["@dx_scala_toolchains//:all"]

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hzWDHEg9zNhhTJrJ7t

@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Fixed: merged fresh origin/main and moved the scala hub registration in tools/testing/toolchain_gate_test.rs from //scala/private/toolchain/hub:all to @dx_scala_toolchains//:all in the own-type list (the hub still only serves rules_dx's own toolchain types); //tools/testing:toolchain_gate_test passes. Code changed, so the earlier needs-review review is stale and needs a fresh Review: comment.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hzWDHEg9zNhhTJrJ7t

Copy link
Copy Markdown
Collaborator Author

analysis (PR-time checks on linux_x86_64) fails //cli/cli:dx_cli_test in exec::quality_probe_tests::probed_shards_narrow_the_build_aspects. The case expects ["real_lint_aspect", "real_rust_lint_aspect"] and gets an extra android_sdk_aspect. I ran it locally with --test_filter=probed_shards_narrow_the_build_aspects on current origin/main (e443d5b), and it fails there too. This PR doesn't touch android or the quality probe, so this is a main failure, not this PR's.


Generated by Claude Code

@TrapsterDK
TrapsterDK merged commit 750cd4a into main Nov 21, 2026
17 of 31 checks passed
@TrapsterDK
TrapsterDK deleted the cloud/14401 branch November 21, 2026 12:45
TrapsterDK pushed a commit that referenced this pull request Nov 22, 2026
Main now registers @dx_scala_toolchains//:all (#14441), a toolchain hub
every consumer fetches, so record run 44953085552 measures one more repo
on Linux in every stage: core 236, python 239 and 250.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hvdk6FgsNTgASkdvZF
TrapsterDK pushed a commit that referenced this pull request Nov 23, 2026
Main now registers @dx_scala_toolchains//:all (#14441), a toolchain hub
every consumer fetches, so record run 44953085552 measures one more repo
on Linux in every stage: core 236, python 239 and 250.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hvdk6FgsNTgASkdvZF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api needs-review Touches review paths; needs a second-session Review: comment train Tested; land via merge train

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scala: consumers choose Scala versions for rules_dx's rules_scala toolchain hub

2 participants