Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <032601c0adab$c8931870$0200a8c0@lifelesswks> From: "Robert Collins" To: "Andy Helten" , References: <3AB14F6C DOT E15E2D61 AT dot21rts DOT com> Subject: Re: Shell's "eval" doesn't behave when running a non-cygwin compiler Date: Fri, 16 Mar 2001 10:58:03 +1100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-OriginalArrivalTime: 15 Mar 2001 23:52:15.0752 (UTC) FILETIME=[F678A080:01C0ADAA] Try a recent snapshot. There was a related thread recently (cygwin not waiting for non-cygwin child process's) that IIRC Chris checked in a fix for. Rob ----- Original Message ----- From: "Andy Helten" To: ; "Larry Hall (RFK Partners, Inc)" Sent: Friday, March 16, 2001 10:25 AM Subject: Shell's "eval" doesn't behave when running a non-cygwin compiler > Hello, > > I've posted this problem to this newgroup a couple times > (first without an strace listing and then with an strace > listing), under the subject: "VxWorks' GNU cross-compiler in > the Cygwin environment". However, I have only gotten one > response and was hoping if I simplified the problem scenario > and changed the "Subject:" line, it might be more appealing > to look at. > > The following simple shell script can be used to produce the > problem: > > #!/bin/sh > rm -f conftest > ac_link="c++ppc -nostdlib -nostdinc -c -o conftest > conftest.cpp" > > if { (eval echo \"$ac_link\"); (eval $ac_link); } then > echo "Compile succeeded (or did it?)" > else > echo "Compile failed!" > fi > > if test -s conftest; then > echo "1. The output is available!" > else > echo "1. The output is NOT available!" > fi > > sleep 2 > > if test -s conftest; then > echo "2. The output is available!" > else > echo "2. The output is NOT available!" > fi > > > If I run the above shell script using 'bash' or 'sh', I get > the following output: > > c++ppc -nostdlib -nostdinc -c -o conftest conftest.cpp > Compile succeeded (or did it?) > 1. The output is NOT available! > 2. The output is available! > > Also, I have found a work around using the following perl > script: > > #!/usr/bin/perl > eval `c++ppc @ARGV`; > > Apparently, Perl's "eval" waits for the compiler to finish > before continuing and 'sh' waits for the cygwin perl to > finish, so this at least serializes things. So the output > from the shell script when using the perl script as the > "compiler" is what you would expect: > > c++ppc_cygwin_workaround -nostdlib -nostdinc -c -o conftest > conftest.cpp > Compile succeeded (or did it?) > 1. The output is available! > 2. The output is available! > > However, the downside is that I don't get the return value > from the compiler. So if a compile fails, it does not stop > the build. > > The question I have: can cygwin 'sh' or 'bash' be used to > spawn non-cygwin utilities (compilers)? From my experience, > the answer is NO. Is it even possible to get 'sh' to > recognize and wait for a non-cygwin process spawned by > 'eval'? Could someone please answer these questions? I can > provide an strace of the above situation if anyone wants > it. And yes, I would be willing to at least look at the > problem, but first would like someone to at least > acknowledge this is problem and/or classify this behavior > (normal/not normal/user error). OR, if there is another > Bourne compatible shell that works with the cygwin > environment could someone point me to it? > > Thanks, > Andy > > > > -- > Want to unsubscribe from this list? > Check out: http://cygwin.com/ml/#unsubscribe-simple > > -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple