toolchains_llvm icon indicating copy to clipboard operation
toolchains_llvm copied to clipboard

User provided platform constraints

Open nickjmeyer opened this issue 1 year ago • 3 comments

Hello,

Using this repo, I currently have a tool chain set up to build for target Linux x86_64 and Linux aarch64 all on a host Linux x86_64 machine. I have a third platform I need to support that is another Linux aarch64 target. Is there a way to provide additional platform constraints to enable defining multiple platforms with the same target arch / os? From reading through the repository, it appears not given the exec_compatible_with attribute is set to only specify os and arch.

If not supported, any code pointers as to how you'd extend it to do so?

nickjmeyer avatar Jul 29 '24 01:07 nickjmeyer

This could be wired up in a similar way to target_settings defined here: https://github.com/bazel-contrib/toolchains_llvm/blob/e3c57fc322e684daa656444cbc01435fa0884707/toolchain/internal/repo.bzl#L240

The LLVM extension could receive new tag_classes for, say, extra_target_compatible_with and extra_exec_compatible_with that are similar to the ones defined here (just taking an attr.label_list instead of an attr.label: https://github.com/bazel-contrib/toolchains_llvm/blob/e3c57fc322e684daa656444cbc01435fa0884707/toolchain/extensions/llvm.bzl#L82-L89

fmeum avatar Aug 05 '24 08:08 fmeum

I've opened an MR with an implementation of this here (https://github.com/bazel-contrib/toolchains_llvm/pull/371).

jkurland-roku avatar Aug 09 '24 14:08 jkurland-roku

Thanks for the pointers!

nickjmeyer avatar Aug 17 '24 16:08 nickjmeyer