Skip to content
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

Plugin doesn't work with Bazel 1.0.0rc2 #1166

Closed
davido opened this issue Sep 12, 2019 · 6 comments
Closed

Plugin doesn't work with Bazel 1.0.0rc2 #1166

davido opened this issue Sep 12, 2019 · 6 comments
Labels
product: IntelliJ IntelliJ plugin topic: bazel Bazel integration (external repositories, aspects, flags, etc) type: bug

Comments

@davido
Copy link

davido commented Sep 12, 2019

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

@gertvdijk
Copy link

gertvdijk commented Sep 12, 2019

Do you also experience plain crashes? #1161

(Also, as mentioned there, my company-internal project works just fine for me.)

@davido
Copy link
Author

davido commented Sep 12, 2019

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 (4b4b818):

  $ 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] bazelbuild/bazel#7598
[2] 5f03bde
[3] https://github.com/davido/intellij/releases/tag/intellij-2019.2_bazel-1.0.0

@gertvdijk
Copy link

Thank you so much! I can confirm that this works for me as well.

Now waiting for a proper release. :)

@jin
Copy link
Member

jin commented Sep 13, 2019

The plugin containing this fix (5f03bde) is expected to be available early next week.

@jin jin added topic: bazel Bazel integration (external repositories, aspects, flags, etc) product: IntelliJ IntelliJ plugin type: bug labels Sep 13, 2019
@davido
Copy link
Author

davido commented Sep 24, 2019

@jin Any updates on this?

@ittaiz
Copy link
Member

ittaiz commented Oct 31, 2019

@davido maybe it should be closed since #1213 is closed

@davido davido closed this as completed Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product: IntelliJ IntelliJ plugin topic: bazel Bazel integration (external repositories, aspects, flags, etc) type: bug
Projects
None yet
Development

No branches or pull requests

4 participants