-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-120522: Apply App Store compliance patch during installation #121947
Changes from all commits
a476e1f
748e29d
4bff322
a521f2a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py | ||
index d6c83a75c1c..19ed4e01091 100644 | ||
--- a/Lib/test/test_urlparse.py | ||
+++ b/Lib/test/test_urlparse.py | ||
@@ -237,11 +237,6 @@ def test_roundtrips(self): | ||
'','',''), | ||
('git+ssh', 'git@github.com','/user/project.git', | ||
'', '')), | ||
- ('itms-services://?action=download-manifest&url=https://example.com/app', | ||
- ('itms-services', '', '', '', | ||
- 'action=download-manifest&url=https://example.com/app', ''), | ||
- ('itms-services', '', '', | ||
- 'action=download-manifest&url=https://example.com/app', '')), | ||
('+scheme:path/to/file', | ||
('', '', '+scheme:path/to/file', '', '', ''), | ||
('', '', '+scheme:path/to/file', '', '')), | ||
diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py | ||
index 8f724f907d4..148caf742c9 100644 | ||
--- a/Lib/urllib/parse.py | ||
+++ b/Lib/urllib/parse.py | ||
@@ -59,7 +59,7 @@ | ||
'imap', 'wais', 'file', 'mms', 'https', 'shttp', | ||
'snews', 'prospero', 'rtsp', 'rtsps', 'rtspu', 'rsync', | ||
'svn', 'svn+ssh', 'sftp', 'nfs', 'git', 'git+ssh', | ||
- 'ws', 'wss', 'itms-services'] | ||
+ 'ws', 'wss'] | ||
|
||
uses_params = ['', 'ftp', 'hdl', 'prospero', 'http', 'imap', | ||
'https', 'shttp', 'rtsp', 'rtsps', 'rtspu', 'sip', |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -179,6 +179,9 @@ EXPORTSFROM= @EXPORTSFROM@ | |
EXE= @EXEEXT@ | ||
BUILDEXE= @BUILDEXEEXT@ | ||
|
||
# Name of the patch file to apply for app store compliance | ||
APP_STORE_COMPLIANCE_PATCH=@APP_STORE_COMPLIANCE_PATCH@ | ||
|
||
# Short name and location for Mac OS X Python framework | ||
UNIVERSALSDK=@UNIVERSALSDK@ | ||
PYTHONFRAMEWORK= @PYTHONFRAMEWORK@ | ||
|
@@ -692,7 +695,7 @@ list-targets: | |
@grep -E '^[A-Za-z][-A-Za-z0-9]+:' Makefile | awk -F : '{print $$1}' | ||
|
||
.PHONY: build_all | ||
build_all: check-clean-src $(BUILDPYTHON) platform sharedmods \ | ||
build_all: check-clean-src check-app-store-compliance $(BUILDPYTHON) platform sharedmods \ | ||
gdbhooks Programs/_testembed scripts checksharedmods rundsymutil | ||
|
||
.PHONY: build_wasm | ||
|
@@ -715,6 +718,16 @@ check-clean-src: | |
exit 1; \ | ||
fi | ||
|
||
# Check that the app store compliance patch can be applied (if configured). | ||
# This is checked as a dry-run against the original library sources; | ||
# the patch will be actually applied during the install phase. | ||
.PHONY: check-app-store-compliance | ||
check-app-store-compliance: | ||
@if [ "$(APP_STORE_COMPLIANCE_PATCH)" != "" ]; then \ | ||
patch --dry-run --quiet --force --strip 1 --directory "$(abs_srcdir)" --input "$(abs_srcdir)/$(APP_STORE_COMPLIANCE_PATCH)"; \ | ||
echo "App store compliance patch can be applied."; \ | ||
fi | ||
|
||
# Profile generation build must start from a clean tree. | ||
profile-clean-stamp: | ||
$(MAKE) clean | ||
|
@@ -2570,6 +2583,14 @@ libinstall: all $(srcdir)/Modules/xxmodule.c | |
$(INSTALL_DATA) `cat pybuilddir.txt`/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py \ | ||
$(DESTDIR)$(LIBDEST); \ | ||
$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt | ||
@ # If app store compliance has been configured, apply the patch to the | ||
@ # installed library code. The patch has been previously validated against | ||
@ # the original source tree, so we can ignore any errors that are raised | ||
@ # due to files that are missing because of --disable-test-modules etc. | ||
@if [ "$(APP_STORE_COMPLIANCE_PATCH)" != "" ]; then \ | ||
echo "Applying app store compliance patch"; \ | ||
patch --force --reject-file "$(abs_builddir)/app-store-compliance.rej" --strip 2 --directory "$(DESTDIR)$(LIBDEST)" --input "$(abs_srcdir)/$(APP_STORE_COMPLIANCE_PATCH)" || true ; \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some explanation of the choices here:
The
|
||
fi | ||
@ # Build PYC files for the 3 optimization levels (0, 1, 2) | ||
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | ||
$(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Added a :option:`--with-app-store-compliance` option to patch out known | ||
issues with macOS/iOS App Store review processes. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some explanation of the choices here:
--dry-run
means no changes are applied--quiet
means no "patching xyz.py" messages are output--force
means no questions are asked of the user, and the patch is assumed to be forward.