Skip to content

Commit 964cdb4

Browse files
committed
Bazel: work around rule_kotlin windows problem with a patch
1 parent 0969473 commit 964cdb4

12 files changed

+28
-99
lines changed

MODULE.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ bazel_dep(name = "bazel_skylib", version = "1.7.1")
2424
bazel_dep(name = "abseil-cpp", version = "20240116.1", repo_name = "absl")
2525
bazel_dep(name = "nlohmann_json", version = "3.11.3", repo_name = "json")
2626
bazel_dep(name = "fmt", version = "10.0.0")
27-
bazel_dep(name = "rules_kotlin", version = "2.1.3-codeql.1")
27+
bazel_dep(name = "rules_kotlin", version = "2.1.3-codeql.2")
2828
bazel_dep(name = "gazelle", version = "0.40.0")
2929
bazel_dep(name = "rules_dotnet", version = "0.17.4")
3030
bazel_dep(name = "googletest", version = "1.14.0.bcr.1")

misc/bazel/registry/fix.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ def update(data):
5252
p.name: sha256(p) for p in version.joinpath("patches").iterdir()
5353
})
5454
patch_file(version / "MODULE.bazel",
55-
lambda s: re.sub(r'''version\s*=\s*['"].*['"]''', f'version = "{version.name}"', s, 1))
55+
lambda s: re.sub(r'''version\s*=\s*['"].*['"]''', f'version = "{version.name}"', s, count=1))

misc/bazel/registry/modules/rules_kotlin/2.0.0-codeql.1/MODULE.bazel

-35
This file was deleted.

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

-34
This file was deleted.

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

-9
This file was deleted.

misc/bazel/registry/modules/rules_kotlin/2.1.3-codeql.1/patches/codeql_do_not_emit_jdeps.patch

-16
This file was deleted.

misc/bazel/registry/modules/rules_kotlin/2.1.3-codeql.1/MODULE.bazel renamed to misc/bazel/registry/modules/rules_kotlin/2.1.3-codeql.2/MODULE.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module(
22
name = "rules_kotlin",
3-
version = "2.1.3-codeql.1",
3+
version = "2.1.3-codeql.2",
44
compatibility_level = 1,
55
repo_name = "rules_kotlin",
66
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Workaround against build error on windows, as inspired by
2+
https://github.com/bazel-contrib/rules_jvm_external/pull/1297#issuecomment-2751599009
3+
4+
diff --git a/src/main/kotlin/BUILD.release.bazel b/src/main/kotlin/BUILD.release.bazel
5+
index 91ad31c..ecff81f 100644
6+
--- a/src/main/kotlin/BUILD.bazel
7+
+++ b/src/main/kotlin/BUILD.bazel
8+
@@ -13,6 +13,7 @@
9+
# limitations under the License.
10+
11+
load("@rules_java//java:defs.bzl", "java_binary", "java_import")
12+
+load("//kotlin/compiler:compiler.bzl", _KOTLIN_STDLIBS = "KOTLIN_STDLIBS")
13+
14+
java_import(
15+
name = "worker",
16+
@@ -79,6 +80,7 @@ java_binary(
17+
jvm_flags = [
18+
"-XX:-MaxFDLimit",
19+
],
20+
+ data = _KOTLIN_STDLIBS,
21+
main_class = "io.bazel.kotlin.builder.cmd.MergeJdeps",
22+
visibility = ["//visibility:public"],
23+
runtime_deps = [":jdeps_merger_worker"],

misc/bazel/registry/modules/rules_kotlin/2.1.3-codeql.1/source.json renamed to misc/bazel/registry/modules/rules_kotlin/2.1.3-codeql.2/source.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"url": "https://github.com/bazelbuild/rules_kotlin/releases/download/v2.1.3/rules_kotlin-v2.1.3.tar.gz",
44
"patches": {
55
"codeql_do_not_emit_jdeps.patch": "sha256-1ir4Aio1SICxnj1wafQ0GefT/m7bwn2n+SQwq19V3A8=",
6+
"fix_jdeps_merged_on_windows.patch": "sha256-H5lMR40D5e00SrGPm+vxwEXiGZGw1EPOQe/mi5/9TKc=",
67
"codeql_add_language_version_option.patch": "sha256-F7RthnrO6kJlCNcQ76L1Utqll2OwyeFZ/HmT82NwgB4="
78
},
89
"patch_strip": 1

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
"github:bazelbuild/rules_kotlin"
2222
],
2323
"versions": [
24-
"2.1.3-codeql.1",
25-
"2.0.0-codeql.1"
24+
"2.1.3-codeql.2"
2625
],
2726
"yanked_versions": {}
2827
}

0 commit comments

Comments
 (0)