vscode-bazel icon indicating copy to clipboard operation
vscode-bazel copied to clipboard

how to specify my python path ?

Open CaichaoGitHub opened this issue 5 years ago • 5 comments

i encounter a python problem:

ERROR: error loading package 'bazel-stage1/external/bazel_tools/third_party/def_parser': Label '//tools/python:private/defs.bzl' is invalid because 'tools/python' is not a package; perhaps you meant to put the colon here: '//:tools/python/private/defs.bzl'?

and i try this

截屏2020-09-22 下午5 02 20

it's not working

CaichaoGitHub avatar Sep 22 '20 09:09 CaichaoGitHub

I am having the same error. And, I don't think that it's not coming from the python lib path. If you copy and paste the command that failed in my case. bazel --output_base=/var/folders/ys/superlongpath query ...:* --output=package, I can reproduce the error.

The funny thing is when I open the project github.com/bazelbuild/rules_go.git the extension works well and there's no python there.

So, obviously something is missing. I will try to see what's missing in my VS project to make it work and I will let you know.

bbourbie avatar Sep 27 '20 19:09 bbourbie

OK, FINALLY, I found a workaround that works for me

Please, go to your visual code setting and remove Bazel:Queries share folder. For some reason using an output_base makes bazel query ...:* fail which is so strange

is it because I am using Bazelisk?

bazel version Bazelisk version: 1.6.1 Build label: 3.5.0 Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar Build time: Wed Sep 2 20:16:21 2020 (1599077781) Build timestamp: 1599077781

Anyway, I leave that to the vscode-bazel team.

bbourbie avatar Sep 27 '20 20:09 bbourbie

OK, FINALLY, I found a workaround that works for me

Please, go to your visual code setting and remove Bazel:Queries share folder. For some reason using an output_base makes bazel query ...:* fail which is so strange

is it because I am using Bazelisk?

bazel version Bazelisk version: 1.6.1 Build label: 3.5.0 Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar Build time: Wed Sep 2 20:16:21 2020 (1599077781) Build timestamp: 1599077781

Anyway, I leave that to the vscode-bazel team.

@bbourbie

i could't use the vscode-bazel all the time ;did you try xcode or clion , i tried the xcode's external building and clion's custom build target, i could't debug the program by gdb or lldb

image image

CaichaoGitHub avatar Sep 28 '20 02:09 CaichaoGitHub

No, sorry, I only use VSCode and I don't use any debugger.

bbourbie avatar Sep 28 '20 16:09 bbourbie

This is a duplicate of this issue AFAICT

https://github.com/bazelbuild/vscode-bazel/issues/216

Try this, it worked for me: https://github.com/bazelbuild/bazel/issues/10653#issuecomment-694230015

You'll need to ensure you name your workspace. To do that put workspace(name="UNIQUE_NAME_HERE") at the top of your projects WORKSPACE file.

nfisher avatar Oct 07 '20 05:10 nfisher

Duplicate of #216

cameron-martin avatar Jan 23 '24 11:01 cameron-martin