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: <3AB181E3.85663C13@dot21rts.com> Date: Thu, 15 Mar 2001 22:00:51 -0500 From: Andy Helten X-Mailer: Mozilla 4.75 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Robert Collins , cygwin AT cygwin DOT com Subject: Re: Shell's "eval" doesn't behave when running a non-cygwin compiler References: <3AB14F6C DOT E15E2D61 AT dot21rts DOT com> <032601c0adab$c8931870$0200a8c0 AT lifelesswks> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I just recently, thee weeks ago, installed the entire distribution on a Win98 machine and two weeks ago on a Win2k machine -- both exhibit the same behavior. I will update again tomorrow. Andy Robert Collins wrote: > 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 Shop online without a credit card http://www.rocketcash.com RocketCash, a NetZero subsidiary -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple