From ff5adbbc1092f8525105325075d8cf712d82aad4 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Mon, 5 Aug 2024 15:27:56 +0800 Subject: [PATCH 1/3] Remove tool definitions from configure invocation. --- Makefile | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Makefile b/Makefile index 5982899..8fa2cb2 100644 --- a/Makefile +++ b/Makefile @@ -124,10 +124,8 @@ ARCH-$(target)=$$(subst .,,$$(suffix $(target))) ifneq ($(os),macOS) ifeq ($$(findstring simulator,$$(SDK-$(target))),) TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-$$(OS_LOWER-$(target))$$(VERSION_MIN-$(os)) -TARGET_TOOL_TRIPLE-$(target)=$$(ARCH-$(target))-apple-$$(OS_LOWER-$(target)) else TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-$$(OS_LOWER-$(target))$$(VERSION_MIN-$(os))-simulator -TARGET_TOOL_TRIPLE-$(target)=$$(ARCH-$(target))-apple-$$(OS_LOWER-$(target))-simulator endif endif @@ -280,10 +278,6 @@ $$(PYTHON_SRCDIR-$(target))/Makefile: \ cd $$(PYTHON_SRCDIR-$(target)) && \ PATH="$(PROJECT_DIR)/$$(PYTHON_SRCDIR-$(target))/$(os)/Resources/bin:$(PATH)" \ ./configure \ - AR=$$(TARGET_TOOL_TRIPLE-$(target))-ar \ - CC=$$(TARGET_TOOL_TRIPLE-$(target))-clang \ - CPP=$$(TARGET_TOOL_TRIPLE-$(target))-cpp \ - CXX=$$(TARGET_TOOL_TRIPLE-$(target))-clang \ LIBLZMA_CFLAGS="-I$$(XZ_INSTALL-$(target))/include" \ LIBLZMA_LIBS="-L$$(XZ_INSTALL-$(target))/lib -llzma" \ BZIP2_CFLAGS="-I$$(BZIP2_INSTALL-$(target))/include" \ From 68ea0febaeb929f232b32ddeb7842103231db6ec Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 6 Aug 2024 11:23:25 +0800 Subject: [PATCH 2/3] Differentiate the binary package version number from the source version number. --- .github/workflows/ci.yaml | 4 ++++ Makefile | 13 +++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9688eb2..380a313 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,6 +1,10 @@ name: CI on: pull_request: + push: + branches: + - main + - 3.* env: FORCE_COLOR: "1" diff --git a/Makefile b/Makefile index 8fa2cb2..e579690 100644 --- a/Makefile +++ b/Makefile @@ -13,10 +13,15 @@ BUILD_NUMBER=custom # Version of packages that will be compiled by this meta-package # PYTHON_VERSION is the full version number (e.g., 3.10.0b3) +# PYTHON_PKG_VERSION is the version number with binary package releases to use +# for macOS binaries. This will be less than PYTHON_VERSION towards the end +# of a release cycle, as official binaries won't be published. # PYTHON_MICRO_VERSION is the full version number, without any alpha/beta/rc suffix. (e.g., 3.10.0) # PYTHON_VER is the major/minor version (e.g., 3.10) PYTHON_VERSION=3.13.0rc1 +PYTHON_PKG_VERSION=$(PYTHON_VERSION) PYTHON_MICRO_VERSION=$(shell echo $(PYTHON_VERSION) | grep -Eo "\d+\.\d+\.\d+") +PYTHON_PKG_MICRO_VERSION=$(shell echo $(PYTHON_PKG_VERSION) | grep -Eo "\d+\.\d+\.\d+") PYTHON_VER=$(basename $(PYTHON_VERSION)) # The binary releases of dependencies, published at: @@ -96,11 +101,11 @@ downloads/Python-$(PYTHON_VERSION).tar.gz: curl $(CURL_FLAGS) -o $@ \ https://www.python.org/ftp/python/$(PYTHON_MICRO_VERSION)/Python-$(PYTHON_VERSION).tgz -downloads/python-$(PYTHON_VERSION)-macos11.pkg: +downloads/python-$(PYTHON_PKG_VERSION)-macos11.pkg: @echo ">>> Download macOS Python package" mkdir -p downloads curl $(CURL_FLAGS) -o $@ \ - https://www.python.org/ftp/python/$(PYTHON_MICRO_VERSION)/python-$(PYTHON_VERSION)-macos11.pkg + https://www.python.org/ftp/python/$(PYTHON_PKG_MICRO_VERSION)/python-$(PYTHON_PKG_VERSION)-macos11.pkg ########################################################################### # Build for specified target (from $(TARGETS-*)) @@ -522,7 +527,7 @@ ifeq ($(os),macOS) PYTHON_FRAMEWORK-$(os)=$$(PYTHON_INSTALL-$(sdk))/Python.framework $$(PYTHON_XCFRAMEWORK-$(os))/Info.plist: \ - downloads/python-$(PYTHON_VERSION)-macos11.pkg + downloads/python-$(PYTHON_PKG_VERSION)-macos11.pkg @echo ">>> Repackage macOS package as XCFramework" # Unpack .pkg file. It turns out .pkg files are readable by tar... although @@ -530,7 +535,7 @@ $$(PYTHON_XCFRAMEWORK-$(os))/Info.plist: \ # is a tarball that contains additional tarballs; the inner tarball has the # "payload" that is the framework. mkdir -p build/macOS/macosx/python-$(PYTHON_VERSION) - tar zxf downloads/python-$(PYTHON_VERSION)-macos11.pkg -C build/macOS/macosx/python-$(PYTHON_VERSION) + tar zxf downloads/python-$(PYTHON_PKG_VERSION)-macos11.pkg -C build/macOS/macosx/python-$(PYTHON_VERSION) # Unpack payload inside .pkg file mkdir -p $$(PYTHON_FRAMEWORK-macosx) From 600b9e07e025f44806a0cb67d14a2d6b074dee0b Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 6 Aug 2024 11:26:00 +0800 Subject: [PATCH 3/3] Normalize ordering of dependent libraries. --- .github/workflows/release.yaml | 15 +++++++++------ Makefile | 24 ++++++++++++------------ 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7abd420..b49127c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -55,15 +55,17 @@ jobs: run: | PYTHON_VERSION=$(grep "Python version:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 3) BZIP2_VERSION=$(grep "BZip2:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2) - XZ_VERSION=$(grep "XZ:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2) - OPENSSL_VERSION=$(grep "OpenSSL:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2) LIBFFI_VERSION=$(grep "libFFI:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2) + MPDECIMAL_VERSION=$(grep "mpdecimal:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2) + OPENSSL_VERSION=$(grep "OpenSSL:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2) + XZ_VERSION=$(grep "XZ:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2) echo "PYTHON_VERSION=${PYTHON_VERSION}" | tee -a ${GITHUB_OUTPUT} echo "BZIP2_VERSION=${BZIP2_VERSION}" | tee -a ${GITHUB_OUTPUT} - echo "XZ_VERSION=${XZ_VERSION}" | tee -a ${GITHUB_OUTPUT} - echo "OPENSSL_VERSION=${OPENSSL_VERSION}" | tee -a ${GITHUB_OUTPUT} echo "LIBFFI_VERSION=${LIBFFI_VERSION}" | tee -a ${GITHUB_OUTPUT} + echo "MPDECIMAL_VERSION=${MPDECIMAL_VERSION}" | tee -a ${GITHUB_OUTPUT} + echo "OPENSSL_VERSION=${OPENSSL_VERSION}" | tee -a ${GITHUB_OUTPUT} + echo "XZ_VERSION=${XZ_VERSION}" | tee -a ${GITHUB_OUTPUT} - name: Upload Build Artifact uses: actions/upload-artifact@v4.3.5 @@ -95,8 +97,9 @@ jobs: Includes: * Python ${{ needs.build.outputs.PYTHON_VERSION }} - * OpenSSL ${{ needs.build.outputs.OPENSSL_VERSION }} * BZip2 ${{ needs.build.outputs.BZIP2_VERSION }} + * libFFI ${{ needs.build.outputs.LIBFFI_VERSION }} + * mpdecimal ${{ needs.build.outputs.MPDECIMAL_VERSION }} + * OpenSSL ${{ needs.build.outputs.OPENSSL_VERSION }} * XZ ${{ needs.build.outputs.XZ_VERSION }} - * LibFFI ${{ needs.build.outputs.LIBFFI_VERSION }} artifacts: "dist/*" diff --git a/Makefile b/Makefile index e579690..a05906c 100644 --- a/Makefile +++ b/Makefile @@ -27,10 +27,10 @@ PYTHON_VER=$(basename $(PYTHON_VERSION)) # The binary releases of dependencies, published at: # https://github.com/beeware/cpython-apple-source-deps/releases BZIP2_VERSION=1.0.8-1 +LIBFFI_VERSION=3.4.6-1 MPDECIMAL_VERSION=4.0.0-1 OPENSSL_VERSION=3.0.14-1 XZ_VERSION=5.4.7-1 -LIBFFI_VERSION=3.4.6-1 # Supported OS OS_LIST=macOS iOS tvOS watchOS @@ -263,10 +263,10 @@ PYTHON_STDLIB-$(target)=$$(PYTHON_INSTALL-$(target))/lib/python$(PYTHON_VER) $$(PYTHON_SRCDIR-$(target))/configure: \ downloads/Python-$(PYTHON_VERSION).tar.gz \ $$(BZIP2_LIB-$(target)) \ - $$(XZ_LIB-$(target)) \ - $$(OPENSSL_SSL_LIB-$(target)) \ + $$(LIBFFI_LIB-$(target)) \ $$(MPDECIMAL_LIB-$(target)) \ - $$(LIBFFI_LIB-$(target)) + $$(OPENSSL_SSL_LIB-$(target)) \ + $$(XZ_LIB-$(target)) @echo ">>> Unpack and configure Python for $(target)" mkdir -p $$(PYTHON_SRCDIR-$(target)) tar zxf downloads/Python-$(PYTHON_VERSION).tar.gz --strip-components 1 -C $$(PYTHON_SRCDIR-$(target)) @@ -341,14 +341,14 @@ vars-$(target): @echo "SDK_ROOT-$(target): $$(SDK_ROOT-$(target))" @echo "BZIP2_INSTALL-$(target): $$(BZIP2_INSTALL-$(target))" @echo "BZIP2_LIB-$(target): $$(BZIP2_LIB-$(target))" - @echo "XZ_INSTALL-$(target): $$(XZ_INSTALL-$(target))" - @echo "XZ_LIB-$(target): $$(XZ_LIB-$(target))" - @echo "OPENSSL_INSTALL-$(target): $$(OPENSSL_INSTALL-$(target))" - @echo "OPENSSL_SSL_LIB-$(target): $$(OPENSSL_SSL_LIB-$(target))" - @echo "MPDECIMAL_INSTALL-$(target): $$(MPDECIMAL_INSTALL-$(target))" - @echo "MPDECIMAL_LIB-$(target): $$(MPDECIMAL_LIB-$(target))" @echo "LIBFFI_INSTALL-$(target): $$(LIBFFI_INSTALL-$(target))" @echo "LIBFFI_LIB-$(target): $$(LIBFFI_LIB-$(target))" + @echo "MPDECIMAL_INSTALL-$(target): $$(MPDECIMAL_INSTALL-$(target))" + @echo "MPDECIMAL_LIB-$(target): $$(MPDECIMAL_LIB-$(target))" + @echo "OPENSSL_INSTALL-$(target): $$(OPENSSL_INSTALL-$(target))" + @echo "OPENSSL_SSL_LIB-$(target): $$(OPENSSL_SSL_LIB-$(target))" + @echo "XZ_INSTALL-$(target): $$(XZ_INSTALL-$(target))" + @echo "XZ_LIB-$(target): $$(XZ_LIB-$(target))" @echo "PYTHON_SRCDIR-$(target): $$(PYTHON_SRCDIR-$(target))" @echo "PYTHON_INSTALL-$(target): $$(PYTHON_INSTALL-$(target))" @echo "PYTHON_FRAMEWORK-$(target): $$(PYTHON_FRAMEWORK-$(target))" @@ -600,10 +600,10 @@ $$(PYTHON_XCFRAMEWORK-$(os))/Info.plist: \ echo "Build: $(BUILD_NUMBER)" >> support/$(PYTHON_VER)/$(os)/VERSIONS echo "Min $(os) version: $$(VERSION_MIN-$(os))" >> support/$(PYTHON_VER)/$(os)/VERSIONS echo "---------------------" >> support/$(PYTHON_VER)/$(os)/VERSIONS - echo "libFFI: $(LIBFFI_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS echo "BZip2: $(BZIP2_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS - echo "OpenSSL: $(OPENSSL_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS + echo "libFFI: $(LIBFFI_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS echo "mpdecimal: $(MPDECIMAL_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS + echo "OpenSSL: $(OPENSSL_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS echo "XZ: $(XZ_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS dist/Python-$(PYTHON_VER)-$(os)-support.$(BUILD_NUMBER).tar.gz: \