aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2021-02-05 01:05:06 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-02-05 01:05:06 +0000
commit371872e3cdade6129f438561382c9ec8f9bece7b (patch)
treee84f3e13d2132d030ea76e04ef4d66b12fd8187c
parent006ab30ee9a85fbdb809039c84f75d7a0079320a (diff)
parentb4be0a27f8ba1df8945a374c24cf4e322f7f4cd5 (diff)
downloadcpython3-371872e3cdade6129f438561382c9ec8f9bece7b.tar.gz
[kokoro python] Patch python to enable arm64 build for extensions am: b4be0a27f8
Original change: https://android-review.googlesource.com/c/platform/external/python/cpython3/+/1576753 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Idb1cd7cd0685ea945cbef558d9f1ad11aeae2916
-rw-r--r--kokoro/0001-Enable-arm64-builds.patch34
-rwxr-xr-xkokoro/kokoro_build.sh5
2 files changed, 36 insertions, 3 deletions
diff --git a/kokoro/0001-Enable-arm64-builds.patch b/kokoro/0001-Enable-arm64-builds.patch
new file mode 100644
index 0000000000..5d7f81b6c4
--- /dev/null
+++ b/kokoro/0001-Enable-arm64-builds.patch
@@ -0,0 +1,34 @@
+From 422cda3fba39e9a99397fbd8e10ee1f7e85ef241 Mon Sep 17 00:00:00 2001
+From: Haibo Huang <hhb@google.com>
+Date: Thu, 4 Feb 2021 16:29:09 -0800
+Subject: [PATCH] Enable arm64 builds
+
+Kokoro build server has 10.15 and XCode 12.2. It is able to build arm64.
+
+Change-Id: I8dcf6a909b9075c4f9d40516a0ab28f421cdcb8d
+---
+ Lib/_osx_support.py | 8 +-------
+ 1 file changed, 1 insertion(+), 7 deletions(-)
+
+diff --git a/Lib/_osx_support.py b/Lib/_osx_support.py
+index 37975fe..47d88af 100644
+--- a/Lib/_osx_support.py
++++ b/Lib/_osx_support.py
+@@ -187,13 +187,7 @@ def _supports_universal_builds():
+
+ def _supports_arm64_builds():
+ """Returns True if arm64 builds are supported on this system"""
+- # There are two sets of systems supporting macOS/arm64 builds:
+- # 1. macOS 11 and later, unconditionally
+- # 2. macOS 10.15 with Xcode 12.2 or later
+- # For now the second category is ignored.
+- osx_version = _get_system_version_tuple()
+- return osx_version >= (11, 0) if osx_version else False
+-
++ return True
+
+ def _find_appropriate_compiler(_config_vars):
+ """Find appropriate C compiler for extension module builds"""
+--
+2.30.0.365.g02bc693789-goog
+
diff --git a/kokoro/kokoro_build.sh b/kokoro/kokoro_build.sh
index a96f373c4e..6abadc9e09 100755
--- a/kokoro/kokoro_build.sh
+++ b/kokoro/kokoro_build.sh
@@ -7,14 +7,13 @@ DEST="${KOKORO_ARTIFACTS_DIR}/dest"
OUT="${KOKORO_ARTIFACTS_DIR}/out"
PYTHON_SRC=${KOKORO_ARTIFACTS_DIR}/git/cpython3
-env
+BASEDIR=$(dirname "$0")
if [ "$(uname)" == "Darwin" ]; then
# http://g3doc/devtools/kokoro/g3doc/userdocs/macos/selecting_xcode
sudo xcode-select -s /Applications/Xcode_12.2.app/Contents/Developer
export SDKROOT=/Applications/Xcode_12.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
+ (cd "${PYTHON_SRC}"; git apply "${BASEDIR}/0001-Enable-arm64-builds.patch")
fi
-BASEDIR=$(dirname "$0")
-
python3 --version
python3 ${BASEDIR}/build.py "${PYTHON_SRC}" "${OUT}" "${DEST}" "${KOKORO_BUILD_ID}"