Commit d7cf3fd
authored
Fix reference to java_infos in compile.bzl (#915)
* 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 lists1 parent bd1ad8e commit d7cf3fd
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
746 | 746 | | |
747 | 747 | | |
748 | 748 | | |
| 749 | + | |
749 | 750 | | |
750 | 751 | | |
751 | | - | |
| 752 | + | |
752 | 753 | | |
753 | 754 | | |
754 | 755 | | |
| |||
0 commit comments