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

Don't register toolchain based on host platform #455

Open
sluongng opened this issue Sep 4, 2024 · 1 comment
Open

Don't register toolchain based on host platform #455

sluongng opened this issue Sep 4, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@sluongng
Copy link

sluongng commented Sep 4, 2024

It seems like the current repository rules are setting up graalvm toolchain based on rctx.os, which works for local execution.

However, if you try to do a cross-platform build using remote execution, i.e. using a MacOS ARM64 laptop to remote build on a Linux AMD64 RBE setup, then the repository rule would prepare the wrong binary (i.e. download the MacOS binary to upload + execute on Linux RBE worker).

A better approach would be similar to rules_go: declare a matrix of common CPU/Arch and register all of the toolchains available matching that matrix. Toolchains are lazily loaded, so registering them will not cause them to be downloaded. They will be downloaded automatically by Bazel according to the build dependency graph.

@sluongng
Copy link
Author

sluongng commented Sep 4, 2024

Particularly, here is the failure I am getting while trying to run tests in bazel.git remotely on RBE:

# //src:turbine_direct_graal_zip

{"msg":"exec container process `/buildbuddy/remotebuilds/36651e75-f6cf-4ffb-9fac-cdbc5da8584a/external/rules_graalvm++graalvm+graalvm/bin/native-image`: Exec format error","level":"error","time":"2024-09-04T11:13:52.813364Z"}

This is because the repository rule made Bazel use the MacOS native-image binary instead of a Linux binary.

@sgammon sgammon added the bug Something isn't working label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants