Draft
Conversation
Bazel 9 removes native.cc_* and native.java_* rules from Starlark, requiring explicit imports from rules_cc and rules_java.
Add explicit dependencies required for Bazel 9: - rules_cc 0.2.16: provides cc_binary, cc_library, cc_test - rules_java 9.0.3: provides java_* rules Also update related dependencies: - rules_go: 0.56.1 → 0.59.0 (compatibility with Bazel 9) - gazelle: 0.40.0 → 0.47.0 (compatibility with rules_go 0.59.0) - rules_nodejs: 6.2.0-codeql.1 → 6.7.3 (upstream version)
rules_python 1.x requires explicit toolchain setup and no longer auto-registers toolchains. Register Python 3.12 toolchain to ensure Python tools work correctly with Bazel 9.
Add +@rules_cc to --incompatible_autoload_externally to enable graceful migration path for cc_* rule usages before all files are updated with explicit imports.
Bazel 9 removes native.cc_* and CcInfo from global scope. Update: - swift/rules.bzl: Add cc_binary, cc_library, CcInfo imports; use explicit cc_binary/cc_library instead of native.cc_* - misc/bazel/cmake/cmake.bzl: Add CcInfo import for provider usage
Add explicit load statements for cc_binary, cc_library, and cc_test from @rules_cc//cc:defs.bzl in: - shared/cpp/BUILD.bazel - swift/logging/BUILD.bazel - misc/bazel/internal/zipmerge/BUILD.bazel
Add explicit load statements for java_library and java_test from @rules_java//java:defs.bzl in: - javascript/extractor/BUILD.bazel - javascript/extractor/test/com/semmle/js/extractor/test/BUILD.bazel
Bazel 9 moves the C++ runfiles library from @bazel_tools to @rules_cc. Update: - zipmerge_test.cpp: Change include from tools/cpp/runfiles to rules_cc/cc/runfiles and update namespace accordingly - BUILD.bazel: Update dependency from @bazel_tools//tools/cpp/runfiles to @rules_cc//cc/runfiles
Fix malformed JSON in metadata file - remove trailing comma after last array element.
c3452fb to
2483b89
Compare
rules_android has repository visibility issues with Bazel 9 when the Android SDK is present. Since we don't use Android, disable detection by setting ANDROID_HOME to empty.
Upgrade from 2.2.0-codeql.1 to 2.2.2-codeql.1 which includes: - Fix Windows bzlmod builder classpath issue - Move to official bazel worker api This eliminates the need for --legacy_external_runfiles on Windows. Also fix codegen templates to be included in runfiles.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrade Bazel from 8.x to 9.0.0.
Bazel 9 removes
native.cc_*andnative.java_*rules from Starlark scope, requiring explicit imports fromrules_ccandrules_java.Changes
Core upgrade
.bazelversionNew module dependencies
rules_cc0.2.16: providescc_binary,cc_library,cc_testrules_java9.0.3: providesjava_*rulesrules_go0.56.1 → 0.59.0 (Bazel 9 compatibility)gazelle0.40.0 → 0.47.0 (rules_go 0.59.0 compatibility)rules_nodejs6.2.0-codeql.1 → 6.7.3 (upstream version)rules_kotlin2.2.0-codeql.1 → 2.2.2-codeql.1 (Windows bzlmod fix)Configuration
+@rules_ccto--incompatible_autoload_externallyfor graceful migrationANDROID_HOME=) to avoidrules_androidBazel 9 compatibility issuesStarlark migrations
load()statements forcc_binary,cc_library,CcInfoin.bzlfilesnative.cc_*calls with explicit rule namesBUILD file migrations
load()forcc_binary,cc_library,cc_testfrom@rules_cc//cc:defs.bzlload()forjava_library,java_testfrom@rules_java//java:defs.bzlC++ runfiles API migration
@bazel_tools//tools/cpp/runfilesto@rules_cc//cc/runfileszipmerge_test.cppWindows compatibility fixes
rules_kotlinto 2.2.2 which fixes Windows bzlmod builder classpath issuesFixes
rules_nodejsmetadata (trailing comma)