From 97fced10e5b4a980d7e2e94fdd25edcfb2107e94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kar=C3=A1csony?= <136110331+kmate-ct@users.noreply.github.com> Date: Tue, 30 Jul 2024 07:31:22 +0200 Subject: [PATCH] Check if java_runtime.version is available (#1591) --- scala/private/rule_impls.bzl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scala/private/rule_impls.bzl b/scala/private/rule_impls.bzl index fa73ebc13..35bf3032e 100644 --- a/scala/private/rule_impls.bzl +++ b/scala/private/rule_impls.bzl @@ -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 []