From 613809da0441ce7579d53ff2b3b251c18b42db9f Mon Sep 17 00:00:00 2001 From: mario4tier Date: Thu, 19 Dec 2024 20:20:58 -0800 Subject: [PATCH] Add WixToolset.Util.wixext --- .github/workflows/dev-nightly-tests.yml | 1 + scripts/utilities/common.py | 16 +++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dev-nightly-tests.yml b/.github/workflows/dev-nightly-tests.yml index e568ed7c..f14adaac 100644 --- a/.github/workflows/dev-nightly-tests.yml +++ b/.github/workflows/dev-nightly-tests.yml @@ -70,6 +70,7 @@ jobs: run: | call "%VCVARSALL%" x64 dotnet tool install --global wix + wix extension add -g WixToolset.Util.wixext %PYTHON% %GITHUB_WORKSPACE%\scripts\package.py %PYTHON% %GITHUB_WORKSPACE%\scripts\test-dist.py diff --git a/scripts/utilities/common.py b/scripts/utilities/common.py index 50cd49c5..c019480d 100644 --- a/scripts/utilities/common.py +++ b/scripts/utilities/common.py @@ -1,6 +1,7 @@ import filecmp import glob import os +import re import shutil import subprocess import sys @@ -187,11 +188,16 @@ def run_command(command: list) -> str: if result.returncode != 0: print(f"stdout for '{' '.join(command)}': {result.stdout}") print(f"stderr for '{' '.join(command)}': {result.stderr}") - log_file = "D:/a/ta-lib-temp/ta-lib-temp/build/_CPack_Packages/win64/WIX/wix.log" - if os.path.exists(log_file): - print(f"Contents of {log_file}:") - with open(log_file, 'r') as f: - print(f.read()) + # If result.stderr contains the string "CPack Error: Problem running WiX.", then + # print the content of the log file at the specified path. + if "CPack Error: Problem running WiX." in result.stderr: + log_file_match = re.search(r"'([^']+)'", result.stderr) + if log_file_match: + log_file = log_file_match.group(1) + if os.path.exists(log_file): + print(f"Contents of {log_file}:") + with open(log_file, 'r') as f: + print(f.read()) sys.exit(1) except subprocess.CalledProcessError as e: print(f"Error during '{' '.join(command)}': {e}")