Build fails: Python 2.X is deprecated in MacOS Monterey 12.3

24 views
Skip to first unread message

Christian Falch

unread,
Mar 30, 2022, 9:17:52 AMMar 30
to skia-discuss
After upgrading to MacOS Monterey 12.3 our Skia builds stopped working due to the deprecation of python 2 on MacOS. 

We're building with the M101 branch.

I managed to get almost everything to build again setting the script-executable to python3 when running `gn gen`:

gn gen out/android/arm   --script-executable=python3 --args='....

All our iOS builds are now working including building for Mac M1, but Android still fails complaining about python not being found when trying to link:

[1/104] link libwebp_sse41.a
FAILED: libwebp_sse41.a
python "<...>/externals/skia/gn/rm.py" "libwebp_sse41.a" && <...>/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ar rcs libwebp_sse41.a @libwebp_sse41.a.rsp
/bin/sh: python: command not found

Any ideas on how to solve this? Thanks in advance :) 

Christian

Greg Daniel

unread,
Mar 30, 2022, 9:30:50 AMMar 30
to skia-discuss
Yeah Mac 12.3 removed 'python' and only has 'python3'. All of our tools should work with python3, but some things may still directly call 'python'. I made a bash script for python that has:

#!/bin/bash
/usr/bin/python3 "$@"

So far that has solved all the issues I've had with tools and python.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/c02a4329-7a0a-46a8-ac65-462c97daeee5n%40googlegroups.com.

Christian Falch

unread,
Mar 30, 2022, 9:33:28 AMMar 30
to skia-discuss
Nice, thanks!
Reply all
Reply to author
Forward
0 new messages