You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just wanted to add a note: I haven't created a minimal project reproducing this yet but I did read the code and I can't find an assignment before it's used. If you need a minimal reproducing project I can look into that as well.
avarun42
added a commit
to avarun42/rules_kotlin
that referenced
this issue
Jan 13, 2023
`compile.bzl` was incorrectly referencing `java_info` instead of `java_infos` in cases where annotation processors were found, causing compilation to fail with an opaque error (bazelbuild#877). This fixes the reference.
* Fix reference to java_infos in compile.bzl
`compile.bzl` was incorrectly referencing `java_info` instead of `java_infos` in cases where annotation processors were found, causing compilation to fail with an opaque error (#877). This fixes the reference.
* Replace incorrect property access on list with list comprehension
Fixing the typo resulted in the following error:
```
Traceback (most recent call last):
File "/workdir/kotlin/internal/jvm/impl.bzl", line 219, column 36, in kt_jvm_library_impl
_kt_jvm_produce_jar_actions(ctx, "kt_jvm_library") if ctx.attr.srcs or ctx.attr.resources else export_only_providers(
File "/workdir/kotlin/internal/jvm/compile.bzl", line 493, column 50, in kt_jvm_produce_jar_actions
outputs_struct = _run_kt_java_builder_actions(
File "/workdir/kotlin/internal/jvm/compile.bzl", line 751, column 66, in _run_kt_java_builder_actions
ap_class_jar = [jars.class_jar for jars in java_infos.outputs.jars][0],
Error: 'list' value has no field or method 'outputs'
```
`java_infos` is a list and thus doesn't have an `outputs` field, but each `java_info` inside the list does. Thus replacing `java_infos.outputs.jars` with the list comprehension `[java_info.outputs.jars for java_info in java_infos]` gets us a list of `jars` objects that can be used in the outer list comprehension.
* extract out inner list comprehension
* flatten list of jars lists
Found this issue while attempting to upgrade from 1.5 to 1.6. If there are annotation processors, we try to access
java_info
which is not assigned:The text was updated successfully, but these errors were encountered: