Repository navigation
Bump rules_kotlin from 2.2.2-codeql.1 to 2.4.21-codeql.1 #22950
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| CodeQL still builds extractors with Kotlin 1.8 and 1.9 language/API versions. | ||
| Keep those supported and keep the API version aligned with the language version. | ||
| --- a/src/main/starlark/core/options/opts.kotlinc.bzl | ||
| +++ b/src/main/starlark/core/options/opts.kotlinc.bzl | ||
| @@ -93,9 +93,7 @@ | ||
| def _map_language_version_to_flag(version): | ||
| if not version: | ||
| return None | ||
| - if int(version.split(".")[0]) < 2: | ||
| - fail("rules_kotlin requires language_version 2.0 or newer; got %s" % version) | ||
| - return ["-language-version=%s" % version] | ||
| + return ["-language-version=%s" % version, "-api-version=%s" % version] | ||
|
|
||
| def _map_xxlanguage_to_flag(values): | ||
| return ["-XXLanguage:%s" % v for v in values] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,12 +4,12 @@ allows us to not have to specify that option (and therefore pull in `rules_kotli | |
| internal repo. | ||
| --- a/kotlin/settings/BUILD.bazel | ||
| +++ b/kotlin/settings/BUILD.bazel | ||
| @@ -16,6 +16,6 @@ release_archive( | ||
| @@ -16,7 +16,7 @@ | ||
| # 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, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again just carries over. Note the comment at the top of this file. |
||
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| rules_kotlin 2.4 propagates the Kotlin warning mode to javac, so the extractor's | ||
| Kotlin warn = "error" setting also makes Java warnings fatal. This breaks the | ||
| Java 8 target with JDK 25's obsolete source/target option warnings. Keep Kotlin | ||
| warnings-as-errors for Kotlin compilation without changing javac warning behavior. | ||
| --- a/kotlin/internal/jvm/compile.bzl | ||
| +++ b/kotlin/internal/jvm/compile.bzl | ||
| @@ -1162,21 +1162,6 @@ | ||
| for flag in javac_options_to_flags(plugin[JavacOptions]) | ||
| ]) | ||
|
|
||
| - # Compile the Java half with the same warning mode as the kotlin part, unless the javac | ||
| - # options (or a plugin's) already set one: a single `warn` value governs the whole target. | ||
| - # A per-diagnostic level in `x_warning_level` limits the derivation, because javac has no | ||
| - # equivalent of `-Xwarning-level`. A diagnostic kept at `warning` or `disabled` under | ||
| - # `warn = "error"` must not turn every javac warning into an error, and a diagnostic raised | ||
| - # to `warning` or `error` under `warn = "off"` must not silence every javac warning. | ||
| - if "-nowarn" not in javac_opts and "-Werror" not in javac_opts: | ||
| - kotlinc_warn = getattr(kotlinc_options, "warn", None) if kotlinc_options else None | ||
| - warning_levels = (getattr(kotlinc_options, "x_warning_level", None) if kotlinc_options else None) or {} | ||
| - levels = warning_levels.values() | ||
| - if kotlinc_warn == "off" and "error" not in levels and "warning" not in levels: | ||
| - javac_opts.append("-nowarn") | ||
| - elif kotlinc_warn == "error" and "warning" not in levels and "disabled" not in levels: | ||
| - javac_opts.append("-Werror") | ||
| - | ||
| java_info = java_common.compile( | ||
| ctx, | ||
| source_files = srcs.java, |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "integrity": "sha256-qjJVRS2+m1LaK6d4fwhl8QeAWIUQnznD1br8IaUhvLY=", | ||
| "url": "https://github.com/bazel-contrib/rules_kotlin/releases/download/v2.4.21/rules_kotlin-v2.4.21.tar.gz", | ||
| "patches": { | ||
| "codeql_add_language_version_option.patch": "sha256-ml0fzhPwNozMi6yKtEn9YLM8LSQE4BWiimdwYzennCo=", | ||
| "codeql_do_not_emit_jdeps.patch": "sha256-yoBFnSWJyeF+gyhX+03TMTnRxUQJjup/f/KORdxVsAE=", | ||
| "codeql_do_not_propagate_kotlin_warning_mode_to_javac.patch": "sha256-TvfKfINvi1/tcLq3HDUs2doD4kr8AkMv0nsZvUHPjwg=" | ||
| }, | ||
| "patch_strip": 1 | ||
| } |
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.
Why do we need to add
-api-version?Uh oh!
There was an error while loading. Please reload this page.
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.
This just carries over from the patch I'm updating here. See also the comment at the top of this file.