Skip to content

Commit 05f8fa3

Browse files
jketemaCopilot
andcommitted
Update rules_kotlin to 2.4.21 with CodeQL patches
Carry forward CodeQL's jdeps and language/API-version customizations for the new upstream release, and fix redundant string conversions rejected by the upgraded Kotlin compiler. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent a61f577 commit 05f8fa3

10 files changed

Lines changed: 37 additions & 61 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.2.2-codeql.1")
29+
bazel_dep(name = "rules_kotlin", version = "2.4.21-codeql.1")
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")

‎java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6966,7 +6966,7 @@ open class KotlinFileExtractor(
69666966
tw.writeExprs_stringliteral(id, type.javaResult.id, parent, idx)
69676967
tw.writeExprsKotlinType(id, type.kotlinResult.id)
69686968
extractExprContext(id, locId, enclosingCallable, enclosingStmt)
6969-
tw.writeNamestrings(toQuotedLiteral(v.toString()), v.toString(), id)
6969+
tw.writeNamestrings(toQuotedLiteral(v), v, id)
69706970
}
69716971
}
69726972
v == null -> {

‎misc/bazel/registry/modules/rules_kotlin/2.2.2-codeql.1/patches/codeql_add_language_version_option.patch‎

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

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

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

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

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1+
"""Bazel module manifest for the released rules_kotlin package."""
2+
13
module(
24
name = "rules_kotlin",
3-
version = "2.2.2-codeql.1",
5+
version = "2.4.21-codeql.1",
46
compatibility_level = 1,
57
repo_name = "rules_kotlin",
68
)
79

810
bazel_dep(name = "platforms", version = "0.0.11")
9-
bazel_dep(name = "bazel_skylib", version = "1.7.1")
11+
bazel_dep(name = "bazel_skylib", version = "1.8.2")
1012
bazel_dep(name = "rules_java", version = "8.9.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")
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")
1917

2018
rules_java_toolchains = use_extension("@rules_java//java:extensions.bzl", "toolchains")
2119
use_repo(rules_java_toolchains, "remote_java_tools")
@@ -26,13 +24,16 @@ rules_kotlin_extensions = use_extension(
2624
)
2725
use_repo(
2826
rules_kotlin_extensions,
27+
"btapi_impl",
2928
"com_github_google_ksp",
3029
"com_github_jetbrains_kotlin",
3130
"com_github_pinterest_ktlint",
32-
"kotlin_build_tools_impl",
31+
"jarjar",
32+
"kotlin_build_tools_api",
33+
"kotlinx_coroutines_core_jvm",
3334
"kotlinx_serialization_core_jvm",
3435
"kotlinx_serialization_json",
3536
"kotlinx_serialization_json_jvm",
3637
)
3738

38-
register_toolchains("//kotlin/internal:default_toolchain")
39+
register_toolchains("//kotlin:default_toolchain")

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ 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-
@@ -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",
7+
@@ -19 +19 @@
118
- build_setting_default = True, # Upstream default behavior
129
+ build_setting_default = False,
13-
visibility = ["//visibility:public"],
14-
)
15-
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
--- a/src/main/starlark/core/options/opts.kotlinc.bzl
2+
+++ b/src/main/starlark/core/options/opts.kotlinc.bzl
3+
@@ -98 +98 @@
4+
- return ["-language-version=%s" % version]
5+
+ return ["-language-version=%s" % version, "-api-version=%s" % version]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
--- a/MODULE.bazel
2+
+++ b/MODULE.bazel
3+
@@ -5 +5 @@
4+
- version = "1.9.0",
5+
+ version = "2.4.21-codeql.1",
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"integrity": "sha256-qjJVRS2+m1LaK6d4fwhl8QeAWIUQnznD1br8IaUhvLY=",
3+
"url": "https://github.com/bazel-contrib/rules_kotlin/releases/download/v2.4.21/rules_kotlin-v2.4.21.tar.gz",
4+
"patches": {
5+
"codeql_do_not_emit_jdeps.patch": "sha256-nS1N5h/nA2+y5nIdkdRxHGfp+m/EKq4B5UQF6DXzcYs=",
6+
"codeql_language_and_api_version.patch": "sha256-3ge9oiBmjhY7qPhYZpuN8E1e2Bv0ntsVpy98WOJv2To=",
7+
"module_dot_bazel_version.patch": "sha256-B7mPGSMEt4J5l+8aMpcrBP7pcvuPvxqPEfh8LXy5p0U="
8+
},
9+
"patch_strip": 1
10+
}

‎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.2.2-codeql.1"
24+
"2.4.21-codeql.1"
2525
],
2626
"yanked_versions": {}
2727
}

0 commit comments

Comments
 (0)