Intellij: Support IntelliJ 2019.1

Created on 4 Dec 2018  Â·  24Comments  Â·  Source: bazelbuild/intellij

Just opening this issue so I can subscribe to when it is supported.

IntelliJ

Most helpful comment

Hm, looks like they have released it today :)

https://blog.jetbrains.com/idea/2019/03/intellij-idea-2019-1-is-released-theme-customization-java-12-switch-expressions-debug-inside-docker-containers-and-more/

Hopefully we'll get it supported by this plugin soon. Thanks!

All 24 comments

Running
> bazel build //ijwb:ijwb_bazel_zip --define=ij_product=intellij-2019.1

Gives me this:

ERROR: /Users/renat/projects/intellij/intellij_platform_sdk/BUILD:224:1: no such package '@intellij_ce_2019_1//': java.io.IOException: Error downloading [https://www.jetbrains.com/intellij-repository/releases/com/jetbrains/intellij/idea/ideaIC/191.6014.8/ideaIC-191.6014.8.zip] to /private/var/tmp/_bazel_renat/f4b62152e7eda4ffa9369669a17d1a11/external/intellij_ce_2019_1/ideaIC-191.6014.8.zip: GET returned 404 Not Found and referenced by '//intellij_platform_sdk:guava_for_external_binaries'
WARNING: /Users/renat/projects/intellij/java/BUILD:187:1: in java_import rule //java:jdk_tools_jar: target '//java:jdk_tools_jar' depends on deprecated target '@local_jdk//:langtools': Don't depend on targets in the JDK workspace; use @bazel_tools//tools/jdk:current_java_runtime instead (see https://github.com/bazelbuild/bazel/issues/5594)
ERROR: Analysis of target '//ijwb:ijwb_bazel_zip' failed; build aborted: Analysis failed
INFO: Elapsed time: 1.058s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)
    Fetching @intellij_ce_2019_1; fetching
    Fetching @go_2019_1; fetching
    Fetching @scala_2019_1; fetching
    Fetching @intellij_ue_2019_1; fetching
    Fetching @python_2019_1; fetching

Does it mean Intellij 2019.1 is still not supported? It's confusing as i can see it is mentioned there:
https://github.com/bazelbuild/intellij/blob/master/intellij_platform_sdk/build_defs.bzl#L22

IntelliJ 2019.1 is not yet supported. We generally wait until there's a full public release, or sometimes until the first dot release, as the release continues to stabilize well after the current RC stage.

Hm, looks like they have released it today :)

https://blog.jetbrains.com/idea/2019/03/intellij-idea-2019-1-is-released-theme-customization-java-12-switch-expressions-debug-inside-docker-containers-and-more/

Hopefully we'll get it supported by this plugin soon. Thanks!

For what it's worth, I was able to get this to Build with the following changes:

diff --git a/WORKSPACE b/WORKSPACE
index 3c6f1..fef11 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -20,8 +20,8 @@ http_archive(
 http_archive(
     name = "intellij_ce_2019_1",
     build_file = "@//intellij_platform_sdk:BUILD.idea",
-    sha256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-    url = "https://www.jetbrains.com/intellij-repository/releases/com/jetbrains/intellij/idea/ideaIC/191.6014.8/ideaIC-191.6014.8.zip",
+    sha256 = "f0f34e7d3f4e60b4649babe3d9cce7385d075d91254ce3db68c46c2dfb4c9531",
+    url = "https://www.jetbrains.com/intellij-repository/releases/com/jetbrains/intellij/idea/ideaIC/191.6183.87/ideaIC-191.6183.87.zip",
 )

 # The plugin api for IntelliJ UE 2018.3. This is required to run UE-specific
@@ -38,8 +38,8 @@ http_archive(
 http_archive(
     name = "intellij_ue_2019_1",
     build_file = "@//intellij_platform_sdk:BUILD.ue",
-    sha256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-    url = "https://www.jetbrains.com/intellij-repository/releases/com/jetbrains/intellij/idea/ideaIU/191.6014.8/ideaIU-191.6014.8.zip",
+    sha256 = "f0f34e7d3f4e60b4649babe3d9cce7385d075d91254ce3db68c46c2dfb4c9531",
+    url = "https://www.jetbrains.com/intellij-repository/releases/com/jetbrains/intellij/idea/ideaIU/191.6183.87/ideaIU-191.6183.87.zip",
 )

 # The plugin api for CLion 2018.3. This is required to build CLwB,
$ bazel build //ijwb:ijwb_bazel_zip --define=ij_product=intellij-ue-2019.1
$ ls bazel-bin/ijwb/ijwb_bazel.zip

Go to your IntelliJ: Preferences -> Plugins -> Settings icon -> Install from disk -> bazel-bin/ijwb/ijwb_bazel.zip

Note that some things are busted with this build, so don't rely on it for anything beyond basics.

@divyekapoor did you ran any steps before that? I get an error when trying to build it with bazel build //ijwb:ijwb_bazel_zip --define=ij_product=intellij-ue-2019.1:

ERROR: /projects/github/intellij/third_party/auto_value/BUILD:15:1: no such package '@auto_value//jar': java.io.IOException: thread interrupted and referenced by '//third_party/auto_value:auto_value_plugin'
ERROR: Analysis of target '//ijwb:ijwb_bazel_zip' failed; build aborted: no such package '@auto_value//jar': java.io.IOException: thread interrupted
INFO: Elapsed time: 111.240s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (60 packages loaded, 1803 targets configured)

https://github.com/bazelbuild/intellij/pull/619 is a full PR that works (but is not mergeable due to IO errors in the CD/CI pipeline & the lack of a CLA).
https://github.com/divyekapoor/intellij/tree/support-2019.1 is the git tree that I built the binary from.

@AlexITC - please check your Bazel version (and also try a bazel clean --expunge)

$ bazel version
Build label: 0.23.2-homebrew
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Mar 12 06:12:54 2019 (1552371174)
Build timestamp: 1552371174
Build timestamp as int: 1552371174

Requesting authors to come up with a fully integrable fix along these lines. Thanks!

It worked after updating master, no issues so far, thanks!

I've ran into this issue when doing a Blaze sync

null Working Set

There has been some refactoring in late March (most likely https://github.com/bazelbuild/intellij/commit/5b35628f21f20aa303d262740336577089eebe33) that is likely causing this. I've had luck applying the above changes to an older version of the plugin, e.g 4d6a4e6258792c8e977761672e76591ac84001f1 and rebuilding as above

The checksums for the 2019.1 downloads appear to be wrong in the WORKSPACE file, since I get errors like the following for both the CE and UE SDK downloads:

  • CE: Checksum was 600bfa4e334d7a03162a04deb9849be210cd34318efd76d83473171f221a8d27 but wanted d05abcfd50673c542558bcbd2c4853386e1e45b72759b8ed9bd374b87dc3a391
  • UE: Checksum was 388fb1b31e0a22ac3acf7dcf9cfee76aa63bee2b1e0aa68dee52fac30c4196b4 but wanted ef1d578bdbcc0a61607c096057822bd2d1a00319daa5ef4550934c7ca7f6ba4d

Details:

The CE download failed when running bazel build //ijwb:ijwb_bazel_zip --define=ij_product=intellij-2019.1:

Error downloading [https://www.jetbrains.com/intellij-repository/releases/com/jetbrains/intellij/idea/ideaIC/2019.1.1/ideaIC-2019.1.1.zip] to /private/var/tmp/_bazel_tdyas/3df4a685bdf85d40dde60d602eb75804/external/intellij_ce_2019_1/ideaIC-2019.1.1.zip: Checksum was 600bfa4e334d7a03162a04deb9849be210cd34318efd76d83473171f221a8d27 but wanted d05abcfd50673c542558bcbd2c4853386e1e45b72759b8ed9bd374b87dc3a391

The UE download also failed (via bazel build //ijwb:ijwb_bazel_zip --define=ij_product=intellij-ue-2019.1):

Error downloading [https://www.jetbrains.com/intellij-repository/releases/com/jetbrains/intellij/idea/ideaIU/2019.1.1/ideaIU-2019.1.1.zip] to /private/var/tmp/_bazel_tdyas/3df4a685bdf85d40dde60d602eb75804/external/intellij_ue_2019_1/ideaIU-2019.1.1.zip: Checksum was 388fb1b31e0a22ac3acf7dcf9cfee76aa63bee2b1e0aa68dee52fac30c4196b4 but wanted ef1d578bdbcc0a61607c096057822bd2d1a00319daa5ef4550934c7ca7f6ba4d

I am using bazel 0.23.2 on macOS (homebrew version). I tried building off the master branch at commit 4718668e710cdb05a6bb3605a7722aea7eff729a (4/18/2019). I ran bazel clean --expunge before running the commands that failed just to make sure there wasn't any cached state.

Full log from one of the runs:

$ bazel build //ijwb:ijwb_bazel_zip --define=ij_product=intellij-2019.1
DEBUG: Rule 'io_bazel_rules_scala' modified arguments {"shallow_since": "1552264604 -1000"}
DEBUG: Rule 'io_bazel_rules_kotlin' modified arguments {"shallow_since": "1543417067 +0100"}
INFO: Build option --define has changed, discarding analysis cache.
WARNING: /Users/tdyas/Code/bazelbuild-intellij/java/BUILD:177:1: in java_import rule //java:jdk_tools_jar: target '//java:jdk_tools_jar' depends on deprecated target '@local_jdk//:langtools': Don't depend on targets in the JDK workspace; use @bazel_tools//tools/jdk:current_java_runtime instead (see https://github.com/bazelbuild/bazel/issues/5594)
ERROR: /Users/tdyas/Code/bazelbuild-intellij/intellij_platform_sdk/BUILD:234:1: no such package '@intellij_ce_2019_1//': java.io.IOException: Error downloading [https://www.jetbrains.com/intellij-repository/releases/com/jetbrains/intellij/idea/ideaIC/2019.1.1/ideaIC-2019.1.1.zip] to /private/var/tmp/_bazel_tdyas/3df4a685bdf85d40dde60d602eb75804/external/intellij_ce_2019_1/ideaIC-2019.1.1.zip: Checksum was 600bfa4e334d7a03162a04deb9849be210cd34318efd76d83473171f221a8d27 but wanted d05abcfd50673c542558bcbd2c4853386e1e45b72759b8ed9bd374b87dc3a391 and referenced by '//intellij_platform_sdk:guava_for_external_binaries'
ERROR: Analysis of target '//ijwb:ijwb_bazel_zip' failed; build aborted: Analysis failed
INFO: Elapsed time: 30.200s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (4 packages loaded, 1759 targets configured)
    Fetching @intellij_ce_2019_1; fetching 29s
    Fetching @intellij_ue_2019_1; fetching 29s

@tdyas - Just update the checksums and it'll work. The question is: what's the official checksum?

@divyekapoor While I could do that as a workaround, that would ignore the underlying issue that this plugin has noted different checksums than what exists if I download and compute manually. Either a mistake was made in calculating those checksums, or the archives were changed since those archives were first downloaded by a developer of this plugin. The first is easy enough to fix, the latter has security implications. Even if there is a low probability of a malicious act, I'd rather know which before I update the checksums locally.

Downloading the archives manually and the URLs in the WORKSPACE file, I get the following checksums on macOS:

$ sha256sum ideaIC-2019.1.1.zip
600bfa4e334d7a03162a04deb9849be210cd34318efd76d83473171f221a8d27  ideaIC-2019.1.1.zip
$ sha256sum ideaIU-2019.1.1.zip
388fb1b31e0a22ac3acf7dcf9cfee76aa63bee2b1e0aa68dee52fac30c4196b4  ideaIU-2019.1.1.zip

I also downloaded https://www.jetbrains.com/intellij-repository/releases/com/jetbrains/intellij/idea/ideaIC/2019.1/ideaIC-2019.1.zip and got 8bd7ff641f482c68cfa30564bd5bb42cf75b521f5298d3a8189dcc147188c66a for the SHA256 checksum on the off-chance the checksum was for an earlier 2019.1 release. Neither that nor 600bfa4e334d7a03162a04deb9849be210cd34318efd76d83473171f221a8d27 for ideaIC-2019.1.1.zip matches the d05abcfd50673c542558bcbd2c4853386e1e45b72759b8ed9bd374b87dc3a391 checksum that the plugin expects.

I'll open a separate issue for now.

For anyone who didn't see the comment in @divyekapoor's PR, the Bazel team doesn't plan to work on this until "late-April to mid-May" - https://github.com/bazelbuild/intellij/pull/619#issuecomment-480506616 With luck, that means sometime soon. :)

I'm really hoping that the fix put in place makes it easy to avoid this problem in future: waiting for months after each IJ release makes it harder to persuade folks to try Bazel out.

The issue is that every new release I've seen in the last 3 years contains severe performance regressions, so we don't distribute them internally until the worst of these are found and fixed locally or upstream.

This github repo is a mirror of our internal repo, and gets support for new versions at the same time we do.

Separately, there's no fix in place here changing our release process. The sha256 hash issue mentioned here appears to be a legitimate problem on JetBrains' end (https://github.com/bazelbuild/intellij/issues/723).

Would it be possible to invert the relationship between the repos, and have this repo be the "source of truth"? Making every user of the plugin depend on the internal update timetable of IJ at Google seems to lack visibility at best.

Failing that, could we please get a new version of the Bazel IJ plugin shipped _somehow_ so we can carry on enjoying both Bazel and IJ at the same time :)

It's not practical or desirable for us to make this repo the source of truth. We have far more internal than external users of the plugin, and a lot of internal-specific customizations to integrate with internal tools and services. This github repo is a strict, relatively small subset of our project.

I understand it's not a great situation, but bazel support in IntelliJ is something we provide on a best-effort basis. If our internal blaze support / release process also works for bazel, that's fantastic, but when it doesn't we haven't historically had the bandwidth to improve things. It's something I'd think we'd all like to see changed in the future, but that's the current state.

For 2019.1 specifically, the next release (scheduled for May 10th) will support both IntelliJ and CLion 2019.1, barring any major performance regressions which might turn up over the next week.

Longer-term, I'll look at ways to ship new versions earlier, perhaps by building our bazel plugins against a canary branch.

If our internal blaze support / release process also works for bazel, that's fantastic, but when it doesn't we haven't historically had the bandwidth to improve things. It's something I'd think we'd all like to see changed in the future, but that's the current state.

@shs96c This is something that I'm actively working on with the IntelliJ team (@brendandouglas), and the Bazel team definitely has high quality IDE support in sights. We completely understand that IDE support is core to the Bazel user experience (especially so with Java/JVM languages & IntelliJ), and I want to assure you that we are looking into this.

Just my own preference: I'd still rather have the plugin with some perf regressions than an IDE that breaks when I upgrade. I'm excited to hear that this is being addressed. :)

At the risk of turning this into an opinion dumpster fire: put me in the "release the plugin when it performs as well as it should and the most severe IJ issues are resolved" camp. Unless there's some burning, compelling reason to upgrade immediately (i.e. I need some functionality in the latest and greatest IJ), I don't mind waiting.

Also, thanks for doing this at all. I can easily continue to advocate for Bazel usage as long as this plugin is still supported, but bad perf regressions would cause more daily pain than waiting a few months to upgrade to a newer IJ.

If it helps anyone, here's a pre-built plugin that you can use: Preferences -> Plugins -> Settings icon -> Install plugin from disk.

Built on my machine. Works on Mac 10.14.4. Completely unsupported. Use as you would a random binary downloaded from the internet.
ijwb_bazel.zip

IJ 2019.1.2 is now out. I'm really hoping that the performance regressions are now resolved: I've been missing Bazel in my IDE. :)

@jin, thank you for your comments. I know you're all working hard to make this as good as it can be. It's very much appreciated, even if I do grumble from time to time….

This is now available in the Plugin Marketplace.

https://plugins.jetbrains.com/plugin/8609-bazel/versions

Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Maririri picture Maririri  Â·  7Comments

dwtj picture dwtj  Â·  6Comments

brandonpollack23 picture brandonpollack23  Â·  5Comments

cpsauer picture cpsauer  Â·  8Comments

ruudud picture ruudud  Â·  8Comments