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

Re: zsh/pcre module breakage when static build enabled



В письме от вторник, 20 марта 2018 г. 6:42:36 +07 пользователь Phil Pennock 
написал:
> On 2018-03-20 at 00:33 +0700, Vadim A. Misbakh-Soloviov wrote:
> > Hi there!
> > I faced strange issue: when I build zsh-5.4.2 as static binary and trying
> > to> 
> > run, for example, something like that:
> > > $  [[ 'foo→bar' =~ .([^[:ascii:]]). ]]; print $MATCH
> > 
> > I'm getting following errors:
> > > zsh: module `zsh/pcre' has no such feature: `C:pcre-match'
> > > zsh: -pcre-match not available for regex
> > 
> > Although, when I rebuild it as dynamically linked binary, pcre starting to
> > work again
> > 
> > I think, it looks like a bug.
> > 
> > Isn't it a way to fix it?
> 
> I went to do a static build on FreeBSD (Darwin doesn't support static
> binaries) and when grabbing the configure options used by Ports, saw
> this:
> 
>   ## Some modules can only be built as a shared library.
>   ## If you enable STATIC, you may get strange errors if you, a script,
>   ## or a plugin tries to use the regex module.
> 
> So someone has spotted this before, but I don't recall seeing a
> bug-report.

Well, yup. Even some of my friends said they faced that too.

> Here's what I did.  Did you perhaps skip the '--disable-dynamic' option,
> required to change how zsh manages the module code when building
> statically?

Well, actually, I'm using Gentoo (and it's "static" use-flag). And final 
configure-string is (for experiment clearance I also took version from git 
HEAD):

> ./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-
linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/
share --sysconfdir=/etc --localstatedir=/var/lib --docdir=/usr/share/doc/
zsh-9999 --htmldir=/usr/share/doc/zsh-9999/html --bindir=/bin --libdir=/usr/
lib64 --enable-etcdir=/etc/zsh --enable-runhelpdir=/usr/share/zsh/9999/help --
enable-fndir=/usr/share/zsh/9999/functions --enable-site-fndir=/usr/share/zsh/
site-functions --enable-function-subdirs --with-tcsetpgrp --enable-maildir-
support --enable-pcre --enable-cap --enable-multibyte --enable-unicode9 --
enable-gdbm --disable-dynamic

And there is also seddig similar to yours, and, as result:

> name=zsh/pcre modfile=Src/Modules/pcre.mdd link=static auto=yes load=no
> name=zsh/regex modfile=Src/Modules/regex.mdd link=static auto=yes load=no


Although, result still the same as in release version.


> make install.bin install.modules install.fns

Although, instead of this, ebuild just doing `make install install.info`, and 
then copies completions and so on by itself.

But as far as I understand principles of static build, it shouldn't interfere 
in any way, since the binary (zsh)

Attachment: signature.asc
Description: This is a digitally signed message part.



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