-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: typo in gu
post-install actions
#99
fix: typo in gu
post-install actions
#99
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
@mantasindrasius I've discovered the bug, which I filed as #100. I'm pushing a fix and then I will return to this PR to amend the test. Thanks again or reporting. It looks like transitive component dependencies were installed, but not the actual direct dependencies requested by the user (oops). |
- fix: add requested component to list of effective components installed via bindist Fixes and closes #100. Thanks to @mantasindrasius for reporting! Relates-To: #100 Relates-To: #99 Signed-off-by: Sam Gammon <sam@elide.ventures>
- fix: add requested component to list of effective components installed via bindist Fixes and closes #100. Thanks to @mantasindrasius for reporting! Relates-To: #100 Relates-To: #99 Signed-off-by: Sam Gammon <sam@elide.ventures>
gu
post-install actions
37a2902
to
a571524
Compare
a571524
to
65d9ebe
Compare
@@ -1 +1,3 @@ | |||
build --enable_bzlmod | |||
build --java_runtime_version=graalvm_20 | |||
build --tool_java_runtime_version=graalvm_20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is how you use the GraalVM JVM as your Java Toolchain in Bazel, which you must do so that it can find the GraalVM org.graalvm.polyglot.Context
type.
the other way to do this is to install and build against org.graalvm.sdk:graal-sdk
from Maven, which provides these symbols on non-GraalVM runtimes.
@@ -7,7 +7,7 @@ module( | |||
|
|||
bazel_dep( | |||
name = "rules_java", | |||
version = "6.5.0", | |||
version = "6.4.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bazel 6 needs rules_java
6.4.0
or previous
extra_args = [ | ||
"--language:js", | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enabling the component in the native_image
: the components-ce
sample, which was on the release/0.10.x
branch, has taken on this test.
OutputStream myOut = new BufferedOutputStream(System.out); | ||
Context context = Context.newBuilder("js") | ||
.out(myOut) | ||
.allowAllAccess(true) | ||
.build(); | ||
context.eval("js", "42"); | ||
context.close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i've kept your test code, but moved it to components-ce
, where we are already testing components.
- fix: add requested component to list of effective components installed via bindist Fixes and closes #100. Thanks to @mantasindrasius for reporting! Relates-To: #100 Relates-To: #99 Signed-off-by: Sam Gammon <sam@elide.ventures>
this will ship with #80 instead of being merged directly into update: actually, i can split the test and fix commits so i can cherry-pick the fix on to |
5c9350a
to
035b51b
Compare
- fix: `startsWith` should be `startswith` - test: update `components-ce` test to include component usage Thank you to @mantasindrasius! Co-authored-by: Mantas Indrašius <mantasi@wix.com> Signed-off-by: Sam Gammon <sam@elide.ventures>
- test: add code to `components-ce` test to ensure `js` component is installed and usable Co-authored-by: Mantas Indrašius <mantasi@wix.com> Signed-off-by: Sam Gammon <sam@elide.ventures>
035b51b
to
2104679
Compare
Kudos, SonarCloud Quality Gate passed! |
@mantasindrasius We're good to go here. Here's what you should do: graalvm_repository(
name = "graalvm",
components = [
"js", # you only need this, not the `setup_action`
],
distribution = "oracle",
java_version = "20",
version = "20.0.2",
)
# ...
register_toolchains("@graalvm//:jvm") # registers the Java Toolchain
register_toolchains("@graalvm//:sdk") # registers the native-image toolchain In your
Then, in your native_image(
name = "main-native",
main_class = "Main",
deps = [":java"],
extra_args = [
"--language:js", # add this to build `js` into your `native-image`
],
) Note that there is no need to provide the This will build JS into your native image target; it also sets up your Java toolchains so you can build against the GraalVM SDK types. Once this PR is merged, you will want to use the |
Amazing. Thanks for responsiveness! |
I couldn't find a proper example as well as I didn't manage to make the graalvm working due to following issues:L
graalvm_bindist.bzl
.