-
Notifications
You must be signed in to change notification settings - Fork 278
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
Create the @scala_compiler_sources
repo
#1635
Create the @scala_compiler_sources
repo
#1635
Conversation
Contains aliases to versioned Scala compiler source repository targets. Part of bazelbuild#1482. Updates the version specific repo references in the srcs attribute of `//third_party/dependency_analyzer/src/main/io/bazel/rulesscala/dependencyanalyzer/compiler:dep_reporting_compiler`. Now these are references to versioned targets in `@scala_compiler_sources//`, which are aliases to those versioned compiler source repos. In a Bzlmod world, this enables `rules_scala` to import only the `scala_compiler_sources` repo in `MODULE.bazel`, instead of importing each individual versioned compiler source repo. This then allows `rules_scala` clients to set multiple `SCALA_VERSIONS` without requiring them to import this repo or any versioned compiler source repo. The Bzlmodifcation of the test repos under `dt_patches` (coming in a future change) revealed the need for this flexibility.
@@ -5,7 +5,9 @@ load("@io_bazel_rules_scala//scala:scala_cross_version.bzl", "version_suffix") | |||
scala_library_for_plugin_bootstrapping( | |||
name = "dep_reporting_compiler", | |||
srcs = select({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you are hiding/unifying version specific repositories under @scala_compiler_sources
maybe this select
should be moved into that repository. I mean @scala_compiler_sources
would have a single alias target with select to version specific sources. For example:
alias(
name = "src",
visibility = ["//visibility:public"],
actual = select({"@io_bazel_rules_scala_config//:scala_version_2_12_19": "@scala_compiler_source_2_12_19//:src"}),
)
And here in compilation target you would specify srcs = ["@scala_compiler_sources//:src"],
What do you think?
Also I think that compilation target could go into that new repository, but let's not go down that rabbit hole now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it. Done.
Requested by @simuons in bazelbuild#1635.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @mbland!
Description
Contains aliases to versioned Scala compiler source repository targets. Part of #1482.
Updates the version specific repo references in the srcs attribute of
//third_party/dependency_analyzer/src/main/io/bazel/rulesscala/dependencyanalyzer/compiler:dep_reporting_compiler
. Now these are references to versioned targets in@scala_compiler_sources//
, which are aliases to those versioned compiler source repos.Motivation
In a Bzlmod world, this enables
rules_scala
to import only thescala_compiler_sources
repo inMODULE.bazel
, instead of importing each individual versioned compiler source repo.This then allows
rules_scala
clients to set multipleSCALA_VERSIONS
without requiring them to import this repo or any versioned compiler source repo. The Bzlmodifcation of the test repos underdt_patches
(coming in a future change) revealed the need for this flexibility.