-
-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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: Add a --with-app-store-compliance configure option to patch out problematic code
#120984
base: main
Are you sure you want to change the base?
Conversation
|
I've flagged this for backport to 3.13, and documented the option as being added in 3.13. The issue also exists in (and was originally reported against) 3.12; I'm not sure what the policy is regarding a backport of a new (strictly optional) configuration option. |
|
!buildbot iOS |
|
🤖 New build scheduled with the buildbot fleet by @freakboy3742 for commit eee0c93 🤖 The command will test the builders whose names match following regular expression: The builders matched are:
|
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
|
Did this get fixed already? https://buildbot.python.org/all/#/builders/1382/builds/32 patch -p1 --dry-run < ../../Mac/Resources/app-store-compliance.patch
File to patch:
No file found--skip this patch? [y]
/bin/sh: line 1: 33119 Segmentation fault: 11 patch -p1 --dry-run < ../../Mac/Resources/app-store-compliance.patch
make: *** [app-store-compliance] Error 139 |
No - the patch command isn't quite right for out-of-tree builds. I need to make a small tweak. |
|
!buildbot iOS |
|
🤖 New build scheduled with the buildbot fleet by @freakboy3742 for commit 2d5a0a7 🤖 The command will test the builders whose names match following regular expression: The builders matched are:
|
|
Hrm... that still isn't quite right. I'll need to take another look in the morning. |
|
!buildbot iOS |
|
🤖 New build scheduled with the buildbot fleet by @freakboy3742 for commit eb48987 🤖 The command will test the builders whose names match following regular expression: The builders matched are:
|
|
Worked out the problem(s). The code will now only allow one compliance patch to be applied, and gets the @python/macos-team This should now be ready for review; apologies for the noise. |
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.
Couple of docs suggestions inline (this is a CPython implementation feature rather than a general Python language feature), but otherwise LGTM.
Doc/library/urllib.parse.rst
Outdated
| ``news``, ``nntp``, ``prospero``, ``rsync``, ``rtsp``, ``rtsps``, ``rtspu``, | ||
| ``sftp``, ``shttp``, ``sip``, ``sips``, ``snews``, ``svn``, ``svn+ssh``, | ||
| ``telnet``, ``wais``, ``ws``, ``wss``. | ||
|
|
||
| .. note:: |
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.
Should this be impl-detail and "...CPython has been built.." rather than a regular note?
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.
Didn't know that option existed. Definitely seems appropriate here.
|
A 3.12 backport would be a release manager call (so a question for @Yhg1s). |
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
| passing Apple's App Store review process for the macOS and iOS App Stores. | ||
| Handling for the ``itms-services`` scheme is always removed on iOS; on | ||
| macOS, it *may* be removed if CPython has been built with the | ||
| ``--with-app-store-compliance`` option. |
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.
Consider adding a link:
| ``--with-app-store-compliance`` option. | |
| :option:`--with-app-store-compliance` option. |
| :source:`a patch file <Mac/Resources/app-store-compliance.patch>` that will remove | ||
| all code that is known to cause issues with the App Store review process. This | ||
| patch is applied automatically when CPython is configured with the | ||
| ``--with-app-store-compliance`` option. |
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.
| ``--with-app-store-compliance`` option. | |
| :option:`--with-app-store-compliance` option. |
| @@ -0,0 +1,2 @@ | |||
| Added a ``--with-app-store-compliance`` option to patch out known issues | |||
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.
| Added a ``--with-app-store-compliance`` option to patch out known issues | |
| Added a :option:`--with-app-store-compliance` option to patch out known issues |
| AC_ARG_WITH( | ||
| [app_store_compliance], | ||
| [AS_HELP_STRING( | ||
| [--with-app-store-compliance=@<:@=PATCH-FILE@:>@], |
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.
One too many =, I presume?
| [--with-app-store-compliance=@<:@=PATCH-FILE@:>@], | |
| [--with-app-store-compliance=@<:@PATCH-FILE@:>@], |
| APP_STORE_COMPLIANCE_PATCH_TARGET="build/app-store-compliant" | ||
| APP_STORE_COMPLIANCE_PATCH_FLAGS= | ||
| ;; | ||
| *) AC_MSG_ERROR([No default app store compliance patch available for $ac_sys_system]) ;; |
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.
For consistency with the other AC_MSG macros in this PR.
| *) AC_MSG_ERROR([No default app store compliance patch available for $ac_sys_system]) ;; | |
| *) AC_MSG_ERROR([no default app store compliance patch available for $ac_sys_system]) ;; |
| ;; | ||
| *) AC_MSG_ERROR([No default app store compliance patch available for $ac_sys_system]) ;; | ||
| esac | ||
| AC_MSG_RESULT(["applying default app store compliance patch"]) |
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.
| AC_MSG_RESULT(["applying default app store compliance patch"]) | |
| AC_MSG_RESULT([applying default app store compliance patch]) |
| APP_STORE_COMPLIANCE_PATCH="${withval}" | ||
| APP_STORE_COMPLIANCE_PATCH_TARGET="build/app-store-compliant" | ||
| APP_STORE_COMPLIANCE_PATCH_FLAGS= | ||
| AC_MSG_RESULT(["applying custom app store compliance patch"]) |
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.
| AC_MSG_RESULT(["applying custom app store compliance patch"]) | |
| AC_MSG_RESULT([applying custom app store compliance patch]) |
| APP_STORE_COMPLIANCE_PATCH="Mac/Resources/app-store-compliance.patch" | ||
| APP_STORE_COMPLIANCE_PATCH_TARGET="build/app-store-compliant" | ||
| APP_STORE_COMPLIANCE_PATCH_FLAGS= | ||
| AC_MSG_RESULT(["applying default app store compliance patch"]) |
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.
| AC_MSG_RESULT(["applying default app store compliance patch"]) | |
| AC_MSG_RESULT([applying default app store compliance patch]) |
| APP_STORE_COMPLIANCE_PATCH="Mac/Resources/app-store-compliance.patch" | ||
| APP_STORE_COMPLIANCE_PATCH_TARGET="build/app-store-compliant" | ||
| APP_STORE_COMPLIANCE_PATCH_FLAGS="--dry-run" | ||
| AC_MSG_RESULT(["checking (not applying) default app store compliance patch"]) |
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.
| AC_MSG_RESULT(["checking (not applying) default app store compliance patch"]) | |
| AC_MSG_RESULT([checking (not applying) default app store compliance patch]) |
| APP_STORE_COMPLIANCE_PATCH= | ||
| APP_STORE_COMPLIANCE_PATCH_TARGET= | ||
| APP_STORE_COMPLIANCE_PATCH_FLAGS= | ||
| AC_MSG_RESULT(["not patching for app store compliance"]) |
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.
| AC_MSG_RESULT(["not patching for app store compliance"]) | |
| AC_MSG_RESULT([not patching for app store compliance]) |


Apple’s macOS App Store is auto-rejects any app that has the string
itms-servicesin it. This is the custom URL prefix used for requesting an app installation from the iTunes App Store; however, sandboxed apps are prohibited from using these URLs. Apple’s automagical review processes are catching on the code in urllib’s parser’s handling of these URLs - even if the app in question never uses anitms-services://URL. It’s present in the standard library; therefore the app is rejected.Following a discussion on discuss.python.org, this PR adds a
--with-app-store-complianceoption to configure that will patch out any code that is known to be an issue with app store compliance.There is currently a single patch, in the Mac resources directory, patching the known occurrences of
itms-services. This patch is optionally applied on macOS if the configure flag is enabled, but the patch is applied in as "dry run" if the flag is not enabled. This ensures that a standard macOS CI pass will identify any drift in the patch.The same patch is also used by iOS builds, as the review issues are the same. On iOS, the patch is always applied, because all apps will need to pass App Store compliance.
The option allows for a custom patch file to be provided (in case App Store rules change after support for a Python release has ceased. This also a platform other than iOS or macOS to apply a "compliance" patch by manually supplying one; although there's no known use case for this at present.
Fixes #120522.
📚 Documentation preview 📚: https://cpython-previews--120984.org.readthedocs.build/