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

Refreshing 'Bazel Build Targets' fails when there is a problem in the build graph #198

Open
bholmes-sc-zz opened this issue May 23, 2020 · 3 comments

Comments

@bholmes-sc-zz
Copy link

Refreshing a the test of build targets tries to pull every target in the workspace using bazelisk query '//...:*' --output=package. If any target in the graph fails then the targets are unable to refresh.

This can be fixed by adding --keep_going to the command.

@thinlizzy
Copy link

thinlizzy commented Nov 17, 2022

this is happening to me as well. every change that I make in the BUILD files makes the targets no longer "refreshable".

even after I fix the BUILD files, I have to manually delete the local bazel cache and then I can refresh the targets again

@derekwisong
Copy link

derekwisong commented Mar 31, 2023

I've also found the same. If I run bazel clean --expunge and then refresh the build targets it works. As soon as I run a build, the refresh targets stops working again... Until I do another bazel clean --expunge (just doing bazel clean isn't enough).

Command failed: bazel --output_base=C:\Users\derek\AppData\Local\Temp\6d3c01fb0e729517c66ebcceb7fa4943 query ...:* --output=package Another command (pid=10292) is running. Waiting for it to complete on the server (server_pid=20404)... Loading: 0 packages loaded ERROR: error loading package under directory '': error loading package 'bazel-hello/external/bazel_tools/src/conditions': Label '//tools/windows:windows_config.bzl' is invalid because 'tools/windows' is not a package; perhaps you meant to put the colon here: '//:tools/windows/windows_config.bzl'? Loading: 0 packages loaded currently loading: bazel-hello/external/local_config_cc ... (2 packages)

EDIT: I fixed this by adding the bazel-hello directory to .bazelignore. Not sure why it fails without that. I'm able to run a similar bazel query ...:* --output=package without failure from the command line, but the vscode plugin seems to fail with the .bazelignore change. Note that "hello" is the name of my workspace.

@cameron-martin
Copy link
Collaborator

@derekwisong See #216

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

4 participants