Skip to content

Commit

Permalink
Better debug log when doing cpack
Browse files Browse the repository at this point in the history
  • Loading branch information
mario4tier committed Dec 20, 2024
1 parent 5513e7e commit cf3a909
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Binary file modified dist/ta-lib-0.6.0-windows-x86_64.msi
Binary file not shown.
7 changes: 2 additions & 5 deletions scripts/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import zlib

from utilities.versions import sync_sources_digest, sync_versions
from utilities.common import are_generated_files_git_changed, compare_dir, copy_file_list, create_temp_dir, get_src_generated_files, is_arm64_toolchain_installed, is_cmake_installed, is_debian_based, is_dotnet_installed, is_i386_toolchain_installed, is_redhat_based, is_rpmbuild_installed, is_ubuntu, is_dotnet_installed, is_wix_installed, is_x86_64_toolchain_installed, verify_git_repo, run_command_sudo
from utilities.common import are_generated_files_git_changed, compare_dir, copy_file_list, create_temp_dir, get_src_generated_files, is_arm64_toolchain_installed, is_cmake_installed, is_debian_based, is_dotnet_installed, is_i386_toolchain_installed, is_redhat_based, is_rpmbuild_installed, is_ubuntu, is_dotnet_installed, is_wix_installed, is_x86_64_toolchain_installed, run_command, verify_git_repo, run_command_sudo
from utilities.files import compare_msi_files, compare_tar_gz_files, compare_zip_files, create_rtf_from_txt, create_zip_file, compare_deb_files, force_delete, force_delete_glob, path_join

def delete_other_versions(target_dir: str, file_pattern: str, new_version: str ):
Expand Down Expand Up @@ -114,10 +114,7 @@ def do_cpack_build(build_dir: str):
original_dir = os.getcwd()
try:
os.chdir(build_dir)
subprocess.run(['cpack', '.'], check=True)
except subprocess.CalledProcessError as e:
print(f"Error running CPack: {e}")
sys.exit(1)
run_command(['cpack', '.'])
finally:
# Restore the original working directory
os.chdir(original_dir)
Expand Down
11 changes: 8 additions & 3 deletions scripts/utilities/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,14 @@ def expand_globs(root_dir: str, file_list: list) -> list:

def run_command(command: list) -> str:
"""Run a shell command and return the output."""
result = subprocess.run(command, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
if result.returncode != 0:
print(f"Error during '{' '.join(command)}': {result.stderr}")
try:
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
if result.returncode != 0:
print(f"stdout for '{' '.join(command)}': {result.stdout}")
print(f"stderr for '{' '.join(command)}': {result.stderr}")
sys.exit(1)
except subprocess.CalledProcessError as e:
print(f"Error during '{' '.join(command)}': {e}")
sys.exit(1)

return result.stdout.strip()
Expand Down

0 comments on commit cf3a909

Please sign in to comment.