Surface WiX tool stdout/stderr on MSI build failure
This commit is contained in:
+10
-2
@@ -233,9 +233,17 @@ def build_msi(version: str) -> Path:
|
||||
def run(tool: str, args: list[str]) -> None:
|
||||
cmd = [str(wix / tool), *args]
|
||||
print(f"Running: {' '.join(cmd)}")
|
||||
result = subprocess.run(cmd, cwd=_REPO_ROOT)
|
||||
try:
|
||||
result = subprocess.run(
|
||||
cmd, cwd=_REPO_ROOT, capture_output=True, text=True
|
||||
)
|
||||
except OSError as exc:
|
||||
raise RuntimeError(f"{tool} failed to start: {exc}") from exc
|
||||
if result.returncode != 0:
|
||||
raise RuntimeError(f"{tool} failed with exit code {result.returncode}")
|
||||
raise RuntimeError(
|
||||
f"{tool} failed with exit code {result.returncode}\n"
|
||||
f"stdout:\n{result.stdout}\nstderr:\n{result.stderr}"
|
||||
)
|
||||
|
||||
run("heat.exe", [
|
||||
"dir", str(dist_folder),
|
||||
|
||||
Reference in New Issue
Block a user