-
Notifications
You must be signed in to change notification settings - Fork 18
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
bazel
binary detection (in VSC with bazel-vscode-java
) does not find custom script on PATH
which runs bazelisk
instead of bazel
#477
Comments
|
Starting to stare at https://github.com/salesforce/bazel-eclipse/blob/dceb31d92b9f448d2e63add6f21e693326fdcd07/bundles/com.salesforce.bazel.sdk/src/com/salesforce/bazel/sdk/command/BazelBinaryVersionDetector.java, I stumble over 1fed8ec where you seem to have already added support for https://ij.bazel.build/docs/project-views.html#bazel_binary - let me try that! |
Yes, But there is a gap in detecting the default binary, which might still cause errors in the log. We use the In general, we don't scan but expect I suspect that the VS Code server process running in Codespaces does not inherit your user environment. Thus, it does not have the bazel binary. I wonder if you need to somehow make it part of the devcontainer.json? |
I've added
I'll try to replace my https://github.com/vorburger/vorburger-dotfiles-bin-etc/blob/main/bin/bazel with a
I was hoping to avoid needing to deal with Dev Container set-up, but yeah, I'll look more into that. Let me close this for now, as that |
@guw me again - sorry! 😈 (Hope this continous intended to be constructive feedback is a useful project contribution...)
In enola-dev/enola#354 I'm exploring supporting (testing & documenting) GitHub Codespaces for https://docs.enola.dev/dev/ide/#visual-studio-code-vsc. (That's with https://github.com/salesforce/bazel-vscode-java, but based on my current understanding of what's what here, the change / fix required will probably be in code in this repo, so I'm filing this here; let me know if you prefer it on the other project.)
I've run into the following errors:
So it's failing to find
bazel
toexec
it, in two places, theDefaultBazelCommandExecutor
as well as theBazelBinaryVersionDetector
(which, according to this stack trace, does not use the former).This is because I don't actually directly have a
bazel
binary on myPATH
- intentionally. Instead, I usebazelisk
https://github.com/bazelbuild/bazelisk - only.On my local (Fedora-based) workstation, in VSC, where it works great. This is because I have a https://github.com/vorburger/vorburger-dotfiles-bin-etc/blob/main/bin/bazel (and also a https://github.com/vorburger/vorburger-dotfiles-bin-etc/blob/main/dotfiles/fish/completions/bazel.fish, but that's not really relevant, here).
For some reason which I haven't fully understood yet, on a GitHub Codespace, that doesn't seem to work (whereas it does locally, for me).
I'm also vaguely aware that there Linux Kernel configuration/s related to direct support, or not, of "Hashbang" scripts for
exec
; no clue if that could be related, here.I haven't had a closer look at your related code here yet. It may have something to do with
PATH
, and if you launch with thatbash -c
trick (you know what I mean?) or directly exec. BTW https://github.com/vorburger/ch.vorburger.exec is a little launcher library of mine, where I had been meaning to add support (abstraction) for this kind of thing for a while.Actually the
PATH
may well be the culprit? Here are some details from my Codespace Terminal - but the process context in which the LSP server runs may be different, of course - so my "custom"~/bin/
is probably not on thePATH
there?I can try to dig a little bit deeper some other time than right now, but I thought I would already file this here, if you have an initial reaction.
I guess another option than "fixing" this whole PATH could be to allow configuring what binary to use, and let users set
bazelisk
instead ofbazel
? Or even auto-detect / try both, that could be neat. Or just add support to emulate https://ij.bazel.build/docs/project-views.html#bazel_binary, maybe?The text was updated successfully, but these errors were encountered: