Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- {os: ubuntu-24.04-arm, arch: aarch64}
- {os: ubuntu-latest, arch: i686}
- {os: ubuntu-latest, arch: x86_64}
- {os: macos-13, arch: x86_64}
- {os: macos-14, arch: x86_64}
- {os: macos-14, arch: arm64}
fail-fast: false

Expand All @@ -71,14 +71,15 @@ jobs:
run: brew unlink pcre2

- name: Build wheels
uses: pypa/cibuildwheel@v2.20.0
uses: pypa/cibuildwheel@v3.3.1
with:
output-dir: dist
package-dir: ./${{ needs.build_sdist.outputs.sdist_name }}
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_SKIP: cp36-* cp38-macosx_arm64 pp*
CIBW_SKIP: cp38-macosx_arm64 cp31?t-*
CIBW_ENVIRONMENT: UWSGI_PROFILE=pyuwsginossl
CIBW_ENVIRONMENT_MACOS: UWSGI_PROFILE=pyuwsginossl ARCHFLAGS="${{ matrix.arch == 'x86_64' && '-arch x86_64' || '-arch arm64' }}" APPEND_CFLAGS="${{ matrix.arch == 'x86_64' && '-arch x86_64' || '-arch arm64' }}" LDFLAGS="${{ matrix.arch == 'x86_64' && '-arch x86_64' || '-arch arm64' }}"
CIBW_TEST_COMMAND: "pyuwsgi --help"
CIBW_BEFORE_BUILD_MACOS: "find . -name '*.o' -delete && IS_MACOS=1 ./pre_build.sh"
CIBW_BEFORE_BUILD_LINUX: "find . -name '*.o' -delete && ./pre_build.sh && (yum install -y zlib-devel || apk add zlib-dev)"
Expand Down
32 changes: 22 additions & 10 deletions pre_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,26 @@ set -eu -o pipefail

if [ -n "${IS_MACOS:-}" ]; then
# make sure the linked binaries are equivalent to our target
python="$(command -v python)"
min_ver="$(
otool -l "$python" |
grep -A2 LC_VERSION_MIN_MACOSX |
tail -1 |
awk '{print $2}'
)"
export MACOSX_DEPLOYMENT_TARGET="$min_ver"
if [ -z "${MACOSX_DEPLOYMENT_TARGET:-}" ]; then
python="$(command -v python)"
# Python < 3.14 uses LC_VERSION_MIN_MACOSX; Python 3.14+ uses LC_BUILD_VERSION
min_ver="$(
otool -l "$python" |
grep -A2 LC_VERSION_MIN_MACOSX |
tail -1 |
awk '{print $2}'
)" || min_ver="$(
otool -l "$python" |
grep -A4 LC_BUILD_VERSION |
grep "minos" |
awk '{print $2}'
)"
if [ -z "$min_ver" ]; then
echo "ERROR: Could not determine MACOSX_DEPLOYMENT_TARGET from binary" >&2
exit 1
fi
export MACOSX_DEPLOYMENT_TARGET="$min_ver"
fi
make_install=(sudo make install)
else
make_install=(make install)
Expand Down Expand Up @@ -78,7 +90,7 @@ function build_pcre2 {
fetch_unpack "${PCRE2_DOWNLOAD_URL}"
check_sha256sum "${ARCHIVES_SDIR:-archives}/${PCRE2_ROOT}.tar.gz" "$PCRE2_HASH"
(cd "${PCRE2_ROOT}" \
&& ./configure --prefix="$BUILD_PREFIX" \
&& CFLAGS="${ARCHFLAGS:-}" LDFLAGS="${ARCHFLAGS:-}" ./configure --prefix="$BUILD_PREFIX" \
&& make -j4 \
&& "${make_install[@]}")
touch pcre2-stamp
Expand Down Expand Up @@ -106,7 +118,7 @@ function build_jansson {
fetch_unpack "${JANSSON_DOWNLOAD_URL}"
check_sha256sum "${ARCHIVE_SDIR:-archives}/${JANSSON_ROOT}.tar.gz" "${JANSSON_HASH}"
(cd "${JANSSON_ROOT}" \
&& ./configure --prefix="$BUILD_PREFIX" \
&& CFLAGS="${ARCHFLAGS:-}" LDFLAGS="${ARCHFLAGS:-}" ./configure --prefix="$BUILD_PREFIX" \
&& make -j4 \
&& "${make_install[@]}")
touch jansson-stamp
Expand Down
Loading