Skip to content

Commit 2266123

Browse files
jketemaCopilot
andcommitted
Use upstream rules_kotlin 2.4.21 module
The BCR already provides the release's corrected module metadata, so consume 2.4.21 directly instead of maintaining a duplicate CodeQL registry entry and patches. Retain the Kotlin string conversion fix required by the upgraded compiler. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 05f8fa3 commit 2266123

9 files changed

Lines changed: 60 additions & 36 deletions

File tree

‎MODULE.bazel‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ bazel_dep(name = "bazel_skylib", version = "1.9.0")
2626
bazel_dep(name = "abseil-cpp", version = "20260107.1", repo_name = "absl")
2727
bazel_dep(name = "nlohmann_json", version = "3.12.0.bcr.1", repo_name = "json")
2828
bazel_dep(name = "fmt", version = "12.1.0-codeql.1")
29-
bazel_dep(name = "rules_kotlin", version = "2.4.21-codeql.1")
29+
bazel_dep(name = "rules_kotlin", version = "2.4.21")
3030
bazel_dep(name = "gazelle", version = "0.54.0")
3131
bazel_dep(name = "rules_dotnet", version = "0.21.5-codeql.1")
3232
bazel_dep(name = "googletest", version = "1.18.0.bcr.1")

misc/bazel/registry/modules/rules_kotlin/2.4.21-codeql.1/MODULE.bazel renamed to misc/bazel/registry/modules/rules_kotlin/2.2.2-codeql.1/MODULE.bazel

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
"""Bazel module manifest for the released rules_kotlin package."""
2-
31
module(
42
name = "rules_kotlin",
5-
version = "2.4.21-codeql.1",
3+
version = "2.2.2-codeql.1",
64
compatibility_level = 1,
75
repo_name = "rules_kotlin",
86
)
97

108
bazel_dep(name = "platforms", version = "0.0.11")
11-
bazel_dep(name = "bazel_skylib", version = "1.8.2")
9+
bazel_dep(name = "bazel_skylib", version = "1.7.1")
1210
bazel_dep(name = "rules_java", version = "8.9.0")
13-
bazel_dep(name = "rules_license", version = "1.0.0")
14-
bazel_dep(name = "rules_android", version = "0.7.3")
15-
bazel_dep(name = "bazel_features", version = "1.39.0")
16-
bazel_dep(name = "bazel_lib", version = "3.1.0")
11+
bazel_dep(name = "rules_android", version = "0.6.4")
12+
bazel_dep(name = "bazel_features", version = "1.25.0")
13+
bazel_dep(name = "protobuf", version = "29.0", repo_name = "com_google_protobuf")
14+
bazel_dep(name = "rules_proto", version = "6.0.2", repo_name = "rules_proto")
15+
bazel_dep(name = "abseil-py", version = "2.1.0", repo_name = "py_absl")
16+
bazel_dep(name = "rules_cc", version = "0.0.16")
17+
bazel_dep(name = "bazel_worker_api", version = "0.0.8")
18+
bazel_dep(name = "bazel_worker_java", version = "0.0.8")
1719

1820
rules_java_toolchains = use_extension("@rules_java//java:extensions.bzl", "toolchains")
1921
use_repo(rules_java_toolchains, "remote_java_tools")
@@ -24,16 +26,13 @@ rules_kotlin_extensions = use_extension(
2426
)
2527
use_repo(
2628
rules_kotlin_extensions,
27-
"btapi_impl",
2829
"com_github_google_ksp",
2930
"com_github_jetbrains_kotlin",
3031
"com_github_pinterest_ktlint",
31-
"jarjar",
32-
"kotlin_build_tools_api",
33-
"kotlinx_coroutines_core_jvm",
32+
"kotlin_build_tools_impl",
3433
"kotlinx_serialization_core_jvm",
3534
"kotlinx_serialization_json",
3635
"kotlinx_serialization_json_jvm",
3736
)
3837

39-
register_toolchains("//kotlin:default_toolchain")
38+
register_toolchains("//kotlin/internal:default_toolchain")
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
--- a/src/main/starlark/core/options/opts.kotlinc.bzl 2000-01-01 01:00:00.000000000 +0100
2+
+++ b/src/main/starlark/core/options/opts.kotlinc.bzl 2025-11-17 16:51:01.012063056 +0100
3+
@@ -51,6 +51,11 @@
4+
return None
5+
return ["-Xjdk-release=%s" % version]
6+
7+
+def _map_language_version_to_flag(version):
8+
+ if not version:
9+
+ return None
10+
+ return ["-language-version=%s" % version, "-api-version=%s" % version]
11+
+
12+
_KOPTS_ALL = {
13+
"include_stdlibs": struct(
14+
args = dict(
15+
@@ -495,6 +500,15 @@
16+
value_to_flag = None,
17+
map_value_to_flag = _map_warning_level,
18+
),
19+
+ "language_version": struct(
20+
+ args = dict(
21+
+ default = "1.9",
22+
+ doc = "-language-version",
23+
+ ),
24+
+ type = attr.string,
25+
+ value_to_flag = None,
26+
+ map_value_to_flag = _map_language_version_to_flag,
27+
+ ),
28+
}
29+
30+
def _merge(key, rule_defined):

misc/bazel/registry/modules/rules_kotlin/2.4.21-codeql.1/patches/codeql_do_not_emit_jdeps.patch renamed to misc/bazel/registry/modules/rules_kotlin/2.2.2-codeql.1/patches/codeql_do_not_emit_jdeps.patch

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ allows us to not have to specify that option (and therefore pull in `rules_kotli
44
internal repo.
55
--- a/kotlin/settings/BUILD.bazel
66
+++ b/kotlin/settings/BUILD.bazel
7-
@@ -19 +19 @@
7+
@@ -16,6 +16,6 @@ release_archive(
8+
# Flag that controls the emission of jdeps files during kotlin jvm compilation.
9+
bool_flag(
10+
name = "jvm_emit_jdeps",
811
- build_setting_default = True, # Upstream default behavior
912
+ build_setting_default = False,
13+
visibility = ["//visibility:public"],
14+
)
15+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"integrity": "sha256-QR2yavs0ksyDUbW1NJkxUir+LFTyZRttEncwoSVtD2A=",
3+
"url": "https://github.com/bazelbuild/rules_kotlin/releases/download/v2.2.2/rules_kotlin-v2.2.2.tar.gz",
4+
"patches": {
5+
"codeql_add_language_version_option.patch": "sha256-HoH8NWXxmYHmm/SxaugRdXgMntvcQx5gRLW2yQIvWhM=",
6+
"codeql_do_not_emit_jdeps.patch": "sha256-cg06knW+Eq13qHCaelbnZka/WnGPvRrcqXHtpXsy/rA="
7+
},
8+
"patch_strip": 1
9+
}

‎misc/bazel/registry/modules/rules_kotlin/2.4.21-codeql.1/patches/codeql_language_and_api_version.patch‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎misc/bazel/registry/modules/rules_kotlin/2.4.21-codeql.1/patches/module_dot_bazel_version.patch‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎misc/bazel/registry/modules/rules_kotlin/2.4.21-codeql.1/source.json‎

Lines changed: 0 additions & 10 deletions
This file was deleted.

‎misc/bazel/registry/modules/rules_kotlin/metadata.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"github:bazelbuild/rules_kotlin"
2222
],
2323
"versions": [
24-
"2.4.21-codeql.1"
24+
"2.2.2-codeql.1"
2525
],
2626
"yanked_versions": {}
2727
}

0 commit comments

Comments
 (0)