-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Upgrade Bazel to 9.0.0 #21276
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
Open
redsun82
wants to merge
13
commits into
main
Choose a base branch
from
redsun82/bazel-9
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Upgrade Bazel to 9.0.0 #21276
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4f49ed8
chore: upgrade Bazel to 9.0.0
github-actions[bot] 764591f
feat: add rules_cc and rules_java module dependencies
github-actions[bot] ef43b3e
feat: add Python 3.12 toolchain registration
github-actions[bot] d4571d1
feat: add rules_cc to autoload configuration
github-actions[bot] a9fd6c9
refactor: migrate Starlark files to explicit rules_cc imports
github-actions[bot] 0379f94
refactor: migrate BUILD files to explicit rules_cc imports
github-actions[bot] 77a7e4e
refactor: migrate BUILD files to explicit rules_java imports
github-actions[bot] 8119aed
refactor: migrate C++ runfiles API from bazel_tools to rules_cc
github-actions[bot] 2483b89
fix: correct rules_nodejs metadata JSON formatting
github-actions[bot] dc2d396
fix: disable Android SDK auto-detection for Bazel 9 compatibility
github-actions[bot] 672ac8c
fix: upgrade rules_kotlin to 2.2.2 for Windows compatibility
redsun82 96a1464
Merge branch 'main' into HEAD
redsun82 53fcc9e
fix: sort use_repo alphabetically in rules_kotlin MODULE.bazel
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 8.4.2 | ||
| 9.0.0 |
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
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
2 changes: 2 additions & 0 deletions
2
javascript/extractor/test/com/semmle/js/extractor/test/BUILD.bazel
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| load("@rules_java//java:defs.bzl", "java_test") | ||
|
|
||
| java_test( | ||
| name = "test", | ||
| srcs = glob(["**/*.java"]), | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| load("@rules_cc//cc/common:cc_info.bzl", "CcInfo") | ||
|
|
||
| CmakeInfo = provider( | ||
| fields = { | ||
| "name": "", | ||
|
|
||
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
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
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
38 changes: 38 additions & 0 deletions
38
misc/bazel/registry/modules/rules_kotlin/2.2.2-codeql.1/MODULE.bazel
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| module( | ||
| name = "rules_kotlin", | ||
| version = "2.2.2-codeql.1", | ||
| compatibility_level = 1, | ||
| repo_name = "rules_kotlin", | ||
| ) | ||
|
|
||
| bazel_dep(name = "platforms", version = "0.0.11") | ||
| bazel_dep(name = "bazel_skylib", version = "1.7.1") | ||
| bazel_dep(name = "rules_java", version = "8.9.0") | ||
| bazel_dep(name = "rules_android", version = "0.6.4") | ||
| bazel_dep(name = "bazel_features", version = "1.25.0") | ||
| bazel_dep(name = "protobuf", version = "29.0", repo_name = "com_google_protobuf") | ||
| bazel_dep(name = "rules_proto", version = "6.0.2", repo_name = "rules_proto") | ||
| bazel_dep(name = "abseil-py", version = "2.1.0", repo_name = "py_absl") | ||
| bazel_dep(name = "rules_cc", version = "0.0.16") | ||
| bazel_dep(name = "bazel_worker_api", version = "0.0.8") | ||
| bazel_dep(name = "bazel_worker_java", version = "0.0.8") | ||
|
|
||
| rules_java_toolchains = use_extension("@rules_java//java:extensions.bzl", "toolchains") | ||
| use_repo(rules_java_toolchains, "remote_java_tools") | ||
|
|
||
| rules_kotlin_extensions = use_extension( | ||
| "//src/main/starlark/core/repositories:bzlmod_setup.bzl", | ||
| "rules_kotlin_extensions", | ||
| ) | ||
| use_repo( | ||
| rules_kotlin_extensions, | ||
| "com_github_google_ksp", | ||
| "com_github_jetbrains_kotlin", | ||
| "com_github_pinterest_ktlint", | ||
| "kotlin_build_tools_impl", | ||
| "kotlinx_serialization_core_jvm", | ||
| "kotlinx_serialization_json", | ||
| "kotlinx_serialization_json_jvm", | ||
| ) | ||
|
|
||
| register_toolchains("//kotlin/internal:default_toolchain") |
30 changes: 30 additions & 0 deletions
30
...stry/modules/rules_kotlin/2.2.2-codeql.1/patches/codeql_add_language_version_option.patch
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| --- a/src/main/starlark/core/options/opts.kotlinc.bzl 2000-01-01 01:00:00.000000000 +0100 | ||
| +++ b/src/main/starlark/core/options/opts.kotlinc.bzl 2025-11-17 16:51:01.012063056 +0100 | ||
| @@ -51,6 +51,11 @@ | ||
| return None | ||
| return ["-Xjdk-release=%s" % version] | ||
|
|
||
| +def _map_language_version_to_flag(version): | ||
| + if not version: | ||
| + return None | ||
| + return ["-language-version=%s" % version, "-api-version=%s" % version] | ||
| + | ||
| _KOPTS_ALL = { | ||
| "include_stdlibs": struct( | ||
| args = dict( | ||
| @@ -495,6 +500,15 @@ | ||
| value_to_flag = None, | ||
| map_value_to_flag = _map_warning_level, | ||
| ), | ||
| + "language_version": struct( | ||
| + args = dict( | ||
| + default = "1.9", | ||
| + doc = "-language-version", | ||
| + ), | ||
| + type = attr.string, | ||
| + value_to_flag = None, | ||
| + map_value_to_flag = _map_language_version_to_flag, | ||
| + ), | ||
| } | ||
|
|
||
| def _merge(key, rule_defined): |
14 changes: 14 additions & 0 deletions
14
...bazel/registry/modules/rules_kotlin/2.2.2-codeql.1/patches/codeql_do_not_emit_jdeps.patch
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| Emitting jdeps is broken for the 2.0.0 kotlin extractor, and we don't need those files. | ||
| Patching it here rather than passing `--@rules_kotlin//kotlin/settings:jvm_emit_jdeps=false` | ||
| allows us to not have to specify that option (and therefore pull in `rules_kotlin`) in `semmle-code`. | ||
| --- a/kotlin/settings/BUILD.bazel | ||
| +++ b/kotlin/settings/BUILD.bazel | ||
| @@ -16,6 +16,6 @@ release_archive( | ||
| # Flag that controls the emission of jdeps files during kotlin jvm compilation. | ||
| bool_flag( | ||
| name = "jvm_emit_jdeps", | ||
| - build_setting_default = True, # Upstream default behavior | ||
| + build_setting_default = False, | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
9 changes: 9 additions & 0 deletions
9
misc/bazel/registry/modules/rules_kotlin/2.2.2-codeql.1/source.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "integrity": "sha256-QR2yavs0ksyDUbW1NJkxUir+LFTyZRttEncwoSVtD2A=", | ||
| "url": "https://github.com/bazelbuild/rules_kotlin/releases/download/v2.2.2/rules_kotlin-v2.2.2.tar.gz", | ||
| "patches": { | ||
| "codeql_add_language_version_option.patch": "sha256-HoH8NWXxmYHmm/SxaugRdXgMntvcQx5gRLW2yQIvWhM=", | ||
| "codeql_do_not_emit_jdeps.patch": "sha256-gIlhXEY71vlCkpr5wj2vm3yv6RwcuKLhgbTGqdVvQfU=" | ||
| }, | ||
| "patch_strip": 1 | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ | |
| ], | ||
| "versions": [ | ||
| "2.2.0-codeql.1", | ||
| "2.2.2-codeql.1" | ||
| ], | ||
| "yanked_versions": {} | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,3 @@ | ||
| { | ||
| "versions": [ | ||
| "6.2.0-codeql.1" | ||
| ] | ||
| } | ||
| "6.2.0-codeql.1" | ||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| load("@rules_cc//cc:defs.bzl", "cc_library") | ||
|
|
||
| cc_library( | ||
| name = "extractor_shared", | ||
| srcs = glob(["*.cpp"]), | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| load("@rules_cc//cc:defs.bzl", "cc_library") | ||
|
|
||
| cc_library( | ||
| name = "logging", | ||
| srcs = glob(["*.cpp"]), | ||
|
|
||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JSON file is malformed after the changes. Line 3 should be part of a complete JSON array, but it's missing the closing bracket and brace. The file should be:
The diff shows lines being removed but line 3 appears incomplete in the result.