You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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.
The text was updated successfully, but these errors were encountered: