فهرست منبع

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.
Chandler Carruth 2 سال پیش
والد
کامیت
5fc013b38f
1فایلهای تغییر یافته به همراه5 افزوده شده و 0 حذف شده
  1. 5 0
      scripts/target_determinator.py

+ 5 - 0
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