From a77ffd7a091e3c1a603ea0bcf9c67ecda94bb9a5 Mon Sep 17 00:00:00 2001 From: Josh McVey Date: Thu, 11 Jul 2024 14:32:05 -0500 Subject: [PATCH] RQA-2830 fix mac dmg to be x64 binary and use x64 bundled python to pip install (#15624) ## Replaces #15618 with PR against branch name ending in `app-build-internal` to trigger a build ## Overview - - `macos-11` GitHub runner was intel and now we use macos-latest that is arm [doc](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories) - specify --x64 argument to electron-builder - ~~per [doc](https://github.com/actions/setup-python?tab=readme-ov-file#supported-architectures) x64 python should be installed so the pip install will be the right platform. I'm not confident in this.~~ - see comment in #15618 - we need to use the python we download on mac to do the pip install so the installed packages match the platform correctly ## Test Plan - [x] build locally and see that it works - [x] watch CI and install the built package - [x] validate that once the package dmg is x64 that analysis works (python has packages with the right arch) # Review requests - This the right approach? # Risk assessment High because our .dmg currently cannot analyze protocols 2.0.0-alpha.0 internal release build. --- app-shell/Makefile | 2 +- app-shell/scripts/before-pack.js | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app-shell/Makefile b/app-shell/Makefile index 32c8b7ce01e..9624aa1a54e 100644 --- a/app-shell/Makefile +++ b/app-shell/Makefile @@ -122,7 +122,7 @@ dist-posix: package-deps .PHONY: dist-osx dist-osx: package-deps - $(builder) --mac + $(builder) --mac --x64 $(MAKE) _dist-collect-artifacts .PHONY: dist-linux diff --git a/app-shell/scripts/before-pack.js b/app-shell/scripts/before-pack.js index 6e96609786f..bb5e2d45485 100644 --- a/app-shell/scripts/before-pack.js +++ b/app-shell/scripts/before-pack.js @@ -118,7 +118,16 @@ module.exports = function beforeBuild(context) { // TODO(mc, 2022-05-16): explore virtualenvs for a more reliable // implementation of this install - return execa(HOST_PYTHON, [ + console.log( + `Installing python native deps using ${path.join( + PYTHON_DESTINATION, + 'python3.10' + )}` + ) + const invokablePython = platformName.includes('darwin') + ? path.join(PYTHON_DESTINATION, 'python/bin/python3.10') + : HOST_PYTHON + return execa(invokablePython, [ '-m', 'pip', 'install',