Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZSH not compiled with regex-match? #115

Closed
danielloader opened this issue May 4, 2016 · 6 comments
Closed

ZSH not compiled with regex-match? #115

danielloader opened this issue May 4, 2016 · 6 comments

Comments

@danielloader
Copy link

When running zplug the initialisation of zplug fails:

 * zplug self management
__as__:42: failed to load module: zsh/regex
__as__:42: -regex-match not available for regex
__from__:46: failed to load module: zsh/regex
__from__:46: -regex-match not available for regex
__from__:46: failed to load module: zsh/regex
__from__:46: -regex-match not available for regex
__frozen__:44: failed to load module: zsh/regex
__frozen__:44: -regex-match not available for regex
__lazy__:44: failed to load module: zsh/regex
__lazy__:44: -regex-match not available for regex
__nice__:24: failed to load module: zsh/regex
__nice__:24: -regex-match not available for regex
__zplug::core::core::is_handler_defined:6: 2: parameter not set
@alllexx88
Copy link
Collaborator

I've rebuilt zsh with pcre enabled: 4100ced Please test whether it helps.

@danielloader
Copy link
Author

$ source .zshrc
Cloning into '/root/.zplug'...
remote: Counting objects: 2458, done.
remote: Total 2458 (delta 0), reused 0 (delta 0), pack-reused 2458
Receiving objects: 100% (2458/2458), 589.25 KiB | 494.00 KiB/s, done.
Resolving deltas: 100% (1320/1320), done.
Checking connectivity... done.
 * zplug self management
__as__:42: failed to load module: zsh/regex
__as__:42: -regex-match not available for regex
__from__:46: failed to load module: zsh/regex
__from__:46: -regex-match not available for regex
__from__:46: failed to load module: zsh/regex
__from__:46: -regex-match not available for regex
__frozen__:44: failed to load module: zsh/regex
__frozen__:44: -regex-match not available for regex
__lazy__:44: failed to load module: zsh/regex
__lazy__:44: -regex-match not available for regex
__nice__:24: failed to load module: zsh/regex
__nice__:24: -regex-match not available for regex
__zplug::core::core::is_handler_defined:6: 2: parameter not set
$ zsh --version
zsh 5.1.1 (mipsel-unknown-linux-gnu)
$ ipkg list_installed | grep zsh
zsh - 5.1.1-2

No unfortunately mhmm.

Seems related to this bsd zsh issue with =~ being somewhat essential to lots of scripts.

@alllexx88
Copy link
Collaborator

Well, yes, I saw that either. Unfortunately, zsh 5.1.1 doesn't understand --enable-regex switch, so I could only pass --enable-pcre, from the flags mentioned there, which I did. Have no other ideas here.

@danielloader
Copy link
Author

The build log for my ubuntu binary cites for ./configure

./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=\${prefix}/lib/x86_64-linux-gnu --libexecdir=\${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking --prefix=/usr --mandir=/usr/share/man --bindir=/bin "LDFLAGS=-Wl,--as-needed -g -Wl,-Bsymbolic-functions -Wl,-z,relro" --infodir=/usr/share/info --enable-maildir-support --enable-max-jobtable-size=256 --enable-etcdir=/etc/zsh --enable-function-subdirs --enable-site-fndir=/usr/local/share/zsh/site-functions --enable-fndir=/usr/share/zsh/functions --with-tcsetpgrp "--with-term-lib=ncursesw tinfo" --enable-cap --enable-pcre --enable-readnullcmd=pager --enable-custom-patchlevel=Debian --enable-additional-fpath=/usr/share/zsh/vendor-functions,/usr/share/zsh/vendor-completions --disable-ansi2knr --disable-dynamic --enable-ldflags=-static --disable-dynamic-nss
configure: WARNING: unrecognized options: --disable-silent-rules, --disable-maintainer-mode, --disable-dependency-tracking, --enable-max-jobtable-size

Nothing stands out but it works using the binary built... mhmm.

@alllexx88
Copy link
Collaborator

I think I figured it out. Just have to edit config.modules file in the src root. I'll fix it tomorrow, since I have to go to sleep now. Regards

@alllexx88
Copy link
Collaborator

I believe this is now fixed:

root@unknown:/tmp/home/root# /opt/bin/zsh
\u@\h:\w\$ zmodload zsh/regex
\u@\h:\w\$ [[ "foobar_123" -regex-match "^([a-zA-Z0-9]+)_([0-9]+)$" ]] && echo match || echo no match
match

zsh is now built with all available modules. And I upgraded it to 5.2 along the way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants