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

Re: Possible ZSH bug involving piping ls to less (MSYS2 & Cygwin)



> 2021/01/27 19:14, Jun T <takimoto-j@xxxxxxxxxxxxxxxxx> wrote:
> 
> [3] I used strace command to find the following:
> 
> When ls exits, the main zsh gets SIGCHLD and calls wait_for_processes().
> In this function, signals.c, line 543, it calls
>          /* pn->pid is the pid of ls */

Sorry, something went wrong with my MUA. the last two lines should read

In this function, signals.c, line 543, it calls
    killpg(pn->pid, 0)      /* pn->pid = pid_of_ls */


> Is there anyone familiar with Cygwin/MSIS2?


Note for someone who tries to fix this problem on MSYS2:

The current zsh git master does not compile well on MSYS2.
At least you need to use

% ./configure --build=x86_64-pc-cygwin --host=x86_64-pc-cygwin

The resulting zsh has a problem related with symlink (which is not supported
on MSYS2), but it can be used for debugging purpose.

Or you can use the patch below.
This is a part of the patches used in MSYS2's zsh package.


diff --git a/Src/zsh_system.h b/Src/zsh_system.h
index 161b073b4..de1d675c4 100644
--- a/Src/zsh_system.h
+++ b/Src/zsh_system.h
@@ -852,6 +852,13 @@ extern short ospeed;
 # define IS_DIRSEP(c) ((c) == '/')
 #endif
 
+#ifdef __MSYS__
+/* MSYS2 symlink() cannot create a symbolic link to a non existing file */
+# ifdef HAVE_SYMLINK
+#  undef HAVE_SYMLINK
+# endif
+#endif
+
 #if defined(__GNUC__) && (!defined(__APPLE__) || defined(__clang__))
 /* Does the OS X port of gcc still gag on __attribute__? */
 #define UNUSED(x) x __attribute__((__unused__))
diff --git a/configure.ac b/configure.ac
index 16dafac05..7eef49a8d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2706,7 +2706,7 @@ if test "x$aixdynamic" = xyes; then
   zsh_cv_sys_dynamic_strip_exe="${zsh_cv_sys_dynamic_strip_exe=yes}"
   zsh_cv_sys_dynamic_strip_lib="${zsh_cv_sys_dynamic_strip_lib=yes}"
   zsh_cv_shared_environ="${zsh_cv_shared_environ=yes}"
-elif test "$host_os" = cygwin; then
+elif test "$host_os" = cygwin -o "$host_os" = msys; then
   DL_EXT="${DL_EXT=dll}"
 ##DLLD="${DLLD=dllwrap}"
   DLLD="${DLLD=$CC}"
@@ -2976,7 +2976,7 @@ if test "x$dynamic" = xyes; then
   if $strip_libldflags && test "$zsh_cv_sys_dynamic_strip_lib" = yes; then
     LIBLDFLAGS="$LIBLDFLAGS -s"
   fi
-  if test "$host_os" = cygwin; then
+  if test "$host_os" = cygwin -o "$host_os" = msys; then
     INSTLIB="install.cygwin-lib"
     UNINSTLIB="uninstall.cygwin-lib"
   fi
@@ -3014,7 +3014,7 @@ AC_SUBST(SHORTBOOTNAMES)
 AC_SUBST(INSTLIB)dnl
 AC_SUBST(UNINSTLIB)dnl
 
-if test "$host_os" = cygwin; then
+if test "$host_os" = cygwin -o "$host_os" = msys; then
   EXTRAZSHOBJS="$EXTRAZSHOBJS zsh.res.o"
 fi
 





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