Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix local builds on MacOS 10.15 #86

Closed
maltfield opened this issue Jul 26, 2024 · 6 comments
Closed

Fix local builds on MacOS 10.15 #86

maltfield opened this issue Jul 26, 2024 · 6 comments

Comments

@maltfield
Copy link
Member

This ticket will track the effort to fix our build script on our mac mini running macOS 10.15

Why?

We can build on the GitHub CI runners (running a more updated version of macOS than Apple will allow us to upgrade-to on our free hardware, but it's extremely slow to iterate.

It's much faster if we can build and test it locally.

@maltfield
Copy link
Member Author

maltfield commented Jul 26, 2024

I made a lot of optimization improvements in our most recent build script changes, but it also changes a lot of the depends

Currently we're getting the following error at build-time

+ /tmp/venv/bin/python3 -m pip install --ignore-installed --upgrade --cache-dir build/deps/ --no-index --find-links file:///Users/maltfield/sandbox/buskill-app/build/deps/ build/deps/Kivy-2.3.0-cp311-cp311-macosx_10_9_universal2.whl
Looking in links: file:///Users/maltfield/sandbox/buskill-app/build/deps/
ERROR: Kivy-2.3.0-cp311-cp311-macosx_10_9_universal2.whl is not a supported wheel on this platform.

@maltfield
Copy link
Member Author

maltfield commented Jul 26, 2024

According to the documentation, this wheel should work for our platform

bash-3.2$ /tmp/venv/bin/python3 -m pip install --ignore-installed --upgrade --cache-dir build/deps/ --no-index --find-links file:///Users/maltfield/sandbox/buskill-app/build/deps/ build/deps/Kivy-2.3.0-cp311-cp311-macosx_10_9_universal2.whl
Looking in links: file:///Users/maltfield/sandbox/buskill-app/build/deps/
ERROR: Kivy-2.3.0-cp311-cp311-macosx_10_9_universal2.whl is not a supported wheel on this platform.
bash-3.2$

bash-3.2$ /tmp/venv/bin/python3
Python 3.12.2 (v3.12.2:6abddd9f6a, Feb  6 2024, 17:02:06) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sysconfig
>>> sysconfig.get_platform()
'macosx-10.9-universal2'
>>> 

oh, actually, it looks like the platform isn't the issue; the python3 interpreter shell says we're python 3.12.2?

Yeah, it looks like there's an error above that in the build log; python-3.11 failed to install

+ sudo installer -pkg python-3.11.8-macos11.pkg -target /
installer: Error - the package path specified was invalid: 'python-3.11.8-macos11.pkg'.

Strange. The file is definitely there.

bash-3.2$ ls -lah build/deps/python-3.11.8-macos11.pkg
-rw-r--r--  1 maltfield  staff    43M Jul 26 02:27 build/deps/python-3.11.8-macos11.pkg
bash-3.2$ 

@maltfield
Copy link
Member Author

Somehow when I tried to install it myself it worked.

bash-3.2$ sudo installer -pkg build/deps/python-3.11.8-macos11.pkg -target /
installer: Package name is Python
installer: Upgrading at base path /
installer: The upgrade was successful.
bash-3.2$ 

bash-3.2$ /usr/local/bin/python3
Python 3.11.8 (v3.11.8:db85d51d3e, Feb  6 2024, 18:02:37) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 

@maltfield
Copy link
Member Author

maltfield commented Jul 26, 2024

Ah, apparently the problem is our path to virtualenv

+ mkdir /tmp/venv
mkdir: /tmp/venv: File exists
+ /usr/local/bin/python3 -m venv /tmp/venv
+ ls -lah /tmp/venv
total 8
drwxr-xr-x   6 maltfield  wheel   192B Jul 24 03:21 .
drwxrwxrwt   5 root       wheel   160B Jul 26 06:17 ..
drwxr-xr-x  24 maltfield  wheel   768B Jul 26 06:18 bin
drwxr-xr-x   4 maltfield  wheel   128B Jul 26 06:18 include
drwxr-xr-x   4 maltfield  wheel   128B Jul 26 06:18 lib
-rw-r--r--   1 maltfield  wheel   246B Jul 26 06:18 pyvenv.cfg
+ virtualenv /tmp/venv
build/mac/buildDmg.sh: /usr/local/bin/virtualenv: /usr/local/opt/[email protected]/bin/
python3.9: bad interpreter: No such file or directory
+ ls -lah /tmp/venv
total 8
drwxr-xr-x   6 maltfield  wheel   192B Jul 24 03:21 .
drwxrwxrwt   5 root       wheel   160B Jul 26 06:17 ..
drwxr-xr-x  24 maltfield  wheel   768B Jul 26 06:18 bin
drwxr-xr-x   4 maltfield  wheel   128B Jul 26 06:18 include
drwxr-xr-x   4 maltfield  wheel   128B Jul 26 06:18 lib
-rw-r--r--   1 maltfield  wheel   246B Jul 26 06:18 pyvenv.cfg
+ ls -lah /tmp/venv/bin
total 160
drwxr-xr-x  24 maltfield  wheel   768B Jul 26 06:18 .
drwxr-xr-x   6 maltfield  wheel   192B Jul 24 03:21 ..
-rw-rw-r--   1 maltfield  wheel   8.8K Jul 26 06:18 Activate.ps1
-rw-rw-r--   1 maltfield  wheel   1.6K Jul 26 06:18 activate
-rw-rw-r--   1 maltfield  wheel   902B Jul 26 06:18 activate.csh
-rw-rw-r--   1 maltfield  wheel   2.1K Jul 26 06:18 activate.fish
-rwxr-xr-x   1 maltfield  wheel   231B Jul 26 03:43 macho_dump
-rwxr-xr-x   1 maltfield  wheel   231B Jul 26 03:43 macho_find
-rwxr-xr-x   1 maltfield  wheel   237B Jul 26 03:43 macho_standalone
-rwxr-xr-x   1 maltfield  wheel   237B Jul 26 06:18 pip
-rwxr-xr-x   1 maltfield  wheel   237B Jul 26 06:18 pip3
-rwxr-xr-x   1 maltfield  wheel   237B Jul 26 06:18 pip3.11
-rwxr-xr-x   1 maltfield  wheel   234B Jul 26 03:43 pip3.12
-rwxr-xr-x   1 maltfield  wheel   251B Jul 26 03:43 pyi-archive_viewer
-rwxr-xr-x   1 maltfield  wheel   246B Jul 26 03:43 pyi-bindepend
-rwxr-xr-x   1 maltfield  wheel   249B Jul 26 03:43 pyi-grab_version
-rwxr-xr-x   1 maltfield  wheel   245B Jul 26 03:43 pyi-makespec
-rwxr-xr-x   1 maltfield  wheel   248B Jul 26 03:43 pyi-set_version
-rwxr-xr-x   1 maltfield  wheel   262B Jul 26 03:43 pyinstaller
lrwxr-xr-x   1 maltfield  wheel    10B Jul 24 03:21 python -> python3.12
lrwxr-xr-x   1 maltfield  wheel    10B Jul 24 03:21 python3 -> python3.12
lrwxr-xr-x   1 maltfield  wheel    65B Jul 26 06:18 python3.11 -> /Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11
lrwxr-xr-x   1 maltfield  wheel    65B Jul 24 03:21 python3.12 -> /Library/Frameworks/Python.framework/Versions/3.12/bin/python3.12
-rwxr-xr-x   1 maltfield  wheel   221B Jul 26 03:43 wheel
+ PYTHON_PATH=/tmp/venv/bin/python3
+ /tmp/venv/bin/python3 --version
Python 3.12.2

@maltfield
Copy link
Member Author

This works

maltfield@host ~ % rm -rf /tmp/venv
maltfield@host ~ % /usr/local/bin/python3 -m venv /tmp/venv
maltfield@host ~ % /tmp/venv/bin/python3
Python 3.11.8 (v3.11.8:db85d51d3e, Feb  6 2024, 18:02:37) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 

@maltfield
Copy link
Member Author

Since Apple is so shitty as a developer tool (we can't just run it in a docker container), it's probably better that our script doesn't attempt to rm -rf /tmp/venv. So I'll consider this manual approach "good enough".

We can build locally again; closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant