@@ -20,19 +20,50 @@ jobs:
20
20
- name : Build Python 3.11.8 for ARM64
21
21
run : |
22
22
cd Python-3.11.8
23
- arch -arm64 ./configure --prefix=$HOME/ python-arm64 --enable-optimizations
23
+ arch -arm64 ./configure --prefix=/tmp/ python-build --enable-optimizations
24
24
arch -arm64 make -j$(sysctl -n hw.ncpu)
25
25
arch -arm64 make install
26
26
27
+ sudo mkdir -p /tmp/python-build/lib/tmp
28
+ cd /tmp/python-build/lib/tmp
29
+ sudo ar -x ../libpython3.11.a
30
+ sudo gcc -m32 -shared -o ../libpython-3.11.8.dylib *.o
31
+
32
+ cd /tmp/python-build/lib
33
+ sudo rm -rf tmp
34
+ ls
35
+
36
+ # Remove unimportant files that take up lots of space
37
+ sudo rm -rf /tmp/python-build/lib/python3.11/test/
38
+ sudo rm -rf /tmp/python-build/lib/python3.11/__pycache__/
39
+ sudo rm -rf /tmp/python-build/lib/python3.11/config-3.11-darwin/
40
+ sudo rm -rf /tmp/python-build/lib/python3.11/tkinter/
41
+ sudo rm -rf /tmp/python-build/lib/python3.11/idlelib/
42
+ sudo rm -rf /tmp/python-build/lib/python3.11/turtledemo/
43
+
44
+ # Remove the static library as we've built a shared library
45
+ sudo rm /tmp/python-build/lib/libpython3.11.a
46
+
47
+ # Strip the build binaries to reduce size
48
+ sudo strip /tmp/python-build/bin/python3.11
49
+ sudo strip /tmp/python-build/lib/libpython-3.11.8.dylib
50
+
51
+ # Remove extra bin files that are not needed
52
+ sudo rm /tmp/python-build/bin/python3.11-config
53
+ sudo rm /tmp/python-build/bin/idle3.11
54
+ sudo rm /tmp/python-build/bin/pydoc3.11
55
+ sudo rm /tmp/python-build/bin/pip3.11
56
+ sudo rm /tmp/python-build/bin/2to3-3.11
57
+
27
58
- name : Verify Build
28
59
run : |
29
- $HOME/ python-arm64 /bin/python3 --version
30
- $HOME/ python-arm64 /bin/python3 -c "import platform; print(platform.machine())"
60
+ /tmp/ python-build /bin/python3 --version
61
+ /tmp/ python-build /bin/python3 -c "import platform; print(platform.machine())"
31
62
file $HOME/python-arm64/bin/python3
32
63
33
64
- name : Upload Python Artifact
34
65
uses : actions/upload-artifact@v4
35
66
with :
36
67
name : python-arm64-macos
37
- path : /Users/runner/ python-arm64 /
68
+ path : /tmp/ python-build /
38
69
include-hidden-files : ' true'
0 commit comments