From 5fc013b38f4496da5128ef9e7eec6ffd05ed07a1 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Fri, 8 Sep 2023 16:51:06 -0700 Subject: [PATCH] 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. --- scripts/target_determinator.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/target_determinator.py b/scripts/target_determinator.py index d9099c8d5768..cce1913a37f3 100755 --- a/scripts/target_determinator.py +++ b/scripts/target_determinator.py @@ -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