Skip to content

Commit e78b6a0

Browse files
authored
Merge pull request #2494 from pygame-community/ankith26-macos-13
Bump gh actions mac runners (gets us native M1 builds)
2 parents 810b1eb + 69a7e0e commit e78b6a0

File tree

12 files changed

+47
-64
lines changed

12 files changed

+47
-64
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- run:
4949
name: Build the Linux wheels.
5050
command: |
51-
pip3 install --user cibuildwheel==2.16.4
51+
pip3 install --user cibuildwheel==2.17.0
5252
PATH="$HOME/.local/bin:$PATH" cibuildwheel --output-dir wheelhouse
5353
5454
- store_artifacts:

.github/workflows/build-macos.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@ concurrency:
3838
jobs:
3939
deps:
4040
name: ${{ matrix.macarch }} deps
41-
runs-on: macos-12
41+
runs-on: ${{ matrix.os }}
4242
strategy:
4343
matrix:
4444
# make arm64 deps and x86_64 deps
45-
macarch: [arm64, x86_64]
45+
include:
46+
- { macarch: arm64, os: macos-14 }
47+
- { macarch: x86_64, os: macos-13 }
4648

4749
steps:
4850
- uses: actions/[email protected]
@@ -54,7 +56,7 @@ jobs:
5456
path: ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }}
5557
# The hash of all files in buildconfig manylinux-build and macdependencies is
5658
# the key to the cache. If anything changes here, the deps are built again
57-
key: macdep-${{ hashFiles('buildconfig/manylinux-build/**') }}-${{ hashFiles('buildconfig/macdependencies/*.sh') }}-${{ matrix.macarch }}
59+
key: macdep-${{ hashFiles('buildconfig/manylinux-build/**') }}-${{ hashFiles('buildconfig/macdependencies/*.sh') }}-${{ matrix.macarch }}-${{ matrix.os }}
5860
lookup-only: true
5961

6062
# build mac deps on cache miss
@@ -76,7 +78,7 @@ jobs:
7678
build:
7779
name: ${{ matrix.name }}
7880
needs: deps
79-
runs-on: macos-12
81+
runs-on: ${{ matrix.os }}
8082
strategy:
8183
fail-fast: false # if a particular matrix build fails, don't skip the rest
8284
matrix:
@@ -87,31 +89,36 @@ jobs:
8789
- {
8890
name: "x86_64 (CPython 3.9 - 3.12)",
8991
macarch: x86_64,
92+
os: macos-13,
9093
pyversions: "cp3{9,10,11,12}-*",
9194
}
9295

9396
- {
9497
name: "x86_64 (Python 3.8)",
9598
macarch: x86_64,
99+
os: macos-13,
96100
# CPython/PyPy 3.8
97101
pyversions: "?p38-*",
98102
}
99103

100104
- {
101105
name: "x86_64 (PyPy 3.9 and 3.10)",
102106
macarch: x86_64,
107+
os: macos-13,
103108
pyversions: "pp39-* pp310-*",
104109
}
105110

106111
- {
107112
name: "arm64 (CPython 3.8 - 3.10)",
108113
macarch: arm64,
114+
os: macos-14,
109115
pyversions: "cp3{8,9,10}-*",
110116
}
111117

112118
- {
113119
name: "arm64 (CPython 3.11 - 3.12)",
114120
macarch: arm64,
121+
os: macos-14,
115122
pyversions: "cp3{11,12}-*",
116123
}
117124

@@ -135,8 +142,6 @@ jobs:
135142

136143
CIBW_BUILD: ${{ matrix.pyversions }}
137144

138-
# Build arm64 and x86_64 wheels too on an Intel runner.
139-
# Note that the arm64 wheels cannot be tested on CI in this configuration
140145
CIBW_ARCHS: ${{ matrix.macarch }}
141146

142147
# Setup macOS dependencies
@@ -177,7 +182,7 @@ jobs:
177182
fail-on-cache-miss: true
178183

179184
- name: Build and test wheels
180-
uses: pypa/cibuildwheel@v2.16.4
185+
uses: pypa/cibuildwheel@v2.17.0
181186

182187
- uses: actions/upload-artifact@v4
183188
with:

.github/workflows/build-manylinux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ jobs:
118118
CIBW_MANYLINUX_I686_IMAGE: ghcr.io/${{ github.repository }}_i686:${{ steps.meta.outputs.version }}
119119
CIBW_MANYLINUX_PYPY_I686_IMAGE: ghcr.io/${{ github.repository }}_i686:${{ steps.meta.outputs.version }}
120120

121-
uses: pypa/cibuildwheel@v2.16.4
121+
uses: pypa/cibuildwheel@v2.17.0
122122

123123
# We upload the generated files under github actions assets
124124
- name: Upload dist

.github/workflows/build-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ jobs:
147147
arch: ${{ matrix.msvc-dev-arch }}
148148

149149
- name: Build and test wheels
150-
uses: pypa/cibuildwheel@v2.16.5
150+
uses: pypa/cibuildwheel@v2.17.0
151151

152152
- uses: actions/upload-artifact@v4
153153
with:

buildconfig/macdependencies/README.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ It deletes some homebrew files, and messes with /usr/local/.
77

88
Warning: *do not run on your own machine*.
99

10-
It tries to work as far back as Mac OSX 10.9, for x64 and arm64 (cross compiled)
11-
architectures.
10+
It tries to work as far back as Mac OSX 10.11, for x64 and arm64 architectures.
1211

1312
If there needs to be separate configure options between linux and mac
1413
then something like the following can be used.

buildconfig/macdependencies/build_mac_deps.sh

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,8 @@ export PG_BASE_MESON_FLAGS="--prefix=$PG_DEP_PREFIX \
4040
-Ddefault_library=shared"
4141

4242
if [[ "$MAC_ARCH" == "arm64" ]]; then
43-
# for scripts using ./configure to make arm64 binaries
44-
export CC="clang -target arm64-apple-macos11.0"
45-
export CXX="clang++ -target arm64-apple-macos11.0"
46-
47-
# This does not do anything actually, but without this ./configure errors
48-
export PG_BASE_CONFIGURE_FLAGS="$PG_BASE_CONFIGURE_FLAGS --host=aarch64-apple-darwin20.0.0"
49-
50-
# configure cmake to cross-compile
51-
export PG_BASE_CMAKE_FLAGS="$PG_BASE_CMAKE_FLAGS -DCMAKE_OSX_ARCHITECTURES=arm64"
52-
53-
# configure meson to cross-compile
54-
export PG_BASE_MESON_FLAGS="$PG_BASE_MESON_FLAGS --cross-file $(pwd)/macos_arm64.ini"
43+
# needs native-file that has correct macosx deployment target
44+
export PG_BASE_MESON_FLAGS="$PG_BASE_MESON_FLAGS --native-file $(pwd)/macos_arm64.ini"
5545

5646
# we don't need mac 10.9 support while compiling for apple M1 macs
5747
export MACOSX_DEPLOYMENT_TARGET=11.0

buildconfig/macdependencies/clean_usr_local.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
# First clean up some homebrew stuff we don't want linked in
55
# ----------------------------------------------------------
66

7-
rm -rf /usr/local/bin/curl
8-
rm -rf /usr/local/opt/curl
9-
rm -rf /usr/local/bin/git
10-
rm -rf /usr/local/opt/git
7+
rm -rf /usr/local/bin/curl /usr/local/opt/curl /opt/homebrew/bin/curl
8+
rm -rf /usr/local/bin/git /usr/local/opt/git /opt/homebrew/bin/git
119
# Use the apple provided curl, and git.
1210
# The homebrew ones depend on libs we don't want to include.
1311
# ln -s /usr/bin/curl /usr/local/bin/curl
1412
ln -s /usr/bin/git /usr/local/bin/git
13+
ln -s /usr/bin/git /opt/homebrew/bin/git
1514

1615
rm -rf /usr/local/lib/libtiff*
1716
rm -rf /usr/local/lib/libzstd*
@@ -23,16 +22,17 @@ rm -rf /usr/local/lib/libgthread*
2322
rm -rf /usr/local/lib/libintl*
2423
rm -rf /usr/local/lib/libbrotlidec*
2524
rm -rf /usr/local/lib/libopus*
26-
rm -rf /usr/local/opt/freetype
25+
rm -rf /usr/local/lib/freetype*
26+
rm -rf /usr/local/opt/freetype*
2727

28-
rm -rf /usr/local/Cellar/libtiff
29-
rm -rf /usr/local/Cellar/libsndfile
30-
rm -rf /usr/local/Cellar/glib
31-
rm -rf /usr/local/Cellar/brotli
32-
rm -rf /usr/local/Cellar/pcre*
33-
rm -rf /usr/local/Cellar/opusfile
34-
rm -rf /usr/local/Cellar/opus
35-
rm -rf /usr/local/Cellar/freetype
28+
rm -rf /usr/local/Cellar/libtiff /opt/homebrew/Cellar/libtiff
29+
rm -rf /usr/local/Cellar/libsndfile /opt/homebrew/Cellar/libsndfile
30+
rm -rf /usr/local/Cellar/glib /opt/homebrew/Cellar/glib
31+
rm -rf /usr/local/Cellar/brotli /opt/homebrew/Cellar/brotli
32+
rm -rf /usr/local/Cellar/pcre* /opt/homebrew/Cellar/pcre*
33+
rm -rf /usr/local/Cellar/opusfile /opt/homebrew/Cellar/opusfile
34+
rm -rf /usr/local/Cellar/opus /opt/homebrew/Cellar/opus
35+
rm -rf /usr/local/Cellar/freetype* /opt/homebrew/Cellar/freetype*
3636

3737
rm -rf /usr/local/share/doc/tiff-*
3838
rm -rf /usr/local/share/doc/libsndfile
Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
[constants]
22
macos_ver = ['-mmacosx-version-min=11.0']
3-
macos_arch = ['-arch', 'arm64']
4-
5-
[host_machine]
6-
system = 'darwin'
7-
cpu_family = 'aarch64'
8-
cpu = 'arm64'
9-
endian = 'little'
103

114
[binaries]
125
c = ['clang']
@@ -18,11 +11,11 @@ strip = ['strip']
1811
pkgconfig = ['pkg-config']
1912

2013
[built-in options]
21-
c_args = macos_arch + macos_ver
22-
cpp_args = macos_arch + macos_ver + ['-stdlib=libc++']
23-
objc_args = macos_arch + macos_ver
24-
objcpp_args = macos_arch + macos_ver + ['-stdlib=libc++']
25-
c_link_args = macos_arch + macos_ver
26-
cpp_link_args = macos_arch + macos_ver
27-
objc_link_args = macos_arch + macos_ver
28-
objcpp_link_args = macos_arch + macos_ver
14+
c_args = macos_ver
15+
cpp_args = macos_ver + ['-stdlib=libc++']
16+
objc_args = macos_ver
17+
objcpp_args = macos_ver + ['-stdlib=libc++']
18+
c_link_args = macos_ver
19+
cpp_link_args = macos_ver
20+
objc_link_args = macos_ver
21+
objcpp_link_args = macos_ver

buildconfig/manylinux-build/docker_base/buildtools/install.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ cd $(dirname `readlink -f "$0"`)
1010
# separate build script for it
1111

1212
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
13-
export PG_LINUX_EXTRA_FLAGS="--user"
13+
export PG_PIP_EXTRA_FLAGS="--user"
14+
elif [[ "$OSTYPE" == "darwin"* ]]; then
15+
export PG_PIP_EXTRA_FLAGS="--break-system-packages"
1416
fi
1517

1618
# pin versions for stability (remember to keep updated)
17-
python3 -m pip install $PG_LINUX_EXTRA_FLAGS \
19+
python3 -m pip install $PG_PIP_EXTRA_FLAGS \
1820
setuptools==68.2.2 cmake==3.27.6 meson==1.2.2 ninja==1.11.1
1921

2022
if [[ "$OSTYPE" == "linux-gnu"* ]]; then

buildconfig/manylinux-build/docker_base/glib/build-glib.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ tar xf ${GLIB}.tar
1515
cd $GLIB
1616

1717
# a minimal glib install will do for us
18-
meson setup _build $PG_BASE_MESON_FLAGS -Dtests=false \
18+
meson setup _build $PG_BASE_MESON_FLAGS --force-fallback-for libpcre2-8 -Dtests=false \
1919
-Dselinux=disabled -Dlibmount=disabled -Ddtrace=false -Dsystemtap=false -Dnls=disabled
2020

2121
meson compile -C _build

0 commit comments

Comments
 (0)