From 38b0af85bbfa9bc5e59ab6edbc70b7db4ae9e92c Mon Sep 17 00:00:00 2001 From: Michael Behrisch Date: Mon, 14 Oct 2024 16:01:52 +0200 Subject: [PATCH] trying to debug macos installer creation #3 --- .github/workflows/build-macos.yml | 2 +- tools/build_config/buildMacOSInstaller.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index b64c85e9347..698284a03e7 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -75,7 +75,7 @@ jobs: run: | cd sumo python3 -m pip install dmgbuild - python3 tools/build_config/buildMacOSInstaller.py ./cmake-build + python3 tools/build_config/buildMacOSInstaller.py ./cmake-build --verbose - name: Uploading macOS installer dmg uses: actions/upload-artifact@v4 diff --git a/tools/build_config/buildMacOSInstaller.py b/tools/build_config/buildMacOSInstaller.py index 210d197a71b..3c8646a2dad 100755 --- a/tools/build_config/buildMacOSInstaller.py +++ b/tools/build_config/buildMacOSInstaller.py @@ -64,6 +64,7 @@ def parse_args(def_dmg_name, def_pkg_name): op.add_argument("build_dir", help="Build dir of sumo") op.add_argument("--output-pkg", dest="output_pkg", help="Output path for pkg", default=def_output_pkg_path) op.add_argument("--output-dmg", dest="output_dmg", help="Output path for dmg", default=def_output_dmg_path) + op.add_option("-v", "--verbose", action="store_true", default=False, help="tell me more") return op.parse_args() @@ -306,7 +307,7 @@ def create_app(app_name, exec_call, framework_name, pkg_id, version, icns_path): return app_name, pkg_name, pkg_id, pkg_path, pkg_size -def create_installer(frmwk_pkg, app_pkgs, id, version, output_path): +def create_installer(frmwk_pkg, app_pkgs, id, version, output_path, verbose): cwd = os.path.dirname(os.path.abspath(__file__)) print(" - Creating temporary directory") temp_dir = tempfile.mkdtemp() @@ -380,7 +381,8 @@ def create_installer(frmwk_pkg, app_pkgs, id, version, output_path): resources_dir, output_path, ] - subprocess.run(productbuild_command, check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + out = None if verbose else subprocess.DEVNULL + subprocess.run(productbuild_command, check=True, stdout=out, stderr=out) pkg_size = os.path.getsize(output_path) print(" - Cleaning up") @@ -490,7 +492,8 @@ def main(): # Building the installer package print("Building installer") - installer_pkg = create_installer(framework_pkg, app_pkgs, f"{base_id}.installer", version, opts.output_pkg) + installer_pkg = create_installer(framework_pkg, app_pkgs, f"{base_id}.installer", version, + opts.output_pkg, opts.verbose) print("Successfully built installer\n") # Putting the installer package into a dmg file - ready for signing