8000 gh-120522: Add a `--with-app-store-compliance` configure option to patch out problematic code by freakboy3742 · Pull Request #120984 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-120522: Add a --with-app-store-compliance configure option to patch out problematic code #120984

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

Merged
merged 14 commits into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Make patching reslient to multiple builds.
  • Loading branch information
freakboy3742 committed Jun 25, 2024
commit 12cb4693bb1dbe104cba439e279418971afd367b
16 changes: 12 additions & 4 deletions Makefile.pre.in
8000
Original file line number Diff line number Diff line change
Expand Up @@ -932,10 +932,18 @@ $(BUILDPYTHON)-gdb.py: $(SRC_GDB_HOOKS)

# Compliance with app stores (such as iOS and macOS) sometimes requires making
# modifications to the Python standard library. If enabled, apply the patch of
# known modifications to the source tree before building.
.PHONY: app-store-compliance
app-store-compliance:
patch @APP_STORE_COMPLIANCE_PATCH_FLAGS@ --forward --strip=1 --directory="$(srcdir)" --input "$(APP_STORE_COMPLIANCE_PATCH)"
# known modifications to the source tree before building. The patch will be
# applied in a dry-run mode (validating, but not applying the patch) on builds
# that *have* a compliance patch, but where compliance has not been enabled.
build/app-store-compliant:
patch @APP_STORE_COMPLIANCE_PATCH_FLAGS@ --forward --strip=1 --directory="$(srcdir)" --input "$(APP_STORE_COMPLIANCE_PATCH)" ; \
if test "@APP_STORE_COMPLIANCE_PATCH_FLAGS@" == ""; then \
echo "Source tree has been patched for app store compliance."; \
mkdir -p build ; \
echo "$(APP_STORE_COMPLIANCE_PATCH)" > build/app-store-compliant ; \
else \
echo "App store compliance patch has been verified, but not applied."; \
fi

# This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
# minimal framework (not including the Lib directory and such) in the current
Expand Down
8 changes: 4 additions & 4 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ AC_ARG_WITH(
Darwin|iOS)
# iOS is able to share the macOS patch
APP_STORE_COMPLIANCE_PATCH="Mac/Resources/app-store-compliance.patch"
APP_STORE_COMPLIANCE_PATCH_TARGET="app-store-compliance"
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]) ;;
Expand All @@ -719,7 +719,7 @@ AC_ARG_WITH(
;;
*)
APP_STORE_COMPLIANCE_PATCH="${withval}"
APP_STORE_COMPLIANCE_PATCH_TARGET="app-store-compliance"
APP_STORE_COMPLIANCE_PATCH_TARGET="build/app-store-compliant"
APP_STORE_COMPLIANCE_PATCH_FLAGS=
AC_MSG_RESULT(["applying custom app store compliance patch"])
;;
Expand All @@ -729,14 +729,14 @@ AC_ARG_WITH(
iOS)
# Always apply the compliance patch on iOS; we can use the macOS patch
APP_STORE_COMPLIANCE_PATCH="Mac/Resources/app-store-compliance.patch"
APP_STORE_COMPLIANCE_PATCH_TARGET="app-store-compliance"
APP_STORE_COMPLIANCE_PATCH_TARGET="build/app-store-compliant"
APP_STORE_COMPLIANCE_PATCH_FLAGS=
AC_MSG_RESULT(["applying default app store compliance patch"])
;;
Darwin)
# Always *check* the compliance patch on macOS
APP_STORE_COMPLIANCE_PATCH="Mac/Resources/app-store-compliance.patch"
APP_STORE_COMPLIANCE_PATCH_TARGET="app-store-compliance"
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"])
;;
Expand Down
0