zsh-workers
 help / color / mirror / code / Atom feed
From: Phil Pennock <zsh-workers+phil.pennock@spodhuis.org>
To: zsh-workers@zsh.org
Subject: Re: zsh/re2 : avoid until further notice
Date: Sun, 11 Sep 2016 19:23:51 +0000	[thread overview]
Message-ID: <20160911192351.GA28725@tower.spodhuis.org> (raw)
In-Reply-To: <20160910190924.GB4045@fujitsu.shahaf.local2>

[ returning to on-list with Daniel's permission; being a little
  repetitive with my answer to provide context for others ]

On 2016-09-10 at 19:09 +0000, Daniel Shahaf wrote:
> Phil Pennock wrote on Sat, Sep 10, 2016 at 01:04:56 +0000:
> > On 2016-09-09 at 04:57 +0000, Daniel Shahaf wrote:
> > > I don't follow the bit about "require setting a var".  When the test
> > > program crashes, AC_TRY_RUN evaluates its third parameter; when
> > > cross-compiling, it evaluates the fourth.  The first three actual
> > > parameters seem fine to me.  The fourth as written makes --with-re2 and
> > > cross-builds mutually exclusive.
> > 
> > In my testing (autoconf 2.69) I initially had:
> >   PROG  =yes  =no   =unknown
> 
> That's exactly what I would expect the result of the test to be.  
> 
> > and the =unknown for cross-compiling meant that when the build crashed,
> > autoconf declared the status 'unknown' and continued.
> > 
> 
> What do you mean, "when the build crashed"?  When cross-compiling,
> AC_TRY_RUN does not attempt to run the program it compiles and links.
> If you mean, "when the test program would crash if run in the target
> hardware", then I think there ought to be a way to enable re2 even for
> cross-compiling.  It could be, for example:

At no point have I tried this with cross-compiling.  I will also state
up-front that I don't know autotools very well.

If the cre2 shim library, which provides the C-language bindings to the
re2 C++ library, is built with a different C++ compiler to that used for
re2 then various weird failures happen at runtime.  I have not been able
to get to a simple case which will "exit false" on failure, reliably.
The test program in the `AC_TRY_RUN` is as likely to segfault as to fail
exiting cleanly.

In my environment, 64-bit Intel, MacOS 10.10.5, re2 built with clang++
and cre2 built with either clang++ or g++-6, I tested this test-program
with cre2 built with both compilers, to confirm that it seems to
reliably detect in my environment when the environment is bad.

With the AC_TRY_RUN(PROG,=yes,=no,=unknown), when the program crashed,
the `./configure` run reported the status of that test as "unknown" and
continued on.  Yes, this was building locally, no cross-compiling.
Changing the last parameter of the AC_TRY_RUN to be =no instead of
=unknown resulted in the generated configure script correctly aborting.
autoconf 2.69.

This is not my reading of the documented behaviour of autotools, and I
don't think it's your reading either.  I am not asserting anything about
how cross-compilation should work; for myself, =unknown and
proceed-without-the-safety-check seemed a reasonable approach, which is
why I tried it first and discovered that the non-cross-compiling build
was affected by that fourth parameter.

I don't know how to deal with this, other than if someone else can
reproduce both the working and crashing scenarios and suggest a better
test.  In practice, the patch as included in zsh-workers 39249 works for
me.

>     if test=unknown enableval=yes: issue a warning and go through with the build
>     if test=unknown enableval=no: build without re2
> 
> Or:
> 
>     if test=unknown enableval=force: go through with the build
>     if test=unknown enableval=yes: abort the build, instructing user to retry with --enable-re2=force
>     if test=unknown enableval=no: build without re2
> 
> (These examples are incomplete: they don't cover the non-cross case nor
> the "neither --enable-re2 nor --disable-re2 passed" case.)
> 
> (In light of your later remarks: feel free to CC the list upon reply.)

At this point, the test is only run if `--enable-re2` is passed; the
feature is hard-guarded by that flag.

Also, I don't know if any of the ac logic should be in aclocal.m4,
aczsh.m4, should stay in configure.ac or something else, and how this
should be decided.

If anyone has tried the zsh-workers 39249 patch, success/failure reports
even on the basic functionality would be nice.  :)

Thanks,
-Phil


  parent reply	other threads:[~2016-09-11 19:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-08  4:15 [PATCH] Add zsh/re2 module with conditions Phil Pennock
2016-09-08 13:56 ` [PATCH] re2: fix clean-up path; fix two comments Phil Pennock
2016-09-08 21:14 ` [PATCH] Add zsh/re2 module with conditions Oliver Kiddle
2016-09-08 21:48   ` Phil Pennock
     [not found] ` <20160908144203.GA28545@fujitsu.shahaf.local2>
     [not found]   ` <20160908204737.GA12164@breadbox.private.spodhuis.org>
     [not found]     ` <20160908211643.GA4432@fujitsu.shahaf.local2>
     [not found]       ` <20160909005557.GB12371@breadbox.private.spodhuis.org>
     [not found]         ` <20160909045739.GA6623@fujitsu.shahaf.local2>
     [not found]           ` <20160910010456.GA85981@tower.spodhuis.org>
     [not found]             ` <20160910190924.GB4045@fujitsu.shahaf.local2>
2016-09-11 19:23               ` Phil Pennock [this message]
2016-09-11 19:27                 ` zsh/re2 : avoid until further notice Phil Pennock
2016-09-12  3:50                 ` Daniel Shahaf
2016-09-14 18:47                   ` Phil Pennock

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=20160911192351.GA28725@tower.spodhuis.org \
    --to=zsh-workers+phil.pennock@spodhuis.org \
    --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).