Skip to content

Commit

Permalink
Check if java_runtime.version is available (#1591)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmate-ct authored Jul 30, 2024
1 parent 9184f0d commit 97fced1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scala/private/rule_impls.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,6 @@ def is_windows(ctx):
# This must be a runtime used in generated java_binary script (usually workers using SecurityManager)
def allow_security_manager(ctx, runtime = None):
java_runtime = runtime if runtime else ctx.attr._java_host_runtime[java_common.JavaRuntimeInfo]
return ["-Djava.security.manager=allow"] if java_runtime.version >= 17 else []

# Bazel 5.x doesn't have java_runtime.version defined
return ["-Djava.security.manager=allow"] if hasattr(java_runtime, "version") and java_runtime.version >= 17 else []

0 comments on commit 97fced1

Please sign in to comment.