Try to fix a surprising error from the new target selection. (#3207)

Also add some extra debug logging to try to help diagnose the error.
This commit is contained in:
Chandler Carruth
2023-09-08 23:51:06 +00:00
committed by GitHub
parent 71f2eecec5
commit 5fc013b38f
+5
View File
@@ -48,6 +48,7 @@ def filter_targets(bazel: Path, targets: str) -> str:
)
log(f"Bazel query snippet:\n```\n{query_snippet}\n```")
tmp.write(query)
tmp.flush()
try:
p = subprocess.run(
[str(bazel), "query", f"--query_file={tmp.name}"],
@@ -59,6 +60,10 @@ def filter_targets(bazel: Path, targets: str) -> str:
return p.stdout
except subprocess.CalledProcessError as err:
log(err.stderr)
log("Full query file:\n```")
with open(tmp.name) as f:
log(f.read())
log("```")
raise