Skip to content
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

Open Trivial Bazel 6.4.0 Java example project causes Command failed: bazel ... error on opening it in VSC #328

Closed
vorburger opened this issue Jan 5, 2024 · 3 comments

Comments

@vorburger
Copy link

vorburger commented Jan 5, 2024

When I open code java_one/ of https://github.com/vorburger/LearningBazel a notification pop ups with the following error:

Command failed: bazel --output_base=/tmp/07d06c474e5b9ccb01482f273e2b80b3 query ...:* --output=package
Loading: 0 packages loaded
ERROR: error loading package under directory '': error loading package 'bazel-java-one/external/bazel_tools/tools/android': 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'?
Loading: 1 packages loaded
    currently loading: bazel-java-one/external/remote_java_tools ... (4 packages)
@vorburger
Copy link
Author

The error message actually seems to vary slightly, e.g. when I open code rules_jvm_external/ of https://github.com/vorburger/LearningBazel then it is the following (but I suspect this is likely all due to some same root cause issue):

Command failed: bazel --output_base=/tmp/33f1df7beca4082e021dfd08c653c0c8 query ...:* --output=package
Loading: 0 packages loaded
ERROR: error loading package under directory '': error loading package 'bazel-rules_jvm_external/external/rules_jvm_external~5.3/tests/unit/manifest_stamp': Unable to find package for @[unknown repo 'bazel_skylib' requested from @]//rules:diff_test.bzl: The repository '@[unknown repo 'bazel_skylib' requested from @]' could not be resolved: No repository visible as '@bazel_skylib' from main repository.
Loading: 6 packages loaded
    currently loading: bazel-rules_jvm_external/external/rules_jvm_external~5.3~maven~maven ... (6 packages)

@cameron-martin
Copy link
Collaborator

This seems to be a quirk of setting a different --output_base to what you last built with. The bazel-* symlinks then don't point to the current output base, so bazel no longer ignores them. Seems like a bug in Bazel. I reckon open an issue there.

@cameron-martin
Copy link
Collaborator

Duplicate of #216

@cameron-martin cameron-martin marked this as a duplicate of #216 Jan 23, 2024
@cameron-martin cameron-martin closed this as not planned Won't fix, can't repro, duplicate, stale Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants