Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove @io_bazel_rules_scala or replace with Label #1696

Merged

Conversation

mbland
Copy link
Contributor

@mbland mbland commented Feb 13, 2025

Description

Removes all remaining internal usages of @io_bazel_rules_scala without changing any actual logic. Part of #1482 and #1652, this is the last change required before adding Bzlmod compatibility.

Updates WORKSPACE files to use @rules_scala and scala_register_toolchains() instead of @io_bazel_rules_scala and register_toolchains("@io_bazel_rules_scala_toolchains//...:all").

Also adds all the scripts run in CI to test_all.sh, plus dt_patches/dt_patch_test.sh.

Leaves @io_bazel_rules_scala_config as is for now, because it's a documented public interface. It can be easily changed and documented in a future commit if desired.

Also doesn't change the io_bazel_rules_scala_ prefix for Maven artifact repos. This could also be done and documented in a future commit if desired.

Motivation

This change enables WORKSPACE and Bzlmod users to import rules_scala as rules_scala, instead of requiring io_bazel_rules_scala due to internal dependencies.

i.e., WORKSPACE users can still use http_archive to import rules_scala as io_bazel_rules_scala. Bzlmod users will be able to call bazel_dep(name = "rules_scala", repo_name = "io_bazel_rules_scala"). However, io_bazel_rules_scala is no longer required by rules_scala itself.

Removes all remaining internal usages of `@io_bazel_rules_scala` without
changing any actual logic. Part of bazelbuild#1482 and bazelbuild#1652, this is the last
change required before adding Bzlmod compatibility.

Updates `WORKSPACE` files to use `@rules_scala` and
`scala_register_toolchains()` instead of `@io_bazel_rules_scala` and
`register_toolchains("@io_bazel_rules_scala_toolchains//...:all")`.

Also adds all the scripts run in CI to `test_all.sh`, plus
`dt_patches/dt_patch_test.sh`.

Leaves `@io_bazel_rules_scala_config` as is for now, because it's a
documented public interface. It can be easily changed and documented in
a future commit if desired.

Also doesn't change the `io_bazel_rules_scala_` prefix for Maven
artifact repos. This could also be done and documented in a future
commit if desired.

---

This change enables `WORKSPACE` and Bzlmod users to import `rules_scala`
as `rules_scala`, instead of requiring `io_bazel_rules_scala` due to
internal dependencies.

i.e., `WORKSPACE` users can still use `http_archive` to import `rules_scala`
as `io_bazel_rules_scala`. Bzlmod users will be able to call
`bazel_dep(name = "rules_scala", repo_name = "io_bazel_rules_scala")`.
However, `io_bazel_rules_scala` is no longer required by `rules_scala`
itself.
Copy link
Collaborator

@simuons simuons left a comment

Choose a reason for hiding this comment

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

Thanks, much awaited cleanup!

@simuons simuons merged commit 15ce51a into bazelbuild:master Feb 18, 2025
2 checks passed
@mbland mbland deleted the rm-internal-io-bazel-rules-scala-refs branch February 18, 2025 12:57
mbland added a commit to mbland/rules_scala that referenced this pull request Feb 26, 2025
Shortens `@io_bazel_rules_scala_config` to `@rules_scala_config` in
light of the `@io_bazel_rules_scala` removal in bazelbuild#1696. Part of bazelbuild#1482.

Adds a section to `README.md` indicating this as a breaking change, with
advice on working around any breakages that aren't immediately fixable.

Per @simuons's advice in
bazelbuild#1703 (comment).
mbland added a commit to mbland/rules_scala that referenced this pull request Feb 28, 2025
Shortens `@io_bazel_rules_scala_config` to `@rules_scala_config` in
light of the `@io_bazel_rules_scala` removal in bazelbuild#1696. Part of bazelbuild#1482.

Adds a section to `README.md` indicating this as a breaking change, with
advice on working around any breakages that aren't immediately fixable.

Includes updates the "Builtin repositories no longer visible by default
under Bzlmod" section to improve clarity.

Per @simuons's advice in
bazelbuild#1703 (comment).
simuons pushed a commit that referenced this pull request Feb 28, 2025
Shortens `@io_bazel_rules_scala_config` to `@rules_scala_config` in
light of the `@io_bazel_rules_scala` removal in #1696. Part of #1482.

Adds a section to `README.md` indicating this as a breaking change, with
advice on working around any breakages that aren't immediately fixable.

Includes updates the "Builtin repositories no longer visible by default
under Bzlmod" section to improve clarity.

Per @simuons's advice in
#1703 (comment).
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.

2 participants