-
Notifications
You must be signed in to change notification settings - Fork 298
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
Windows IDEA WSL support #3112
Comments
We've ended up with building our own copy of plugin for IntelliJ with small wrapper program around |
any news regarding this? |
@dpoluyanov any chance you could open source this? |
I've opensourced it there https://github.com/dpoluyanov/bazel-wsl |
Hello @dpoluyanov, First of all thank you very much for sharing your solution. 👍 I'd like to know if after having your bazel setup if you also found this kind of issues when syncinc your project in IDEA? |
This is a common problem for our bazel-wsl setups and we have two consequent steps to mitigate this issue:
|
Thank you very much! It worked on my side 🎉 |
@dpoluyanov Thank you! Have starred your project. |
Hi,
JetBrains team released WSL support in 2021.1 (see https://www.jetbrains.com/help/idea/how-to-use-wsl-development-environment-in-product.html )
While it is still has issue with symlinks: https://youtrack.jetbrains.com/issue/IDEA-253253
other parts of wsl interoperability works like a charm: one could open and work on project stored in linux (through wsl) from windows version of IntelliJ IDEA, and even integrated idea-terminal opens linux shell console instead of powershel.
But even in such smooth integration working with Bazel projects is hard, because:
\\wsl$\<distro-name>
and has windows file separator (\
instead of/
), e.g./home/<user>/project/WORKSPACE
will be accessible from\\wsl$\<distro-name>\home\<user>\project\WORKSPACE
.In order to fix these issues without rewriting a lot of parts of Bazel IntelliJ plugin (I understand that it is hardly be accepted by your team) I wrote a small go program https://github.com/dpoluyanov/bazel-wsl, which acts as Bazel binary for IntelliJ Bazel plugin and translates all passed commands to wsl default linux distro (through
wsl
command), so every call from plugin tobazel
, likebazel info ...
will be translated towsl bazel info ...
, with some patching around file paths and rewriting build event output once it is produced by linuxbazel
.It could be some step toward to #113 with caveat that it is not pure windows native build, but just an ability to work with bazel from Windows machines via transparent WSL backed linux VM.
There is one issue with jdeps resolution that I'd found:
https://github.com/bazelbuild/intellij/blob/master/base/src/com/google/idea/blaze/base/sync/workspace/ArtifactLocationDecoderImpl.java#L105
It is some workaround (which I couldn't find reason for) in resolving path to
SourceArtifact
through checking linux-specific file separator and because JdepsFileReader adds target to map only if it is instance ofOutputArtifact
(whichSourceArtifact
is not extends) currently in case of working via wsl plugin resolves jdeps file intoSourceArtifact
(jdep file has prefixbazel-out\k8-fastbuild\...
) and skips its loading.I've created a small patch to change this behaviour and would like to ask: if it could be accepted into upstream repository in some way or there is another change which could be proposed in order to correctly find & load jdeps files in case of working from windows via WSL?
It also could help with #3063 and #3098 in some way
The text was updated successfully, but these errors were encountered: