zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: omit completion tests if no zpty
@ 2004-03-11 19:15 Peter Stephenson
  2004-03-12 16:17 ` Oliver Kiddle
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 2004-03-11 19:15 UTC (permalink / raw)
  To: Zsh hackers list

This should prevent the lack of zpty causing unnecessary grief, although
obviously it doesn't help if zpty is present but not working.

I will try and get 4.2.0-pre-4 out when Oliver has finished off HP-UX
for the time being.  I imagine we will have to do without zpty there.
It would be nice at least to have some way of detecting if it doesn't
work.  (Does it have /dev/ptmx?  Is it defining __SVR4?  If so, it might
be getting into problems fiddling with STREAMS, which is the problem
we had with the first go using /dev/ptmx on Linux.  If that looks
likely, restricting the STREAMS stuff to Solaris is probably the best
bet.  But that's only one of a dozen possibilities.)

I will need to alter MACHINES.  A lot of that material is historical and
should more clearly be indicated as such.  Any pre-edited entries for
particular machine types would come in very handy.


Index: Test/Y01completion.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/Y01completion.ztst,v
retrieving revision 1.3
diff -u -r1.3 Y01completion.ztst
--- Test/Y01completion.ztst	22 Aug 2001 15:59:27 -0000	1.3
+++ Test/Y01completion.ztst	11 Mar 2004 19:01:44 -0000
@@ -1,18 +1,20 @@
 # Tests for completion system.
 
 %prep
-  . $ZTST_srcdir/comptest
-
-  mkdir comp.tmp
-  cd comp.tmp
-
-  comptestinit -z $ZTST_testdir/../Src/zsh &&
-  {
-    mkdir dir1 &&
-    mkdir dir2 &&
-    touch file1 &&
-    touch file2
-  }
+  if ( zmodload -i zsh/zpty ) >/dev/null 2>&1; then
+    . $ZTST_srcdir/comptest
+    mkdir comp.tmp
+    cd comp.tmp
+    comptestinit -z $ZTST_testdir/../Src/zsh &&
+    {
+      mkdir dir1 &&
+      mkdir dir2 &&
+      touch file1 &&
+      touch file2
+    }
+  else
+    ZTST_unimplemented="the zsh/zpty module is not available"
+  fi
 
 %test
 
Index: Test/Y02compmatch.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/Y02compmatch.ztst,v
retrieving revision 1.2
diff -u -r1.2 Y02compmatch.ztst
--- Test/Y02compmatch.ztst	25 Jun 2001 03:06:35 -0000	1.2
+++ Test/Y02compmatch.ztst	11 Mar 2004 19:01:45 -0000
@@ -11,28 +11,30 @@
 # contains the compadd output.
 
 %prep
-  . $ZTST_srcdir/comptest
-
-  mkdir match.tmp
-  cd match.tmp
-
-  comptestinit -z $ZTST_testdir/../Src/zsh &&
-  {
-    list1=(IndianRed IndianRed2 IndianRed3 IndianRed4)
-    test_code () {
-	matcher=$1;
-	list=$2;
-	code="compdef _tst tst ; _tst () { echo -n '<COMPADD>';compadd -M '"
-	code="$code$matcher"
-	code="$code'  - ${(P)list} ; echo  -n '</COMPADD>'"
-        code="$code; $extra_cmd"
-        code="$code; echo -n '<INSERT_POSITIONS>'"
-        code="$code; echo \$compstate[insert_positions]"
-        code="$code; echo -n '</INSERT_POSITIONS>'"
-        code="$code}"
-	comptesteval "$code"
+  if ( zmodload -i zsh/zpty ) >/dev/null 2>&1; then
+    . $ZTST_srcdir/comptest
+    mkdir match.tmp
+    cd match.tmp
+    comptestinit -z $ZTST_testdir/../Src/zsh &&
+    {
+      list1=(IndianRed IndianRed2 IndianRed3 IndianRed4)
+      test_code () {
+    	matcher=$1;
+    	list=$2;
+    	code="compdef _tst tst ; _tst () { echo -n '<COMPADD>';compadd -M '"
+    	code="$code$matcher"
+    	code="$code'  - ${(P)list} ; echo  -n '</COMPADD>'"
+          code="$code; $extra_cmd"
+          code="$code; echo -n '<INSERT_POSITIONS>'"
+          code="$code; echo \$compstate[insert_positions]"
+          code="$code; echo -n '</INSERT_POSITIONS>'"
+          code="$code}"
+    	comptesteval "$code"
+      }
     }
-  }
+  else
+    ZTST_unimplemented="the zsh/zpty module is not available"
+  fi
 
 
 %test
Index: Test/Y03arguments.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/Y03arguments.ztst,v
retrieving revision 1.5
diff -u -r1.5 Y03arguments.ztst
--- Test/Y03arguments.ztst	25 Feb 2002 09:16:27 -0000	1.5
+++ Test/Y03arguments.ztst	11 Mar 2004 19:01:45 -0000
@@ -1,16 +1,18 @@
 # Tests for _arguments.
 
 %prep
-  . $ZTST_srcdir/comptest
-
-  mkdir comp.tmp
-  cd comp.tmp
-
-  comptestinit -z $ZTST_testdir/../Src/zsh &&
-  {
-    comptesteval 'compdef _tst tst'
-    tst_arguments () { comptesteval "_tst () { _arguments ${${(@qq)*}} }" }
-  }
+  if ( zmodload -i zsh/zpty ) >/dev/null 2>&1; then
+    . $ZTST_srcdir/comptest
+    mkdir comp.tmp
+    cd comp.tmp
+    comptestinit -z $ZTST_testdir/../Src/zsh &&
+    {
+      comptesteval 'compdef _tst tst'
+      tst_arguments () { comptesteval "_tst () { _arguments ${${(@qq)*}} }" }
+    }
+  else
+    ZTST_unimplemented="the zsh/zpty module is not available"
+  fi
 
 %test
  tst_arguments ':desc1:(arg1)'

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: omit completion tests if no zpty
  2004-03-11 19:15 PATCH: omit completion tests if no zpty Peter Stephenson
@ 2004-03-12 16:17 ` Oliver Kiddle
  2004-03-12 16:56   ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Oliver Kiddle @ 2004-03-12 16:17 UTC (permalink / raw)
  To: Zsh hackers list

Peter wrote:
> This should prevent the lack of zpty causing unnecessary grief, although
> obviously it doesn't help if zpty is present but not working.

Note that we're now slightly inconsistent on wording for warnings about
missing modules:
./V01zmodload.ztst: starting.
Warning: zsh/example not linked: not checking autoloading
./V01zmodload.ztst: all tests successful.
./Y01completion.ztst: starting.
./Y01completion.ztst: skipped (the zsh/zpty module is not available)

though I appreciate that in V01, it is only some tests being skipped.

> I will try and get 4.2.0-pre-4 out when Oliver has finished off HP-UX
> for the time being.  I imagine we will have to do without zpty there.

With gcc, dynamic modules were being disabled. Hence, it couldn't load
the modules. The problem was it was trying to use the linker options from
the native compiler. With the patch below, gcc now builds a dynamic zsh.

> It would be nice at least to have some way of detecting if it doesn't
> work.  (Does it have /dev/ptmx?  Is it defining __SVR4?  If so, it might
> be getting into problems fiddling with STREAMS, which is the problem
> we had with the first go using /dev/ptmx on Linux.  If that looks
> likely, restricting the STREAMS stuff to Solaris is probably the best
> bet.  But that's only one of a dozen possibilities.)

__SVR4 is not defined. configure finds /dev/ptmx and deems it usable.
sys/stropts.h also found and deemed usable. Cutting off the two
`&& defined(__SVR4)' sections doesn't help. What else might I try?

Oliver

Index: configure.ac
===================================================================
RCS file: /cvsroot/zsh/zsh/configure.ac,v
retrieving revision 1.13
diff -u -r1.13 configure.ac
--- configure.ac	4 Mar 2004 14:03:48 -0000	1.13
+++ configure.ac	12 Mar 2004 16:07:08 -0000
@@ -2007,18 +2007,21 @@
   fi
   if test -n "$GCC"; then
     case "$host_os" in
+      hpux*)   DLLDFLAGS="${DLLDFLAGS=-shared}" ;;
       darwin*) DLCFLAGS="${DLCFLAGS=-fno-common}" ;;
       *)       DLCFLAGS="${DLCFLAGS=-fPIC}" ;;
     esac
   else
     case "$host_os" in
-      hpux*)                 DLCFLAGS="${DLCFLAGS=+z}" ;;
+      hpux*)
+        DLCFLAGS="${DLCFLAGS=+z}"
+        DLLDFLAGS="${DLLDFLAGS=-b}"
+      ;;
       sunos*)                DLCFLAGS="${DLCFLAGS=-pic}" ;;
       solaris*|sysv4*|esix*) DLCFLAGS="${DLCFLAGS=-KPIC}" ;;
     esac
   fi
   case "$host_os" in
-    hpux*)        DLLDFLAGS="${DLLDFLAGS=-b}" ;;
     freebsd*|linux*|irix*|osf*|gnu*) DLLDFLAGS="${DLLDFLAGS=-shared}" ;;
     sunos*)       DLLDFLAGS="${DLLDFLAGS=-assert nodefinitions}" ;;
     sysv4*|esix*) DLLDFLAGS="${DLLDFLAGS=-G $ldflags}" ;;


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: omit completion tests if no zpty
  2004-03-12 16:17 ` Oliver Kiddle
@ 2004-03-12 16:56   ` Peter Stephenson
  2004-03-12 19:00     ` Oliver Kiddle
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 2004-03-12 16:56 UTC (permalink / raw)
  To: Zsh hackers list

Oliver Kiddle wrote:
> __SVR4 is not defined. configure finds /dev/ptmx and deems it usable.
> sys/stropts.h also found and deemed usable. Cutting off the two
> `&& defined(__SVR4)' sections doesn't help. What else might I try?

Presumably the problem is in get_pty(), which isn't all that long.
Probably strace or truss ought to say where the difficulty is.

Or we can try explicitly #undef USE_DEV_PTMX and see if that works.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: omit completion tests if no zpty
  2004-03-12 16:56   ` Peter Stephenson
@ 2004-03-12 19:00     ` Oliver Kiddle
  2004-03-15 10:43       ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Oliver Kiddle @ 2004-03-12 19:00 UTC (permalink / raw)
  To: Zsh hackers list

Peter wrote:
> 
> Presumably the problem is in get_pty(), which isn't all that long.
> Probably strace or truss ought to say where the difficulty is.

I'm not sure it is get_pty(). All is seemingly okay when creating a zpty
command but trying to read from it (-r, -t, -L etc) just hangs till I
press Ctrl-C.

> Or we can try explicitly #undef USE_DEV_PTMX and see if that works.

That results in exactly the same happening so isn't much help.

Could we perhaps try taking code from here:
http://cvs.sourceforge.net/viewcvs.py/expect/expect/pty_termios.c?rev=5.37

At the top, it says the file is in the public domain so we can use it.
It seems to indicate that we need to trap some ioctls. Also looks like
it uses /dev/ptym.

Is it worth trying to do something before 4.2?

Oliver


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: omit completion tests if no zpty
  2004-03-12 19:00     ` Oliver Kiddle
@ 2004-03-15 10:43       ` Peter Stephenson
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Stephenson @ 2004-03-15 10:43 UTC (permalink / raw)
  To: Zsh hackers list

Oliver Kiddle wrote:
> Could we perhaps try taking code from here:
> http://cvs.sourceforge.net/viewcvs.py/expect/expect/pty_termios.c?rev=5.37
> 
> At the top, it says the file is in the public domain so we can use it.
> It seems to indicate that we need to trap some ioctls. Also looks like
> it uses /dev/ptym.
> 
> Is it worth trying to do something before 4.2?

If it's easy enough, yes.  I'd like to try and finish every by the end
of this week.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-03-15 10:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-11 19:15 PATCH: omit completion tests if no zpty Peter Stephenson
2004-03-12 16:17 ` Oliver Kiddle
2004-03-12 16:56   ` Peter Stephenson
2004-03-12 19:00     ` Oliver Kiddle
2004-03-15 10:43       ` Peter Stephenson

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).