Skip to content

Commit

Permalink
Revert "Use target_compatible_with for Java runtimes"
Browse files Browse the repository at this point in the history
This reverts commit 338c418.

This is probably not the right fix, but it fixes bazelbuild#64 for me.
  • Loading branch information
jpsim committed Jul 21, 2022
1 parent 1f25ba9 commit 4324398
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
52 changes: 26 additions & 26 deletions java/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def remote_jdk8_repos(name = ""):
maybe(
remote_java_repository,
name = "remote_jdk8_linux_aarch64",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:aarch64",
],
Expand All @@ -100,7 +100,7 @@ def remote_jdk8_repos(name = ""):
maybe(
remote_java_repository,
name = "remote_jdk8_linux",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
Expand All @@ -115,7 +115,7 @@ def remote_jdk8_repos(name = ""):
maybe(
remote_java_repository,
name = "remote_jdk8_macos_aarch64",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:macos",
"@platforms//cpu:aarch64",
],
Expand All @@ -129,7 +129,7 @@ def remote_jdk8_repos(name = ""):
maybe(
remote_java_repository,
name = "remote_jdk8_macos",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:macos",
"@platforms//cpu:x86_64",
],
Expand All @@ -144,7 +144,7 @@ def remote_jdk8_repos(name = ""):
maybe(
remote_java_repository,
name = "remote_jdk8_windows",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:windows",
"@platforms//cpu:x86_64",
],
Expand All @@ -171,7 +171,7 @@ def remote_jdk11_repos():
maybe(
remote_java_repository,
name = "remotejdk11_linux",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
Expand All @@ -187,7 +187,7 @@ def remote_jdk11_repos():
maybe(
remote_java_repository,
name = "remotejdk11_linux_aarch64",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:aarch64",
],
Expand All @@ -203,7 +203,7 @@ def remote_jdk11_repos():
maybe(
remote_java_repository,
name = "remotejdk11_linux_ppc64le",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:ppc",
],
Expand All @@ -219,7 +219,7 @@ def remote_jdk11_repos():
maybe(
remote_java_repository,
name = "remotejdk11_linux_s390x",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:s390x",
],
Expand All @@ -235,7 +235,7 @@ def remote_jdk11_repos():
maybe(
remote_java_repository,
name = "remotejdk11_macos",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:macos",
"@platforms//cpu:x86_64",
],
Expand All @@ -251,7 +251,7 @@ def remote_jdk11_repos():
maybe(
remote_java_repository,
name = "remotejdk11_macos_aarch64",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:macos",
"@platforms//cpu:aarch64",
],
Expand All @@ -267,7 +267,7 @@ def remote_jdk11_repos():
maybe(
remote_java_repository,
name = "remotejdk11_win",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:windows",
"@platforms//cpu:x86_64",
],
Expand All @@ -283,7 +283,7 @@ def remote_jdk11_repos():
maybe(
remote_java_repository,
name = "remotejdk11_win_arm64",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:windows",
"@platforms//cpu:arm64",
],
Expand All @@ -300,7 +300,7 @@ def remote_jdk15_repos():
maybe(
remote_java_repository,
name = "remotejdk15_linux",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
Expand All @@ -316,7 +316,7 @@ def remote_jdk15_repos():
maybe(
remote_java_repository,
name = "remotejdk15_macos",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:macos",
"@platforms//cpu:x86_64",
],
Expand All @@ -332,7 +332,7 @@ def remote_jdk15_repos():
maybe(
remote_java_repository,
name = "remotejdk15_macos_aarch64",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:macos",
"@platforms//cpu:aarch64",
],
Expand All @@ -348,7 +348,7 @@ def remote_jdk15_repos():
maybe(
remote_java_repository,
name = "remotejdk15_win",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:windows",
"@platforms//cpu:x86_64",
],
Expand All @@ -366,7 +366,7 @@ def remote_jdk16_repos():
maybe(
remote_java_repository,
name = "remotejdk16_linux",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
Expand All @@ -382,7 +382,7 @@ def remote_jdk16_repos():
maybe(
remote_java_repository,
name = "remotejdk16_macos",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:macos",
"@platforms//cpu:x86_64",
],
Expand All @@ -398,7 +398,7 @@ def remote_jdk16_repos():
maybe(
remote_java_repository,
name = "remotejdk16_macos_aarch64",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:macos",
"@platforms//cpu:aarch64",
],
Expand All @@ -414,7 +414,7 @@ def remote_jdk16_repos():
maybe(
remote_java_repository,
name = "remotejdk16_win",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:windows",
"@platforms//cpu:x86_64",
],
Expand All @@ -432,7 +432,7 @@ def remote_jdk17_repos():
maybe(
remote_java_repository,
name = "remotejdk17_linux",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
Expand All @@ -448,7 +448,7 @@ def remote_jdk17_repos():
maybe(
remote_java_repository,
name = "remotejdk17_macos",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:macos",
"@platforms//cpu:x86_64",
],
Expand All @@ -464,7 +464,7 @@ def remote_jdk17_repos():
maybe(
remote_java_repository,
name = "remotejdk17_macos_aarch64",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:macos",
"@platforms//cpu:aarch64",
],
Expand All @@ -479,7 +479,7 @@ def remote_jdk17_repos():
maybe(
remote_java_repository,
name = "remotejdk17_win",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:windows",
"@platforms//cpu:x86_64",
],
Expand All @@ -494,7 +494,7 @@ def remote_jdk17_repos():
maybe(
remote_java_repository,
name = "remotejdk17_win_arm64",
target_compatible_with = [
exec_compatible_with = [
"@platforms//os:windows",
"@platforms//cpu:arm64",
],
Expand Down
10 changes: 5 additions & 5 deletions toolchains/remote_java_repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ _toolchain_config = repository_rule(
},
)

def remote_java_repository(name, version, target_compatible_with = None, prefix = "remotejdk", **kwargs):
def remote_java_repository(name, version, exec_compatible_with, prefix = "remotejdk", **kwargs):
"""Imports and registers a JDK from a http archive.
Toolchain resolution is determined with target_compatible_with
Toolchain resolution is determined with exec_compatible_with
parameter and constrained with --java_runtime_version flag either having value
of "version" or "{prefix}_{version}" parameters.
Args:
name: A unique name for this rule.
version: Version of the JDK imported.
target_compatible_with: Target platform constraints (CPU and OS) for this JDK.
exec_compatible_with: Platform constraints (CPU and OS) for this JDK.
prefix: Optional alternative prefix for configuration flag value used to determine this JDK.
**kwargs: Refer to http_archive documentation
"""
Expand Down Expand Up @@ -73,15 +73,15 @@ alias(
)
toolchain(
name = "toolchain",
target_compatible_with = {target_compatible_with},
exec_compatible_with = {exec_compatible_with},
target_settings = [":version_or_prefix_version_setting"],
toolchain_type = "@bazel_tools//tools/jdk:runtime_toolchain_type",
toolchain = "{toolchain}",
)
""".format(
prefix = prefix,
version = version,
target_compatible_with = target_compatible_with,
exec_compatible_with = exec_compatible_with,
toolchain = "@{repo}//:jdk".format(repo = name),
),
)

0 comments on commit 4324398

Please sign in to comment.