Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh/pcre module breakage when static build enabled



On 2018-03-20 at 12:16 +0700, Vadim A. Misbakh-Soloviov wrote:
> # yeah, even with double `disable-dynamic like in yours)

Sorry, mistake caused by tiredness.

The separate install steps were because I couldn't be bothered to
install the YODL suite of tools in that jail, so skipped the doc stages.

> Then I called ./Src/zsh -f, and...
> 
> note%  setopt rematchpcre
> note%  [[ 'foo→bar' =~ .([^[:ascii:]]). ]]; print $MATCH
> zsh: module `zsh/pcre' has no such feature: `C:pcre-match'
> zsh: -pcre-match not available for regex
> 
> So, it seems, it is either somehow related to linux only, or to libpcre 
> version, maybe...

I just built zsh on Ubuntu Xenial with PCRE packages from 2:8.38-3.1,
and could not reproduce.

I think the only way to get this failure is if PCRE support wasn't
actually built in, and the pcre module became a stub.  Easiest way to
check for that is to look at the HAVE_* values in config.h:

    % grep HAVE_PCRE_ config.h
    #define HAVE_PCRE_COMPILE 1
    #define HAVE_PCRE_EXEC 1
    #define HAVE_PCRE_H 1
    #define HAVE_PCRE_STUDY 1

The build flow requires that you enable the flag, and that
`pcre-config --version` exits successfully.

Are you missing a build dependency?

If you examine the file `config.log` and look for `pcre` then you should
see what checks the configure system ran and what the results were,
which may help with tracing down when things have gone wrong.

There may still be a bug in zsh, or some failure mode which can be
handled more gracefully, but we'll need to know what's actually failing
first.

Hrm, perhaps `--build-require-all-enables` or something for the
`configure` script could have the build system go "hey, you enabled
PCRE, but I'm not going to enable it for $reasons, so that's a fatal
error".  Mechanism: config.h would #define `SHOULD_ERROR_IF_ENABLED` and
`ENABLE_REQUESTED_FOO` for each FOO, and then the #if guard in/around
the relevant modules would just have an `#else if
defined(SHOULD_ERROR_IF_ENABLED) && defined(ENABLE_REQUESTED_FOO)`
followed by `# error whatever` just at the end.

-Phil



Messages sorted by: Reverse Date, Date, Thread, Author