Skip to content

Commit

Permalink
fix: typo in gu post-install actions
Browse files Browse the repository at this point in the history
- fix: `startsWith` should be `startswith`
- test: update `components-ce` test to include component usage

Thank you to @mantasindrasius!

Signed-off-by: Sam Gammon <sam@elide.ventures>
  • Loading branch information
mantasindrasius authored and sgammon committed Sep 3, 2023
1 parent ef1cf4f commit a571524
Show file tree
Hide file tree
Showing 6 changed files with 239 additions and 224 deletions.
2 changes: 2 additions & 0 deletions example/integration_tests/components-ce/.bazelrc
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
build --enable_bzlmod
build --java_runtime_version=graalvm_20
build --tool_java_runtime_version=graalvm_20
2 changes: 1 addition & 1 deletion example/integration_tests/components-ce/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module(

bazel_dep(
name = "rules_java",
version = "6.5.0",
version = "6.4.0",
)
bazel_dep(
name = "rules_graalvm",
Expand Down
438 changes: 218 additions & 220 deletions example/integration_tests/components-ce/MODULE.bazel.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions example/integration_tests/components-ce/sample/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ native_image(
name = "main-native",
main_class = "Main",
deps = [":java"],
extra_args = [
"--language:js",
],
)

alias(
Expand Down
16 changes: 14 additions & 2 deletions example/integration_tests/components-ce/sample/Main.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
import org.graalvm.polyglot.Context;

import java.io.BufferedOutputStream;
import java.io.OutputStream;


public class Main {
public static void main(String args[]) {
System.out.println("Hello, GraalVM!");
OutputStream myOut = new BufferedOutputStream(System.out);
Context context = Context.newBuilder("js")
.out(myOut)
.allowAllAccess(true)
.build();
context.eval("js", "42");
context.close();
}
}
}
2 changes: 1 addition & 1 deletion internal/graalvm_bindist.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def _graal_postinstall_actions(ctx, os):
cmd = _graal_updater_path(os)
if ctx.attr.setup_actions and len(ctx.attr.setup_actions) > 0:
for action in ctx.attr.setup_actions:
if not action.startsWith("gu "):
if not action.startswith("gu "):
fail("GraalVM setup action did not start with 'gu'. Please only run GraalVM updater commands.")

action_cmd = action.replace("gu ", "").split(" ")
Expand Down

0 comments on commit a571524

Please sign in to comment.