Skip to content

Commit

Permalink
RQA-2830 fix mac dmg to be x64 binary and use x64 bundled python to p…
Browse files Browse the repository at this point in the history
…ip install (#15624)

## Replaces #15618 with PR against branch name ending in
`app-build-internal` to trigger a build

## Overview

- <https://opentrons.atlassian.net/browse/RQA-2830>
- `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.
  • Loading branch information
y3rsh committed Jul 22, 2024
1 parent 043bca7 commit a77ffd7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app-shell/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion app-shell/scripts/before-pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit a77ffd7

Please sign in to comment.