Closed
Conversation
Bazel 9 removes native.cc_* and native.java_* rules from Starlark. These now return stub functions that fail at analysis time. The autoload mechanism (--incompatible_autoload_externally) that would automatically redirect these is disabled in Bazel 9 (bazelbuild/bazel#23043), so all usages must be converted to explicit loads from rules_cc and rules_java. Similarly, providers like CcInfo and APIs like cc_common are no longer available as globals and must be explicitly imported from their new locations. Version updates: - .bazelversion: 8.4.2 → 9.0.0 - MODULE.bazel: Added rules_cc 0.2.16, rules_java 9.0.3 dependencies - MODULE.bazel: Added Python 3.12 toolchain registration (rules_python 1.x requires explicit toolchain setup, no longer auto-registers) Bazelrc changes: - Removed --incompatible_strict_action_env (now default, flag removed in Bazel 9) - Removed --legacy_external_runfiles (now default false, flag removed) - Added +@rules_cc,+@rules_java,+@rules_shell to autoload for graceful migration BUILD/bzl migrations: - swift/rules.bzl: Added cc_binary, cc_library, CcInfo imports; changed native.cc_binary → cc_binary, native.cc_library → cc_library - misc/bazel/cmake/cmake.bzl: Added CcInfo import (used in provider returns) - misc/bazel/internal/zipmerge/BUILD.bazel: Added cc_binary, cc_library, cc_test - shared/cpp/BUILD.bazel, swift/logging/BUILD.bazel: Added cc_library load - javascript/extractor/test/.../BUILD.bazel: Added java_test load C++ runfiles API migration: - zipmerge_test.cpp: Bazel 9 moves the C++ runfiles library from @bazel_tools//tools/cpp/runfiles to @rules_cc//cc/runfiles. Updated include path and namespace accordingly.
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
This PR upgrades Bazel to version 9.0.0 and includes the necessary migration steps:
rules_ccandrules_javamodule dependenciesrules_ccto autoload configurationrules_ccimportsrules_ccimportsrules_javaimportsbazel_toolstorules_ccrules_nodejsmetadata JSON formatting