Open anguslees opened 2 months ago
Bazel will soon provide a way for adding constraints to the host toolchain. We could add a synthetic "is host" constraint and then add that constraint to exec_compatible_with
here. What do you think?
In the meantime, adding just HOST_CONSTRAINTS
seems like a good step forward. Do you want to send a PR?
@bazel_tools//tools/sh:sh_configure
is a repo rule that detects and configuressh_toolchain
(path tobash
), by querying the local host.The guts of the generated repo rule are: https://github.com/bazelbuild/bazel/blob/0f760395e04cb0accb912be128b4f363663e8d30/tools/sh/sh_configure.bzl#L59-L69
I think this needs at least
exec_compatible_with = HOST_CONSTRAINTS
or else this path will incorrectly be used on other exec platforms. (HOST_CONSTRAINTS isn't specific enough, but it's the best we've got.)