Skip to content

Commit 97fced1

Browse files
authored
Check if java_runtime.version is available (#1591)
1 parent 9184f0d commit 97fced1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scala/private/rule_impls.bzl

+3-1
Original file line numberDiff line numberDiff line change
@@ -228,4 +228,6 @@ def is_windows(ctx):
228228
# This must be a runtime used in generated java_binary script (usually workers using SecurityManager)
229229
def allow_security_manager(ctx, runtime = None):
230230
java_runtime = runtime if runtime else ctx.attr._java_host_runtime[java_common.JavaRuntimeInfo]
231-
return ["-Djava.security.manager=allow"] if java_runtime.version >= 17 else []
231+
232+
# Bazel 5.x doesn't have java_runtime.version defined
233+
return ["-Djava.security.manager=allow"] if hasattr(java_runtime, "version") and java_runtime.version >= 17 else []

0 commit comments

Comments
 (0)