Skip to content

Commit 46ce00f

Browse files
authored
Update patch for recent 3.13 changes (#260)
* Update patch to include recent changes in the 3.13 branch * Incorporate changes to main workflow * Automate generation of modulemap
1 parent f2ab588 commit 46ce00f

File tree

6 files changed

+436
-173
lines changed

6 files changed

+436
-173
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
name: CI
22
on:
33
pull_request:
4-
push:
5-
branches:
6-
- main
7-
- 3.*
84
workflow_call:
95
inputs:
106
build-number:
@@ -114,14 +110,17 @@ jobs:
114110
# Appending -dev ensures that we can always build the dev release.
115111
# It's a no-op for versions that have been published.
116112
python-version: ${{ needs.config.outputs.PYTHON_VER }}-dev
113+
# Ensure that we *always* use the latest build, not a cached version.
114+
# It's an edge case, but when a new alpha is released, we need to use it ASAP.
115+
check-latest: true
117116

118117
- name: Build ${{ matrix.target }}
119118
run: |
120119
# Do the build for the requested target.
121120
make ${{ matrix.target }} BUILD_NUMBER=${{ needs.config.outputs.BUILD_NUMBER }}
122121
123122
- name: Upload build artefacts
124-
uses: actions/[email protected].0
123+
uses: actions/[email protected].1
125124
with:
126125
name: Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
127126
path: dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ jobs:
4040
needs: [ config, ci ]
4141
steps:
4242
- name: Get build artifacts
43-
uses: actions/[email protected].8
43+
uses: actions/[email protected].9
4444
with:
4545
pattern: Python-*
4646
path: dist
4747
merge-multiple: true
4848

4949
- name: Create Release
50-
uses: ncipollo/release-action@v1.15.0
50+
uses: ncipollo/release-action@v1.16.0
5151
with:
5252
name: ${{ needs.ci.outputs.PYTHON_VER }}-${{ needs.config.outputs.BUILD_NUMBER }}
5353
tag: ${{ needs.ci.outputs.PYTHON_VER }}-${{ needs.config.outputs.BUILD_NUMBER }}

Makefile

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ PYTHON_FRAMEWORK-$(sdk)=$$(PYTHON_INSTALL-$(sdk))/Python.framework
426426
PYTHON_INSTALL_VERSION-$(sdk)=$$(PYTHON_FRAMEWORK-$(sdk))/Versions/$(PYTHON_VER)
427427
PYTHON_LIB-$(sdk)=$$(PYTHON_INSTALL_VERSION-$(sdk))/Python
428428
PYTHON_INCLUDE-$(sdk)=$$(PYTHON_INSTALL_VERSION-$(sdk))/include/python$(PYTHON_VER)
429+
PYTHON_MODULEMAP-$(sdk)=$$(PYTHON_INCLUDE-$(sdk))/module.modulemap
429430
PYTHON_STDLIB-$(sdk)=$$(PYTHON_INSTALL_VERSION-$(sdk))/lib/python$(PYTHON_VER)
430431

431432
else
@@ -436,6 +437,7 @@ else
436437
# The non-macOS frameworks don't use the versioning structure.
437438

438439
PYTHON_INSTALL-$(sdk)=$(PROJECT_DIR)/install/$(os)/$(sdk)/python-$(PYTHON_VERSION)
440+
PYTHON_MODULEMAP-$(sdk)=$$(PYTHON_INCLUDE-$(sdk))/module.modulemap
439441
PYTHON_FRAMEWORK-$(sdk)=$$(PYTHON_INSTALL-$(sdk))/Python.framework
440442
PYTHON_LIB-$(sdk)=$$(PYTHON_FRAMEWORK-$(sdk))/Python
441443
PYTHON_BIN-$(sdk)=$$(PYTHON_INSTALL-$(sdk))/bin
@@ -466,8 +468,14 @@ $$(PYTHON_INCLUDE-$(sdk))/pyconfig.h: $$(PYTHON_LIB-$(sdk))
466468
# Copy headers as-is from the first target in the $(sdk) SDK
467469
cp -r $$(PYTHON_INCLUDE-$$(firstword $$(SDK_TARGETS-$(sdk)))) $$(PYTHON_INCLUDE-$(sdk))
468470

469-
# Copy in the modulemap file
470-
cp -r patch/Python/module.modulemap $$(PYTHON_INCLUDE-$(sdk))
471+
# Create the modulemap file
472+
cp -r patch/Python/module.modulemap.prefix $$(PYTHON_MODULEMAP-$(sdk))
473+
echo "" >> $$(PYTHON_MODULEMAP-$(sdk))
474+
cd $$(PYTHON_SRCDIR-$$(firstword $$(SDK_TARGETS-$(sdk))))/Include && \
475+
find cpython -name "*.h" | sort | sed -e 's/^/ exclude header "/' | sed 's/$$$$/"/' >> $$(PYTHON_MODULEMAP-$(sdk)) && \
476+
echo "" >> $$(PYTHON_MODULEMAP-$(sdk)) && \
477+
find internal -name "*.h" | sort | sed -e 's/^/ exclude header "/' | sed 's/$$$$/"/' >> $$(PYTHON_MODULEMAP-$(sdk))
478+
echo "\n}" >> $$(PYTHON_MODULEMAP-$(sdk))
471479

472480
# Link the PYTHONHOME version of the headers
473481
mkdir -p $$(PYTHON_INSTALL-$(sdk))/include
@@ -583,8 +591,14 @@ $$(PYTHON_XCFRAMEWORK-$(os))/Info.plist: \
583591
# Rewrite the framework to make it standalone
584592
patch/make-relocatable.sh $$(PYTHON_INSTALL_VERSION-macosx) 2>&1 > /dev/null
585593

586-
# Copy in the modulemap file
587-
cp -r patch/Python/module.modulemap $$(PYTHON_FRAMEWORK-macosx)/Headers
594+
# Create the modulemap file
595+
cp -r patch/Python/module.modulemap.prefix $$(PYTHON_MODULEMAP-macosx)
596+
echo "" >> $$(PYTHON_MODULEMAP-macosx)
597+
cd $$(PYTHON_INCLUDE-macosx) && \
598+
find cpython -name "*.h" | sort | sed -e 's/^/ exclude header "/' | sed 's/$$$$/"/' >> $$(PYTHON_MODULEMAP-macosx) && \
599+
echo "" >> $$(PYTHON_MODULEMAP-macosx) && \
600+
find internal -name "*.h" | sort | sed -e 's/^/ exclude header "/' | sed 's/$$$$/"/' >> $$(PYTHON_MODULEMAP-macosx)
601+
echo "\n}" >> $$(PYTHON_MODULEMAP-macosx)
588602

589603
# Re-apply the signature on the binaries.
590604
codesign -s - --preserve-metadata=identifier,entitlements,flags,runtime -f $$(PYTHON_LIB-macosx) \

0 commit comments

Comments
 (0)