Intellij: Add support for Windows

Created on 18 Jul 2017  路  16Comments  路  Source: bazelbuild/intellij

When trying to import Bazel into the Plugin on Windows it fails with:

Running Bazel info...
...............
____Loading package: @bazel_tools//tools/jdk
WARNING: C:/users/a.bergmeier/appdata/local/temp/_bazel_a.bergmeier/uys7wfg8/external/bazel_tools/tools/cpp/cc_configure.bzl:67:3: 
Auto-Configuration Warning: 'BAZEL_PYTHON' is not set, start looking for python in PATH.
.
ERROR: in target '//external:cc_toolchain': no such package '@local_config_cc//': Traceback (most recent call last):
    File "C:/users/a.bergmeier/appdata/local/temp/_bazel_a.bergmeier/uys7wfg8/external/bazel_tools/tools/cpp/cc_configure.bzl", line 759
        _find_python(repository_ctx)
    File "C:/users/a.bergmeier/appdata/local/temp/_bazel_a.bergmeier/uys7wfg8/external/bazel_tools/tools/cpp/cc_configure.bzl", line 452, in _find_python
        _which_cmd(repository_ctx, "python.exe")
    File "C:/users/a.bergmeier/appdata/local/temp/_bazel_a.bergmeier/uys7wfg8/external/bazel_tools/tools/cpp/cc_configure.bzl", line 96, in _which_cmd
        auto_configure_fail("Cannot find %s in PATH, please ...))
    File "C:/users/a.bergmeier/appdata/local/temp/_bazel_a.bergmeier/uys7wfg8/external/bazel_tools/tools/cpp/cc_configure.bzl", line 60, in auto_configure_fail
        fail("\n%sAuto-Configuration Error:%s...))

Auto-Configuration Error: Cannot find python.exe in PATH, please make sure python.exe is installed and add its directory in PATH.

Would be good to have an option to set environment variables prior to starting bazel.exe.

windows feature request

Most helpful comment

@jin What's the status of this? Is there no interest/bandwidth here from Google? There are a handful of community PRs to fix blocking Windows issues, but they've been unmerged for 1-2 years. The plugin seems to work fine on Windows with those patches pulled in (and VCS integration disabled https://github.com/bazelbuild/intellij/issues/2277).

We're converting a large, critical Java code base to Bazel, and this is my biggest concern. We're going to have to maintain an internal fork of this plugin, but I'd love to see the maintainers be more receptive to fixes affecting Windows.

All 16 comments

Currently the plugin only supports Linux.

We plan to support Mac in the near future, and in the longer term Windows as well, but there are no fixed dates planned.

Any updates on this? I can start the plugin with Clion 2017.2 (not 2017.3, see #175), but include paths are not recognized and therefore navigation through code is impossible. Instead of filing a separate bug report I assume that lacking Windows support causes my problem.

No updates yet. As I understand it, Bazel support still isn't quite there for Windows.

Added to that, we simply don't have the bandwidth at the moment to look at Windows support for the plugin.

@brendandouglas What about MacOS? Is it supported? (as you mentioned "We plan to support Mac in the near future")

We don't yet officially support MacOS, though a significant fraction of users are on Macs -- other than a few known issues, it should basically work.

I've tried the plug-in again on Windows and it seems to work well, except for one issue during the project setup. When choosing the option "Import project view file", it doesn't recognize, that the selected path is actually under the workspace path and complains.

As a workaround I just use "Copy external" which works fine. I'm able to sync and build Bazel's project then and all features seem to work fine, including the IDE being able to find all references. Yay :)

I just wanted to comment that for the most part the plugin works great on Windows now, however the issue mentioned in #229 (and #372) is still happening for me.

A work around for the "can't debug on windows" issue is to disable hotswap by placing the following into the file ~/.intellij-experiments

java.hotswapping.enabled=0

FWIW, I can resolve the Bazel project on Windows using 2018.2 minus a few path separator issues.

ijwb-windows

I think we can close this issue now and open new issues for individual problems.

I wanted to ask about #229 Has that been resolved yet? I am trying to run a bazel project on Android Studio for windows 10, and I am facing the following issue:

Error:Cannot run program "bazel" (in directory "my project directory"): CreateProcess error=2, The system cannot find the file specified

And I am getting this in the bazel console:

Syncing project: Sync (full)...
Updating VCS...
Running Bazel info...
Command: bazel info --tool_tag=ijwb:AndroidStudio --curses=no --color=yes --progress_in_terminal_title=no --

Sync finished
Sync failed

@Hemanth715 where is your bazel.exe installed? Can you try providing the full path to bazel.exe in "Settings -> Other Settings -> Bazel Settings"?

Just raised #1186 - doesn't seem to handle directories well in the .bazelproject file in Windows. Would be awesome if that could also be fixed!

@jin What's the status of this? Is there no interest/bandwidth here from Google? There are a handful of community PRs to fix blocking Windows issues, but they've been unmerged for 1-2 years. The plugin seems to work fine on Windows with those patches pulled in (and VCS integration disabled https://github.com/bazelbuild/intellij/issues/2277).

We're converting a large, critical Java code base to Bazel, and this is my biggest concern. We're going to have to maintain an internal fork of this plugin, but I'd love to see the maintainers be more receptive to fixes affecting Windows.

@khogeland Thanks for raising this. I totally understand that this is a big issue for you. I also think it's one of the big blockers for making Bazel development (as in "developing Bazel itself") on Windows actually easy and doable.

So, yes, better Windows support for the IntelliJ plug-in would be really nice to have. That said, we want to get other, even more highly ranked requests done first (like better support for new IntelliJ versions). We'll get back to this eventually, unfortunately I can't promise more yet.

I can see whether we can already merge some PRs that improve Windows support. Could you or others following this issue point me to those that you think are important?

@philwo That would be great! Everything seems to be working after merging these two PRs:

https://github.com/bazelbuild/intellij/pull/1204
https://github.com/bazelbuild/intellij/pull/1541

And this patch from @KrauseStefan which doesn't have an associated PR: https://github.com/bazelbuild/intellij/issues/1186#issuecomment-633961698

I also had to disable VCS integration for the project to work around https://github.com/bazelbuild/intellij/issues/2277, which doesn't look to have been investigated yet.

I don't remember exactly why and how I made those changes. I never ended up using that patch my self it is not tested and have not even been seen to work on a Linux machine.

That is why there is no PR

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stevenleeS0ht picture stevenleeS0ht  路  7Comments

shane13hsi picture shane13hsi  路  7Comments

brownry1986 picture brownry1986  路  8Comments

Maririri picture Maririri  路  7Comments

ghost picture ghost  路  5Comments