zsh-workers
 help / color / mirror / code / Atom feed
From: Jun T <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@zsh.org
Subject: Re: Possible ZSH bug involving piping ls to less (MSYS2 & Cygwin)
Date: Thu, 28 Jan 2021 19:42:50 +0900	[thread overview]
Message-ID: <9F63235F-4FF4-4D65-A87B-8AEF3FD4F3C7@kba.biglobe.ne.jp> (raw)
In-Reply-To: <541DBFB6-EEF6-406F-BF19-1AB46E468864@kba.biglobe.ne.jp>


> 2021/01/27 19:14, Jun T <takimoto-j@kba.biglobe.ne.jp> 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
 



  reply	other threads:[~2021-01-28 10:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-27  2:44 agkozak
2021-01-27 10:14 ` Jun T
2021-01-28 10:42   ` Jun T [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-01-18 19:08 agkozak
2021-01-26  1:49 ` Jun T
2022-09-13  8:49 ` Jun T

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9F63235F-4FF4-4D65-A87B-8AEF3FD4F3C7@kba.biglobe.ne.jp \
    --to=takimoto-j@kba.biglobe.ne.jp \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).