Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh/pcre module breakage when static build enabled
- X-seq: zsh-users 23263
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: "Vadim A. Misbakh-Soloviov" <mva@xxxxxxxx>
- Subject: Re: zsh/pcre module breakage when static build enabled
- Date: Mon, 19 Mar 2018 19:42:36 -0400
- Cc: "<zsh-users@xxxxxxx>" <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201802; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=2OE5U/ll6mSHiGRxAJsj92ophs1squE5G+/FaetJ68A=; b=qAJWvVNNi8RmPw+jx2c1S3HDmH 6ZgmDWnmrMHI3WF9jkoWaZsQEdKIGJP4vJG0XZUu+ETfco/AzBiNJ9p7RUtSIT2HIuLlga7rKz8Xp wbEEcZVWyb/ETscQLP88HBp4e9Qjk5TAM0F2TarWaYKDIGFyCa2MW4+H/S28EfrTbkIMiYaqejyJy q7kdgayx/1WKhW63gl10JMcPAgdl;
- In-reply-to: <3073701.qdQlh9y6XZ@note>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Openpgp: url=https://www.security.spodhuis.org/PGP/keys/0x4D1E900E14C1CC04.asc
- References: <3073701.qdQlh9y6XZ@note>
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.
I can't reproduce on FreeBSD, as long as I follow the 'INSTALL'
instructions. Perhaps it could be made easier to build static shells
with variant features, but I suspect that if you really need a static
shell, you can follow the steps.
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?
----------------8< zsh build zsh-5.4.2-198-gd2350a1e8 >8----------------
git pull
git status
git clean -fxd
./.preconfig
CPPFLAGS=-I/usr/local/include LDFLAGS='-L/usr/local/lib -static' \
./configure --prefix=$HOME/uzsh \
--enable-etcdir=/etc --with-tcsetpgrp \
--enable-function-subdirs --enable-maildir-support \
--enable-multibyte --enable-zsh-mem --enable-zsh-secure-free \
--sysconfdir=/usr/local \
--disable-dynamic --with-term-lib="tinfow tinfo" \
--enable-pcre --disable-dynamic
sed -Ei '' -e '/name=zsh\/(pcre|regex)/s/link=no/link=static/' config.modules
make && make install.bin install.modules install.fns
~/uzsh/bin/zsh -f
tower% [[ 'foo→bar' =~ .([^[:ascii:]]). ]]; print $MATCH
zsh: failed to compile regex: invalid character class
tower% setopt rematchpcre
tower% [[ 'foo→bar' =~ .([^[:ascii:]]). ]]; print $MATCH
o→b
----------------8< zsh build zsh-5.4.2-198-gd2350a1e8 >8----------------
I just rebuilt with 'config.modules' saying 'link=static' for every
module except: zsh/attr, zsh/db/gdbm, zsh/example
I can use the resulting shell quite well. It even functions well enough
to display my prompt, which is a bit of a torture test. :^)
-Phil
Messages sorted by:
Reverse Date,
Date,
Thread,
Author