Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Make --disable-multibyte warn, since the test suite fails in that configuration. (was: Re: Test failures in --disable-multibyte)



Peter Stephenson wrote on Sun, Jan 05, 2020 at 18:20:30 +0000:
> On Fri, 2020-01-03 at 20:11 +0000, Daniel Shahaf wrote:
> > Here's a draft.  Probably needs wordsmithing.
> 
> Sorry to be slow --- Definitely in the target area; I'm wondering about

No worries; I wasn't going to commit this until after the weekend anyway.

> > +    # Some requisite functions are missing.
> > +    AC_MSG_WARN([Multibyte support disabled due to missing functions: $zfuncs_absent])
> > +    AC_MSG_WARN([Building without multibyte support is strongly discouraged and may cause errors in 'make test'.])
> 
> where the user doesn't have a lot of choice about what they're building,
> so discouraging it is a bit pointless.  I'd be tempted to omit that bit
> here.

Fair point.  How about:

diff --git a/configure.ac b/configure.ac
index 256584538..cd42a789e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2553,6 +2553,7 @@ wmemcpy wmemmove wmemset; do
       AC_MSG_NOTICE([all functions found, multibyte support enabled])
       zsh_cv_c_unicode_support=yes
     else
+      # Warns at the end of configure
       AC_MSG_NOTICE([missing functions, multibyte support disabled])
       zsh_cv_c_unicode_support=no
     fi
@@ -3299,4 +3300,18 @@ fi
 echo "See config.modules for installed modules and functions.
 "
 
+if test x$zsh_cv_c_unicode_support != xyes; then
+  if test "x$zfuncs_absent" = x; then
+    # The user opted out.
+    AC_MSG_WARN([You have chosen to build without multibyte support.])
+    AC_MSG_WARN([This configuration may not be suitable for production use. It is known to cause errors in 'make test'. We strongly recommend to re-run configure with --enable-multibyte.])
+  else
+    # Some requisite functions are missing.
+    AC_MSG_WARN([Multibyte support cannot be enabled: some standard library functions are missing: $zfuncs_absent])
+    AC_MSG_WARN([This configuration may not be suitable for production use. It is known to cause errors in 'make test'. If your system provides those functions, we recommend to re-run configure appropriately.])
+    # If your system doesn't have those functions, consider patching the
+    # test suite and sending the patch to zsh-workers@ for inclusion.
+  fi
+fi
+
 exit 0

(The "if" branch is unchanged.)

Cheers,

Daniel



Messages sorted by: Reverse Date, Date, Thread, Author