Skip to content

Commit

Permalink
Mark toolchains extension as reproducible
Browse files Browse the repository at this point in the history
Copybara Import from #187

Needed a manual import with a copybara fix (top-level targets for transformed repositories need special casing)

BEGIN_PUBLIC
Mark `toolchains` extension as reproducible (#187)

This avoids an unnecessary and verbose lockfile entry for rules_java users. Uses `bazel_skylib`'s `modules.as_extension` to automatically detect the availability of the `reproducible` feature.

Closes #187
END_PUBLIC

PiperOrigin-RevId: 633475117
Change-Id: I05f1578e767f2148ef59a041c1b505c30976c779
  • Loading branch information
fmeum authored and copybara-github committed May 14, 2024
1 parent 25a1131 commit ef50aab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module(

bazel_dep(name = "platforms", version = "0.0.4")
bazel_dep(name = "rules_cc", version = "0.0.2")
bazel_dep(name = "bazel_skylib", version = "1.2.0")
bazel_dep(name = "bazel_skylib", version = "1.6.1")

# Required by @remote_java_tools, which is loaded via module extension.
bazel_dep(name = "rules_proto", version = "4.0.0")
Expand Down
6 changes: 3 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "bazel_skylib",
sha256 = "af87959afe497dc8dfd4c6cb66e1279cb98ccc84284619ebfec27d9c09a903de",
sha256 = "9f38886a40548c6e96c106b752f242130ee11aaa068a56ba7e56f4511f33e4f2",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.2.0/bazel-skylib-1.2.0.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.2.0/bazel-skylib-1.2.0.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.6.1/bazel-skylib-1.6.1.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.6.1/bazel-skylib-1.6.1.tar.gz",
],
)

Expand Down
5 changes: 3 additions & 2 deletions java/extensions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
"""Module extensions for rules_java."""

load("@bazel_skylib//lib:modules.bzl", "modules")
load(
"//java:repositories.bzl",
"java_tools_repos",
Expand All @@ -23,12 +24,12 @@ load(
"remote_jdk8_repos",
)

def _toolchains_impl(_ctx):
def _toolchains_impl():
java_tools_repos()
local_jdk_repo()
remote_jdk8_repos()
remote_jdk11_repos()
remote_jdk17_repos()
remote_jdk21_repos()

toolchains = module_extension(implementation = _toolchains_impl)
toolchains = modules.as_extension(_toolchains_impl)

0 comments on commit ef50aab

Please sign in to comment.