bazelbuild / rules_cc

C++ Rules for Bazel
https://bazel.build
Apache License 2.0
181 stars 89 forks source link

Move examples from deprecated @rules_cc//cc:find_cpp_toolchain -> @bazel_tools//tools/cpp:toolchain_utils.bzl #129

Closed cpsauer closed 2 years ago

cpsauer commented 2 years ago

Hey wonderful Bazel folks,

I'd been following this example (linked from https://docs.bazel.build/versions/main/integrating-with-rules-cc.html). While doing, I happened to notice that the code was still calling the deprecated find_cpp_toolchain. This threw me for a quick loop on Bazel rolling, so I figured I'd toss up a quick PR to fix it. See discussion below about \@bazel_tools.

Deprecation comment here: https://github.com/bazelbuild/rules_cc/blob/main/cc/toolchain_utils.bzl

Thanks for all you do! Chris (ex-Googler)

cpsauer commented 2 years ago

Originally, I'd changed the calls to the non-deprecated equivalent in \@rules_cc, but then I wondered if maybe you'd want to point to the \@bazel_tools one instead because that's what the docs reference?

This user is unclear whether the current philosophy is pointing people to rules_cc or bazel_tools, but it still seems like it might make sense to standardize the examples to reduce confusion.

cpsauer commented 2 years ago

I returned to this and decided that since the docs and the rest of the toolchain code pretty uniformly referenced \@bazel_tools instead, I'd add a commit standardizing around \@bazel_tools. Seems right to me, but the first commit is still there if you'd rather merge it, instead.

cpsauer commented 2 years ago

Thanks for getting to these, @oquenchil! Cheers (lmk if you need anything more before merging)

cpsauer commented 2 years ago

Yay! Thanks @oquenchil