Bazel: load rules_cc and rules_shell explicitly#21373
Conversation
Turns out in #21371 I was right about `java_*` rules not relying on autoload anywhere, but it turns out some `cc_*` rules still relied on autoload. This autoload is currently configured in the internal repository, but we want to remove it eventually. This patch: * adds explicit loads to `rules_cc` * removes an obsolete file (that depedency has its own bazel module since some time, we just forgot to remove the old file)
There was a problem hiding this comment.
Pull request overview
This PR ensures explicit loading of rules_cc rules to prepare for Bazel 9 migration by removing reliance on autoload. Similar to PR #21371 which fixed autoload issues for Java rules, this change explicitly loads CC rules from @rules_cc//cc:defs.bzl.
Changes:
- Added explicit
loadstatements forcc_libraryandcc_binaryrules in swift third-party BUILD files - Removed obsolete BUILD.fmt.bazel file (fmt is now a proper Bazel module)
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| swift/third_party/BUILD.swift-llvm-support.bazel | Added explicit load for cc_library from rules_cc |
| swift/third_party/BUILD.picosha2.bazel | Added explicit load for cc_library from rules_cc |
| swift/third_party/BUILD.fmt.bazel | Removed obsolete file (fmt is now a Bazel module at misc/bazel/registry/modules/fmt/12.1.0-codeql.1/) |
| swift/third_party/BUILD.binlog.bazel | Added explicit load for cc_binary and cc_library from rules_cc |
rules_cc explicitlyrules_cc and rules_shell explicitly
esbena
left a comment
There was a problem hiding this comment.
LGTM.
But I wonder why this wasn't caught back then.
Don't we have CI checks for when relevant build rules change?
@esbena These are only called by builds from the internal repo. There we were currently setting We still want to get rid of this all, as the next release of bazel will make |
Turns out in #21371 I was right about
java_*rules not relying on autoload anywhere, but it turns out somecc_*andsh_*rules still relied on autoload. This autoload is currently configured in the internal repository, but we want to remove it eventually. This patch:rules_ccrules_shell