This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Pending patches for generic build script


On Fri, 13 Feb 2004, Charles Wilson wrote:

> Igor Pechtchanski wrote:
>
> >>false || true
> >>
> >>As a bonus, this construct documents that this particular line can
> >>return a false value.
> >
> >
> > I see.  Well, this does look reasonably readable...  Another problem with
> > "set +e" that I vaguely recall reading about is that it may not always be
> > propagated into functions...  If you're willing to test this and make sure
> > it always works properly, and if nobody else protests, I'll consider
> > patching the generic-build-script.
>
> Yes, I've never liked the silly looking '&& \' syntax in the gbs.  If
> propagation of 'set +e' into functions is a problem, then just have each
> function re-do it...

Chuck,

Ok, great!  Since you're in favor of it (and you're the ultimate authority
on the gbs, I'm just temporarily handling the maintainer duties), it makes
me much more confident.  I'll let Rafael test out the propagation of "set
+e" into functions, and then make the appropriate change.

> mkdirs() {(
>    set +e
>    cd ${topdir}
>    rm -fr ${objdir} ${instdir} ${srcinstdir} || true
>    mkdir -p ${objdir}
>    mkdir -p ${instdir}
>    mkdir -p ${srcinstdir}
> )}
>
> Plus, if the shell is changed from #!/bin/sh to #!/bin/bash, then you
> don't need the subshell -- because 'pushd' is available.  (Yes, I know
> you could do, even in sh, "CWD=`pwd`; cd ${topdir} ; .... ; cd ${CWD}"
> but there's another reason...)
>
> I've noticed lately that sometimes, when launching configure from an
> environment where SHELL is /bin/sh (==ash), I get weird,
> non-deterministic errors:
>
> "error: invalid feature name: shared"
>
> when "--enable-shared" IS a valid feature for the package; but the error
> doesn't show up ALL the time.  This issue is what's made me have to run
> (portions) of the libtool test suite over and over before releasing it,
> because many of the tests which fail will EVENTUALLY succeed.  Or, I
> just configure with bash as my shell...the problem never seems to appear
> when using bash.

WAG: this could be related to some malloc() bug, which manifests as a
failure in the shell's pattern matching implementation...  Can you
reproduce this under strace?

> So, you could do:
>
> #!/bin/bash
> set +e
> ...
> mkdirs() {
>    set +e
>    cd ${topdir}
>    rm -fr ${objdir} ${instdir} ${srcinstdir} || true
>    mkdir -p ${objdir}
>    mkdir -p ${instdir}
>    mkdir -p ${srcinstdir}
> }
>
> --
> Chuck

Umm, yes, since bash is in the "Base" category, any Cygwin machine will
have it, and it's not like the performance of the gbs itself is an
issue...

I think I'll wait until all the others' patches have been applied, though,
and then do it in one shot as one big change.

Rafael, if you're reading this, could you do the tests with both sh and
bash, and let me know if bash behaves better with respect to "set +e"?  If
it does, we can switch the gbs to use bash.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]