From f3521e88be02230dc979a8b0fa82df8e0c007a57 Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Fri, 23 Sep 2022 12:16:39 +0300 Subject: [PATCH 1/3] Allow to build CPython with --with-dsymutil Since 3.12, CPython can provide debug symbols in Apple's nonstandard way, "dSYM bundles" --- plugins/python-build/bin/python-build | 11 +++++ plugins/python-build/test/build.bats | 69 +++++++++++++++++++++++++-- 2 files changed, 75 insertions(+), 5 deletions(-) diff --git a/plugins/python-build/bin/python-build b/plugins/python-build/bin/python-build index 5ae819cb..4531f1dc 100755 --- a/plugins/python-build/bin/python-build +++ b/plugins/python-build/bin/python-build @@ -779,6 +779,7 @@ build_package_standard_build() { else use_homebrew_zlib || true fi + use_dsymutil || true fi ( if [ "${CFLAGS+defined}" ] || [ "${!PACKAGE_CFLAGS+defined}" ]; then @@ -1626,6 +1627,16 @@ use_tcltk() { fi } +# Since 3.12, CPython can add DWARF debug information in MacOS +# using Apple's nonstandard way, `dsymutil', that creates a "dSYM bundle" +# that's supposed to be installed alongside executables +# (https://github.com/python/cpython/issues/95973). +use_dsymutil() { + if [[ -n "$PYTHON_BUILD_CONFIGURE_WITH_DSYMUTIL" ]] && is_mac; then + package_option python configure --with-dsymutil + fi +} + build_package_enable_shared() { package_option python configure --enable-shared } diff --git a/plugins/python-build/test/build.bats b/plugins/python-build/test/build.bats index e770a690..f761c8f1 100644 --- a/plugins/python-build/test/build.bats +++ b/plugins/python-build/test/build.bats @@ -515,26 +515,85 @@ make install DOGE="such wow" OUT } -@test "setting MAKE_INSTALL_OPTS to a multi-word string" { +@test "configuring with dSYM in MacOS" { cached_tarball "Python-3.6.2" - for i in {1..8}; do stub uname '-s : echo Linux'; done + for i in {1..9}; do stub uname '-s : echo Darwin'; done + for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done + for i in {1..4}; do stub brew false; done stub_make_install - export MAKE_INSTALL_OPTS="DOGE=\"such wow\"" run_inline_definition < Date: Fri, 23 Sep 2022 16:15:30 +0300 Subject: [PATCH 2/3] Build 3.12+ with --with-dsymutil --- plugins/python-build/share/python-build/3.12-dev | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/python-build/share/python-build/3.12-dev b/plugins/python-build/share/python-build/3.12-dev index 08396a67..8fa3a02e 100644 --- a/plugins/python-build/share/python-build/3.12-dev +++ b/plugins/python-build/share/python-build/3.12-dev @@ -1,5 +1,6 @@ prefer_openssl11 export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1 +export PYTHON_BUILD_CONFIGURE_WITH_DSYMUTIL=1 install_package "openssl-1.1.1k" "https://www.openssl.org/source/openssl-1.1.1k.tar.gz#892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5" mac_openssl --if has_broken_mac_openssl install_package "readline-8.0" "https://ftpmirror.gnu.org/readline/readline-8.0.tar.gz#e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461" mac_readline --if has_broken_mac_readline install_git "Python-3.12-dev" "https://github.com/python/cpython" main standard verify_py312 copy_python_gdb ensurepip From 2c2619a49e5917e62471e3ba7f7a77e7b4cd36e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 5 Oct 2022 20:52:20 +0300 Subject: [PATCH 3/3] Add Pyston 2.3.5 (#2476) --- .../share/python-build/pyston-2.3.5 | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 plugins/python-build/share/python-build/pyston-2.3.5 diff --git a/plugins/python-build/share/python-build/pyston-2.3.5 b/plugins/python-build/share/python-build/pyston-2.3.5 new file mode 100644 index 00000000..caaac6b5 --- /dev/null +++ b/plugins/python-build/share/python-build/pyston-2.3.5 @@ -0,0 +1,23 @@ +# sha256sum used for checksum values + +# version of pyston +VER='2.3.5' +# alias for download location +DOWNLOAD='https://github.com/pyston/pyston/releases/download' + +case "$(pyston_architecture 2>/dev/null || true)" in +"linux64" ) + install_package "pyston_${VER}_portable_amd64" "${DOWNLOAD}/pyston_${VER}/pyston_${VER}_portable_amd64.tar.gz#c71c711d60a9c18f243a9e30fd35e0818674ae96f534c67c27b0cdfbc9132ef8" "pyston" verify_py38 get_pip + ;; +"linux-aarch64" ) + install_package "pyston_${VER}_portable_arm64" "${DOWNLOAD}/pyston_${VER}/pyston_${VER}_portable_arm64.tar.gz#c578cb806c62d9dca8728f190a87e172305bd80887e206df42c4c5658ab469c1" "pyston" verify_py38 get_pip + ;; +* ) + { echo + colorize 1 "ERROR" + echo ": A Pyston ${VER} binary is not available for $(pyston_architecture 2>/dev/null || true)." + echo + } >&2 + exit 1 + ;; +esac