diff --git a/internal/native_image/classic.bzl b/internal/native_image/classic.bzl index df059414..62172c67 100644 --- a/internal/native_image/classic.bzl +++ b/internal/native_image/classic.bzl @@ -16,6 +16,10 @@ load( "//internal/native_image:toolchain.bzl", _resolve_cc_toolchain = "resolve_cc_toolchain", ) +load( + "@bazel_skylib//lib:paths.bzl", + "paths", +) def _graal_binary_classic_implementation(ctx): graal_attr = ctx.attr.native_image_tool @@ -43,7 +47,7 @@ def _graal_binary_classic_implementation(ctx): """) # resolve graal_home - graalvm_home = graal.dirname + graalvm_home = paths.dirname(graal.dirname) # resolve the native toolchain native_toolchain = _resolve_cc_toolchain( diff --git a/internal/native_image/rules.bzl b/internal/native_image/rules.bzl index c1dce5ee..9359abac 100644 --- a/internal/native_image/rules.bzl +++ b/internal/native_image/rules.bzl @@ -8,6 +8,10 @@ load( "@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", ) +load( + "@bazel_skylib//lib:paths.bzl", + "paths", +) load( "//internal/native_image:common.bzl", _BAZEL_CURRENT_CPP_TOOLCHAIN = "BAZEL_CURRENT_CPP_TOOLCHAIN", @@ -71,7 +75,7 @@ def _graal_binary_implementation(ctx): # add toolchain files to transitive inputs transitive_inputs.append(gvm_toolchain.gvm_files[DefaultInfo].files) transitive_inputs.append(gvm_toolchain.includes[DefaultInfo].files) - graalvm_home = graal.dirname + graalvm_home = paths.dirname(graal.dirname) # if we're using an explicit tool, add it to the direct inputs if graal: