-
Notifications
You must be signed in to change notification settings - Fork 11
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
Toolchain customization #3
base: master
Are you sure you want to change the base?
Conversation
14d2e8c
to
3647c6f
Compare
I had to make some changes to the link line in order for any of my tests to run. I added directories based on the libraries I use but perhaps I'm missing some (or there is a better approach). |
29975c2
to
423763d
Compare
423763d
to
0644fa2
Compare
@oliverlee thanks for this contribution! Could you provide some context on the motivation for this addition (intended use case) as well as some context around the implementation? I've been away from this repo for a while (although depending on it daily) and it would help me review it effectively. |
I'm currently working with a number of repositories that all share a common tooling dependency that defines and registers toolchains. Some of the changes are motivated by wanting to reduce the amount of boilerplate that needs to be written and updated for downstream repositories. I'd like to set up multiple hermetic toolchains for a project (e.g. both GCC and Clang compilers) without needing to set While a lot of compiler options work for both GCC and Clang, there are some that are GCC or Clang specific so I'd like to avoid needing to use I'd also like registration of the bootlin toolchain to allow use without needing to manually specify a platform (e.g. I'm using a linux machine in CI that doesn't have C++ toolchains installed and toolchain registration picks up the bootlin toolchain as it is the only one satisfying host/target exec constraints). Currently I have something that looks like: # @tooling//:defs.bzl
def register_toolchains(...):
register_bootlin_toolchain(...) # e.g. gcc 11, linux, x86-64
register_bootlin_toolchain(...) # e.g. gcc 10, linux, x86-64
...
register_llvm_toolchain(...)
register_llvm_toolchain(...)
...
# other toolchains where This is used in the bazel build //... --extra_toolchains=@tooling//:llvm
bazel build //... --extra_toolchains=@tooling//:gcc
bazel build //... --extra_toolchains=@tooling//:gcc11
bazel build //... --extra_toolchains=@tooling//:gcc9 Also this PR is a work in progress as there are some issues with the current commit (eager fetching, wrong host cpu). |
No description provided.