Skip to content
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

using the bazel cc toolchain #27

Closed
Tracked by #24
johnynek opened this issue Aug 15, 2023 · 2 comments · Fixed by #35
Closed
Tracked by #24

using the bazel cc toolchain #27

johnynek opened this issue Aug 15, 2023 · 2 comments · Fixed by #35
Milestone

Comments

@johnynek
Copy link
Collaborator

Thanks for taking up this repo!

I didn't see it in the readme, but have you looked at leveraging the cc_toolchain to set up a path for native-image so that it uses the same toolchain as the rest of bazel?

That's one issue we never tackled with the old code, actually the native images are not hermetic. This occasionally causes us some issues where we get cache hits, but since the glibc is different on the machine, the native-image doesn't actually run. I assume this is something that could be fixed if we made native-image hermetic and added tests for that.

Would be really lovely to have totally hermetic native-images from JVM code in a bazel repo.

@sgammon
Copy link
Owner

sgammon commented Aug 15, 2023

@johnynek you beat me to it! just commented on the previous andyscott/rules_graal#8

I've laid some of the development groundwork to approach this but haven't actually done it yet. Toolchains have drifted a bit and I need to re-learn some APIs.

OTOH, toolchain types have already landed for GVM and native-image themselves, which should let me resolve a GraalVM-specific javac and native-image even if the current toolchain isn't GVM.

Next up, I plan to use the --native-compiler-* flags in the native-image binary to pass in a toolchain-provided C compiler and expose the ability to pass custom cflags. Uber's hermetic cc toolchain is installed so I can test against Zig eventually.

What do you think? Is this a solid approach in your view?

@sgammon sgammon added this to the 1.0.0 milestone Aug 15, 2023
@sgammon sgammon mentioned this issue Aug 14, 2023
22 tasks
@sgammon sgammon linked a pull request Aug 18, 2023 that will close this issue
17 tasks
@sgammon
Copy link
Owner

sgammon commented Aug 23, 2023

@johnynek done and i've invited you to be a collaborator :) there is a discussion where feedback can be shared after testing, and these rules now support a full drop-in replacement for rules_graal (no need to switch rules, just a load change from @rules_graal to @rules_graalvm).

relates to andyscott/rules_graal#10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

2 participants