From b69f8b6d87d5456e044367efa18a1a754c6a77d7 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 27 Jul 2026 18:32:42 -0700 Subject: [PATCH 1/5] Add a libpython3.dylib to support ABI3 applications Note that this is not for extensions like numpy. It is for executbales like lldb. --- recipe/install_shared.sh | 11 +++++++++++ recipe/meta.yaml | 5 ++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/recipe/install_shared.sh b/recipe/install_shared.sh index 35812a5d1..eb211c4c7 100644 --- a/recipe/install_shared.sh +++ b/recipe/install_shared.sh @@ -31,3 +31,14 @@ fi if [[ ${PY_INTERP_DEBUG} == yes ]]; then ln -s ${PREFIX}/lib/libpython${VERABI}${SHLIB_EXT} ${PREFIX}/lib/libpython${VERABI_NO_DBG}${SHLIB_EXT} fi + +if [[ "$target_platform" == osx-* ]]; then + awk -F',' '$1 == "func" || $1 == "data" { print "_" $2 }' Doc/data/stable_abi.dat > stable_abi_exports.txt + + $CC -dynamiclib \ + -install_name @rpath/libpython3.dylib \ + -compatibility_version 3.0 -current_version ${PY_VER}.0 \ + -Wl,-reexport_library,${PREFIX}/lib/libpython${VERABI}.dylib \ + -Wl,-exported_symbols_list,stable_abi_exports.txt \ + -o ${PREFIX}/lib/libpython3.dylib +fi diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 5d73820b5..917bf69e7 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -355,9 +355,8 @@ outputs: {% if py_interp_debug == "yes" %} - VERABI=${VERABI}d # [not win] {% endif %} - - test -f ${PREFIX}/lib/libpython${VERABI}.so # [linux] - - test -f ${PREFIX}/lib/libpython3.so # [linux and build_type == "release"] - - test -f ${PREFIX}/lib/libpython${VERABI}.dylib # [osx] + - test -f ${PREFIX}/lib/libpython${VERABI}${SHLIB_EXT} # [unix] + - test -f ${PREFIX}/lib/libpython3${SHLIB_EXT} # [unix] {% if freethreading == "yes" %} - if not exist %PREFIX%\python3t.dll exit 1 # [win] - if not exist %PREFIX%\python{{ ver2nd }}t.dll exit 1 # [win] From 89d418b83bafad4fd9c8c509e86d79fa6a84e81d Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 27 Aug 2026 08:15:44 -0700 Subject: [PATCH 2/5] Update recipe/install_shared.sh Co-authored-by: h-vetinari --- recipe/install_shared.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipe/install_shared.sh b/recipe/install_shared.sh index eb211c4c7..b04c6fe81 100644 --- a/recipe/install_shared.sh +++ b/recipe/install_shared.sh @@ -32,7 +32,8 @@ if [[ ${PY_INTERP_DEBUG} == yes ]]; then ln -s ${PREFIX}/lib/libpython${VERABI}${SHLIB_EXT} ${PREFIX}/lib/libpython${VERABI_NO_DBG}${SHLIB_EXT} fi -if [[ "$target_platform" == osx-* ]]; then +# create libpython3.dylib; linux builds only add this in release mode, do the same on osx +if [[ "$target_platform" == osx-* && ${PY_INTERP_DEBUG} == no ]]; then awk -F',' '$1 == "func" || $1 == "data" { print "_" $2 }' Doc/data/stable_abi.dat > stable_abi_exports.txt $CC -dynamiclib \ From c0cbc8a8e08a01237196d069538e08caa15bff46 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 27 Aug 2026 08:16:22 -0700 Subject: [PATCH 3/5] Update python3 library check for release build type --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 917bf69e7..d41bcf39e 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -356,7 +356,7 @@ outputs: - VERABI=${VERABI}d # [not win] {% endif %} - test -f ${PREFIX}/lib/libpython${VERABI}${SHLIB_EXT} # [unix] - - test -f ${PREFIX}/lib/libpython3${SHLIB_EXT} # [unix] + - test -f ${PREFIX}/lib/libpython3${SHLIB_EXT} # [unix and build_type == "release"] {% if freethreading == "yes" %} - if not exist %PREFIX%\python3t.dll exit 1 # [win] - if not exist %PREFIX%\python{{ ver2nd }}t.dll exit 1 # [win] From 987d1dbda07c2baaf17a1b2cde96d9d9045d9151 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Mon, 31 Aug 2026 08:52:44 +1100 Subject: [PATCH 4/5] filter out windows-specific symbols from stable_abi.dat --- recipe/install_shared.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/recipe/install_shared.sh b/recipe/install_shared.sh index b04c6fe81..5dafbd13f 100644 --- a/recipe/install_shared.sh +++ b/recipe/install_shared.sh @@ -34,7 +34,15 @@ fi # create libpython3.dylib; linux builds only add this in release mode, do the same on osx if [[ "$target_platform" == osx-* && ${PY_INTERP_DEBUG} == no ]]; then - awk -F',' '$1 == "func" || $1 == "data" { print "_" $2 }' Doc/data/stable_abi.dat > stable_abi_exports.txt + # need to filter out windows-specific symbols & PyOS_CheckStack from + # https://github.com/python/cpython/blob/main/Doc/data/stable_abi.dat + awk -F',' ' + ($1 == "func" || $1 == "data") && + $4 != "on Windows" && + $2 != "PyOS_CheckStack" { + print "_" $2 + } + ' Doc/data/stable_abi.dat > stable_abi_exports.txt $CC -dynamiclib \ -install_name @rpath/libpython3.dylib \ From 9216259d521d719eeb3dc0a5ef31844536eaa650 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Mon, 31 Aug 2026 08:53:15 +1100 Subject: [PATCH 5/5] bump build number --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index d41bcf39e..891b5e104 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -4,7 +4,7 @@ {% set ver2 = '.'.join(version.split('.')[0:2]) %} {% set ver2nd = ''.join(version.split('.')[0:2]) %} {% set ver3nd = ''.join(version.split('.')[0:3]) %} -{% set build_number = 2 %} +{% set build_number = 3 %} # this makes the linter happy {% set channel_targets = channel_targets or 'conda-forge main' %}