diff --git a/abs.yaml b/abs.yaml index 2bbcb91cb..420fde0b0 100644 --- a/abs.yaml +++ b/abs.yaml @@ -3,4 +3,11 @@ build_parameters: - "--suppress-variables" #- "--skip-existing" - "--error-overlinking" - - "--error-overdepending" \ No newline at end of file + - "--error-overdepending" + +aggregate_check: false + +channels: + - norl + +upload_without_merge: true diff --git a/recipe/build_base.sh b/recipe/build_base.sh index 156bf2a1b..63ac29199 100644 --- a/recipe/build_base.sh +++ b/recipe/build_base.sh @@ -248,11 +248,13 @@ _common_configure_args+=(--with-tcltk-includes="-I${PREFIX}/include") _common_configure_args+=("--with-tcltk-libs=-L${PREFIX}/lib -ltcl8.6 -ltk8.6") _common_configure_args+=(--with-platlibdir=lib) -if [ "$READLINE_MODE" = editline ]; then +if [[ "${READLINE_MODE}" = readline ]]; then + _common_configure_args+=(--with-readline=readline) +elif [[ "${READLINE_MODE}" = editline ]]; then _common_configure_args+=(--with-readline=editline) -elif [ "$READLINE_MODE" = none ]; then +elif [[ "${READLINE_MODE}" = none ]]; then _common_configure_args+=(--without-readline) -fi +fi # Add more optimization flags for the static Python interpreter: declare -a PROFILE_TASK=() @@ -459,7 +461,7 @@ pushd "${PREFIX}"/lib/python${VER} # Remove osx sysroot as it depends on the build machine sed -i.bak "s@-isysroot @@g" sysconfigfile # make sure $CONDA_BUILD_SYSROOT is not empty ... - if [[ ${HOST} =~ .*darwin.* ]] && [[ -n ${CONDA_BUILD_SYSROOT} ]]; then + if [[ ${HOST} =~ .*darwin.* ]] && [[ -n ${CONDA_BUILD_SYSROOT} ]]; then sed -i.bak "s@$CONDA_BUILD_SYSROOT @@g" sysconfigfile fi # Remove unfilled config option diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 4ce383390..cb564ed68 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 = "0" %} +{% set build_number = 2 %} {% set channel_targets = ('abc', 'def') %} # this is just for the initial build, to break dependencies with python -> pip -> libpython-static {% set bootstrap = "false" %} @@ -39,6 +39,10 @@ {% set py_interp_debug = "no" %} {% endif %} +{% set rl_string = "" %} # [win or readline_mode == 'readline'] +{% set rl_string = "el_" %} # [not win and readline_mode == 'editline'] +{% set rl_string = "norl_" %} # [not win and readline_mode == 'none'] + package: name: python-split version: {{ version }}{{ dev }} @@ -79,9 +83,11 @@ source: - patches/0018-Unvendor-expat.patch - patches/0019-Remove-unused-readelf.patch - patches/0021-Override-configure-LIBFFI.patch + - patches/0022-Fix-build-with-newer-editline.patch build: - number: {{ build_number }} + number: {{ build_number + 100 }} # [win or readline_mode == 'readline'] + number: {{ build_number }} # [not(win or readline_mode == 'readline')] requirements: build: @@ -98,7 +104,9 @@ outputs: script: build_base.sh # [unix] script: build_base.bat # [win] build: - number: {{ build_number }} + number: {{ build_number + 200 }} # [win or readline_mode == 'readline'] + number: {{ build_number + 100 }} # [not win and readline_mode == 'editline'] + number: {{ build_number }} # [not win and readline_mode == 'none'] activate_in_script: true # Windows has issues updating python if conda is using files itself. # Copy rather than link. @@ -124,8 +132,8 @@ outputs: skip_compile_pyc: - '*.py' # [build_platform != target_platform] {% endif %} - string: {{ dev_ }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}_cpython # ["conda-forge" in (channel_targets or "")] - string: h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }} # ["conda-forge" not in (channel_targets or "")] + string: {{ dev_ }}h{{ PKG_HASH }}_{{ rl_string }}{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}_cpython # ["conda-forge" in (channel_targets or "")] + string: h{{ PKG_HASH }}_{{ rl_string }}{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }} # ["conda-forge" not in (channel_targets or "")] {% if 'conda-forge' in channel_targets %} run_exports: noarch: @@ -280,15 +288,17 @@ outputs: script: build_static.sh # [unix] script: build_static.bat # [win] build: - number: {{ build_number }} + number: {{ build_number + 100 }} # [win or readline_mode == 'readline'] + number: {{ build_number }} # [not(win or readline_mode == 'readline')] activate_in_script: true {% if 'conda-forge' in channel_targets %} ignore_run_exports: - python_abi - string: h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}_cpython + string: h{{ PKG_HASH }}_{{ rl_string }}{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}_cpython {% else %} - string: h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }} + string: h{{ PKG_HASH }}_{{ rl_string }}{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }} {% endif %} + skip: true # [win and readline_mode != 'none'] requirements: build: - {{ compiler('c') }} diff --git a/recipe/patches/0022-Fix-build-with-newer-editline.patch b/recipe/patches/0022-Fix-build-with-newer-editline.patch new file mode 100644 index 000000000..52ab5388a --- /dev/null +++ b/recipe/patches/0022-Fix-build-with-newer-editline.patch @@ -0,0 +1,102 @@ +From 53122bcf825681487226c041d47763e82e081530 Mon Sep 17 00:00:00 2001 +From: "Miss Islington (bot)" + <31488909+miss-islington@users.noreply.github.com> +Date: Mon, 9 Oct 2023 16:01:00 +0200 +Subject: [PATCH] [3.12] gh-109191: Fix build with newer editline (gh-110239) + (gh-110562) + +gh-109191: Fix build with newer editline (gh-110239) +(cherry picked from commit f4cb0d27cc08f490c42a22e646eb73cc7072d54a) + +Co-authored-by: Bo Anderson +--- + ...-10-05-11-46-20.gh-issue-109191.imUkVN.rst | 1 + + Modules/readline.c | 2 +- + configure | 19 +++++++++++++++++++ + configure.ac | 7 +++++++ + pyconfig.h.in | 3 +++ + 5 files changed, 31 insertions(+), 1 deletion(-) + create mode 100644 Misc/NEWS.d/next/Build/2023-10-05-11-46-20.gh-issue-109191.imUkVN.rst + +diff --git a/Misc/NEWS.d/next/Build/2023-10-05-11-46-20.gh-issue-109191.imUkVN.rst b/Misc/NEWS.d/next/Build/2023-10-05-11-46-20.gh-issue-109191.imUkVN.rst +new file mode 100644 +index 00000000000000..27e5df790bc0c6 +--- /dev/null ++++ b/Misc/NEWS.d/next/Build/2023-10-05-11-46-20.gh-issue-109191.imUkVN.rst +@@ -0,0 +1 @@ ++Fix compile error when building with recent versions of libedit. +diff --git a/Modules/readline.c b/Modules/readline.c +index 2824105a187586..9823ebe71da3a5 100644 +--- a/Modules/readline.c ++++ b/Modules/readline.c +@@ -442,7 +442,7 @@ readline_set_completion_display_matches_hook_impl(PyObject *module, + default completion display. */ + rl_completion_display_matches_hook = + readlinestate_global->completion_display_matches_hook ? +-#if defined(_RL_FUNCTION_TYPEDEF) ++#if defined(HAVE_RL_COMPDISP_FUNC_T) + (rl_compdisp_func_t *)on_completion_display_matches_hook : 0; + #else + (VFunction *)on_completion_display_matches_hook : 0; +diff --git a/configure b/configure +index b6f90bcd8c7300..985b3741349e8e 100755 +--- a/configure ++++ b/configure +@@ -25345,6 +25345,25 @@ printf "%s\n" "#define HAVE_RL_APPEND_HISTORY 1" >>confdefs.h + + fi + ++ # in readline as well as newer editline (April 2023) ++ ac_fn_c_check_type "$LINENO" "rl_compdisp_func_t" "ac_cv_type_rl_compdisp_func_t" " ++ #include /* Must be first for Gnu Readline */ ++ #ifdef WITH_EDITLINE ++ # include ++ #else ++ # include ++ # include ++ #endif ++ ++" ++if test "x$ac_cv_type_rl_compdisp_func_t" = xyes ++then : ++ ++printf "%s\n" "#define HAVE_RL_COMPDISP_FUNC_T 1" >>confdefs.h ++ ++fi ++ ++ + + + CFLAGS=$save_CFLAGS +diff --git a/configure.ac b/configure.ac +index ba768aea930714..2a7a91882640fd 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -6213,6 +6213,13 @@ AS_VAR_IF([with_readline], [no], [ + AC_DEFINE([HAVE_RL_APPEND_HISTORY], [1], [Define if readline supports append_history]) + ]) + ++ # in readline as well as newer editline (April 2023) ++ AC_CHECK_TYPE([rl_compdisp_func_t], ++ [AC_DEFINE([HAVE_RL_COMPDISP_FUNC_T], [1], ++ [Define if readline supports rl_compdisp_func_t])], ++ [], ++ [readline_includes]) ++ + m4_undefine([readline_includes]) + ])dnl WITH_SAVE_ENV() + ]) +diff --git a/pyconfig.h.in b/pyconfig.h.in +index ada9dccfef1084..9f858b2d3541d0 100644 +--- a/pyconfig.h.in ++++ b/pyconfig.h.in +@@ -989,6 +989,9 @@ + /* Define if you can turn off readline's signal handling. */ + #undef HAVE_RL_CATCH_SIGNAL + ++/* Define if readline supports rl_compdisp_func_t */ ++#undef HAVE_RL_COMPDISP_FUNC_T ++ + /* Define if you have readline 2.2 */ + #undef HAVE_RL_COMPLETION_APPEND_CHARACTER + diff --git a/recipe/run_test.py b/recipe/run_test.py index b3140a17f..4925ca730 100644 --- a/recipe/run_test.py +++ b/recipe/run_test.py @@ -82,11 +82,12 @@ import fcntl import grp import nis - import readline import resource import syslog import termios +if os.environ["READLINE_MODE"] != 'none': + import readline if not (armv6l or armv7l or ppc64le or osx105 or arm64): import tkinter