patch 9.1.0669: if_python: stable python ABI not used by default Commit: https://github.com/vim/vim/commit/1c032e36a689932e58a2b3f0b0c890c773ca00d8 Author: Ken Takata <ken...@csc.jp> Date: Sun Aug 11 18:41:41 2024 +0200
patch 9.1.0669: if_python: stable python ABI not used by default Problem: stable python ABI not used by default Solution: Enable stable python ABI v3.8 when building with python3/dyn by default, update the default Python3 version to 3.8 for MS-Windows (Ken Takata) closes: #15470 related: #15457 Signed-off-by: Ken Takata <ken...@csc.jp> Signed-off-by: Christian Brabandt <c...@256bit.org> diff --git a/src/Make_cyg_ming.mak b/src/Make_cyg_ming.mak index d3b04e813..8aeba67cd 100644 --- a/src/Make_cyg_ming.mak +++ b/src/Make_cyg_ming.mak @@ -391,14 +391,19 @@ endif # Python3 interface: # PYTHON3=[Path to Python3 directory] (Set inside Make_cyg.mak or Make_ming.mak) # DYNAMIC_PYTHON3=yes (to load the Python3 DLL dynamically) -# PYTHON3_VER=[Python3 version, eg 31, 32] (default is 36) +# PYTHON3_VER=[Python3 version, eg 31, 32] (default is 38) ifdef PYTHON3 ifndef DYNAMIC_PYTHON3 DYNAMIC_PYTHON3=yes endif + ifndef DYNAMIC_PYTHON3_STABLE_ABI + ifeq (yes,$(DYNAMIC_PYTHON3)) +DYNAMIC_PYTHON3_STABLE_ABI=yes + endif + endif ifndef PYTHON3_VER -PYTHON3_VER=36 +PYTHON3_VER=38 endif ifeq ($(DYNAMIC_PYTHON3_STABLE_ABI),yes) PYTHON3_NAME=python3 diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak index 296d49e8d..49d8a3373 100644 --- a/src/Make_mvc.mak +++ b/src/Make_mvc.mak @@ -80,7 +80,7 @@ # Python3 interface: # PYTHON3=[Path to Python3 directory] # DYNAMIC_PYTHON3=yes (to load the Python3 DLL dynamically) -# PYTHON3_VER=[Python3 version, eg 30, 31] (default is 36) +# PYTHON3_VER=[Python3 version, eg 30, 31] (default is 38) # # Ruby interface: # RUBY=[Path to Ruby directory] @@ -994,8 +994,13 @@ PYTHON_LIB = "$(PYTHON)\libs\python$(PYTHON_VER).lib" # PYTHON3 interface !ifdef PYTHON3 +! ifndef DYNAMIC_PYTHON3_STABLE_ABI +! if "$(DYNAMIC_PYTHON3)" == "yes" +DYNAMIC_PYTHON3_STABLE_ABI = yes +! endif +! endif ! ifndef PYTHON3_VER -PYTHON3_VER = 36 +PYTHON3_VER = 38 ! endif ! if "$(DYNAMIC_PYTHON3_STABLE_ABI)" == "yes" PYTHON3_NAME = python3 diff --git a/src/auto/configure b/src/auto/configure index 26ac45826..f094827bb 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -1575,7 +1575,7 @@ Optional Packages: --with-python-command=NAME name of the Python 2 command (default: python2 or python) --with-python-config-dir=PATH Python's config directory (deprecated) --with-python3-command=NAME name of the Python 3 command (default: python3 or python) - --with-python3-stable-abi=VERSION stable ABI version to target (e.g. 3.8) + --with-python3-stable-abi=VERSION stable ABI version to target (default: 3.8) --with-python3-config-dir=PATH Python's config directory (deprecated) --with-tclsh=PATH which tclsh to use (default: tclsh8.0) --with-ruby-command=RUBY name of the Ruby command (default: ruby) @@ -7083,21 +7083,30 @@ printf %s "checking Python is 3.0 or better... " >&6; } { printf "%s " "$as_me:${as_lineno-$LINENO}: result: yep" >&5 printf "%s " "yep" >&6; } - { printf "%s " "$as_me:${as_lineno-$LINENO}: checking --with-python3-stable-abi argument" >&5 + python3_stable_abi_default=3.8 + { printf "%s " "$as_me:${as_lineno-$LINENO}: checking --with-python3-stable-abi argument" >&5 printf %s "checking --with-python3-stable-abi argument... " >&6; } # Check whether --with-python3-stable-abi was given. if test ${with_python3_stable_abi+y} then : - withval=$with_python3_stable_abi; vi_cv_var_python3_stable_abi="$withval"; { printf "%s " "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python3_stable_abi" >&5 + withval=$with_python3_stable_abi; + if test "X$withval" = "Xyes"; then + vi_cv_var_python3_stable_abi=$python3_stable_abi_default + else + vi_cv_var_python3_stable_abi="$withval" + fi + { printf "%s " "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python3_stable_abi" >&5 printf "%s " "$vi_cv_var_python3_stable_abi" >&6; } else $as_nop - { printf "%s " "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s " "no" >&6; } + + vi_cv_var_python3_stable_abi=$python3_stable_abi_default + { printf "%s " "$as_me:${as_lineno-$LINENO}: result: no. defaults to $python3_stable_abi_default." >&5 +printf "%s " "no. defaults to $python3_stable_abi_default." >&6; } fi - if test "X$vi_cv_var_python3_stable_abi" != "X"; then + if test "X$vi_cv_var_python3_stable_abi" != "Xno"; then if test ${vi_cv_var_python3_stable_abi_hex+y} then : printf %s "(cached) " >&6 diff --git a/src/configure.ac b/src/configure.ac index 29cd926b5..43832dcc6 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -1539,12 +1539,21 @@ if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic"; AC_MSG_RESULT(yep) dnl -- get the stable ABI version if passed in + python3_stable_abi_default=3.8 AC_MSG_CHECKING(--with-python3-stable-abi argument) AC_SUBST(vi_cv_var_python3_stable_abi) - AC_ARG_WITH(python3-stable-abi, [ --with-python3-stable-abi=VERSION stable ABI version to target (e.g. 3.8)], - vi_cv_var_python3_stable_abi="$withval"; AC_MSG_RESULT($vi_cv_var_python3_stable_abi), - AC_MSG_RESULT(no)) - if test "X$vi_cv_var_python3_stable_abi" != "X"; then + AC_ARG_WITH(python3-stable-abi, [ --with-python3-stable-abi=VERSION stable ABI version to target (default: 3.8)], + [ + if test "X$withval" = "Xyes"; then + vi_cv_var_python3_stable_abi=$python3_stable_abi_default + else + vi_cv_var_python3_stable_abi="$withval" + fi + AC_MSG_RESULT($vi_cv_var_python3_stable_abi)], + [ + vi_cv_var_python3_stable_abi=$python3_stable_abi_default + AC_MSG_RESULT(no. defaults to $python3_stable_abi_default.)]) + if test "X$vi_cv_var_python3_stable_abi" != "Xno"; then AC_CACHE_VAL(vi_cv_var_python3_stable_abi_hex, [ vi_cv_var_python3_stable_abi_hex=` diff --git a/src/version.c b/src/version.c index 965a20dc8..c58e82eae 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 669, /**/ 668, /**/ -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/E1sdBvJ-00CPjs-Dg%40256bit.org.