After upgrade of Bazel from 0.29.1 to 1.0.0rc2, intellij plugin doesn't work any more. To reproduce, clone recursively gerrit from this commit (b02962142671ff8d933f2d81a3d5aaa6558065c9) and try to import it in IntelliJ.
Bazel Console log in 0.29.1: [1].
Bazel Console log on 1.0.0rc2: [2].
Particularly: the external dependencies are not detected on 1.0.0rc2:
[...]
Parsing build outputs...
Total rules: 2139, new/changed: 154, removed: 495
Reading IDE info result...
Updating target map
Loaded 154 aspect files, total size 1080kB
Target map size: 597
Reading jdeps files...
Loaded 0 jdeps files, total size 0kB
Reading package manifests...
Java content entry count: 1
Updating Jar Cache...
Prefetching files...
Refreshing files
Computing directory structure...
Committing project structure...
Workspace has 0 libraries
While all is fine on 0.29.1:
[...]
Parsing build outputs...
Total rules: 2139, new/changed: 2139, removed: 0
Reading IDE info result...
Updating target map
Loaded 2139 aspect files, total size 3789kB
Target map size: 597
Reading jdeps files...
Loaded 207 jdeps files, total size 354kB
Reading package manifests...
Java content entry count: 22
Updating Jar Cache...
Prefetching files...
Refreshing files
Computing directory structure...
Committing project structure...
Workspace has 287 libraries
Environment:
IntelliJ IDEA Ultimate 2019.2.2
Bazel plugin: 2019.08.19.0.5
Do you also experience plain crashes? https://github.com/bazelbuild/intellij/issues/1161
(Also, as mentioned there, my company-internal project works just fine for me.)
Do you also experience plain crashes? #1161
I saw this exception once, but I'm quite sure, it is unrelated here.
I started to bisect the problem and then realized this exception:
ERROR: /home/davido/.cache/bazel/_bazel_davido/5c01f4f713b675540b8b424c5c647f63/external/flexmark/jar/BUILD:4:1: in @intellij_aspect//:intellij_info_bundled.bzl%intellij_info_aspect aspect on java_import rule @flexmark//jar:jar:
Traceback (most recent call last):
File "/home/davido/.cache/bazel/_bazel_davido/5c01f4f713b675540b8b424c5c647f63/external/flexmark/jar/BUILD", line 4
@intellij_aspect//:intellij_info_bundled.bzl%intellij_info_aspect(...)
File "/home/davido/.cache/bazel/_bazel_davido/5c01f4f713b675540b8b424c5c647f63/external/intellij_aspect/intellij_info_bundled.bzl", line 54, in _aspect_impl
intellij_info_aspect_impl(target, ctx, semantics)
File "/home/davido/.cache/bazel/_bazel_davido/5c01f4f713b675540b8b424c5c647f63/external/intellij_aspect/intellij_info_impl.bzl", line 893, in intellij_info_aspect_impl
collect_java_info(target, ctx, semantics, ide_info, <2 more arguments>)
File "/home/davido/.cache/bazel/_bazel_davido/5c01f4f713b675540b8b424c5c647f63/external/intellij_aspect/intellij_info_impl.bzl", line 516, in collect_java_info
java.outputs
The .java provider is deprecated and cannot be used when --incompatible_disallow_legacy_java_provider is set. Please migrate to the JavaInfo Starlark provider.
And then I looked into this code, and realized, that it is related to incompatible change: [1], that was already fixed in IntelliJ-Plugin in this CL: [2], but new plugin version wasn't released yet.
So that I went ahead and build the plugin from this commit (4b4b8187cfd657c2cdc1766d0c83342a03d5bf18):
$ bazel build //ijwb:ijwb_bazel_zip --define=ij_product=intellij-beta
Note, that ij_product=intellij-beta corresponds to: intellij-2019.2. If you are using older IJ version you want to pass "intellij-latest": "intellij-2019.1" version.
I imported the custom built plugin version in IJ 2019.2, and voil脿, it works as expected. I published it here: [3], it can be used until the official version is released.
[1] https://github.com/bazelbuild/bazel/issues/7598
[2] https://github.com/bazelbuild/intellij/commit/5f03bde0f02f5d1693a4567dc129230420a30372
[3] https://github.com/davido/intellij/releases/tag/intellij-2019.2_bazel-1.0.0
Thank you so much! I can confirm that this works for me as well.
Now waiting for a proper release. :)
The plugin containing this fix (https://github.com/bazelbuild/intellij/commit/5f03bde0f02f5d1693a4567dc129230420a30372) is expected to be available early next week.
@jin Any updates on this?
@davido maybe it should be closed since #1213 is closed
Most helpful comment
The plugin containing this fix (https://github.com/bazelbuild/intellij/commit/5f03bde0f02f5d1693a4567dc129230420a30372) is expected to be available early next week.