Skip to content

Commit

Permalink
fix: off-by-one in graalvm home path
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Gammon <sam@elide.ventures>
  • Loading branch information
sgammon committed Jan 5, 2024
1 parent 41278a4 commit d46406b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion internal/native_image/classic.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
6 changes: 5 additions & 1 deletion internal/native_image/rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit d46406b

Please sign in to comment.