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 built with regex support #2449

Closed
forivall opened this issue Sep 12, 2016 · 15 comments
Closed

ZSH not built with regex support #2449

forivall opened this issue Sep 12, 2016 · 15 comments
Labels
status/help-wanted update request to update existing package

Comments

@forivall
Copy link

forivall commented Sep 12, 2016

Setup

Package Name: zsh
Package Version: 5.2-3

NAS Model: DS214se
NAS Architecture: MARVELL Armada 370 88F6707
DSM version: DSM 6.0.2-8451 (also happened on 5)

Expected behavior

norwegian-blue% autoload -U regexp-replace    
norwegian-blue% url=foo/bar                     
norwegian-blue% regexp-replace url '/' '-SLASH-'
norwegian-blue% echo $url                       
foo-SLASH-bar

Actual behavior

norwegian-blue% autoload -U regexp-replace    
norwegian-blue% url=foo/bar                     
norwegian-blue% regexp-replace url '/' '-SLASH-'
regexp-replace:28: failed to load module: zsh/regex
regexp-replace:28: -regex-match not available for regex
norwegian-blue% echo $url                       
foo/bar

Steps to reproduce

1. Install zsh
2. Run the above commands in zsh

The build option to enable regex needs to be enabled: ohmyzsh/ohmyzsh#227 (comment)

@KaraokeStu KaraokeStu self-assigned this Sep 15, 2016
@KaraokeStu KaraokeStu added update request to update existing package status/assigned labels Sep 15, 2016
@KaraokeStu
Copy link
Contributor

I'll try to get on this asap for you

@KaraokeStu
Copy link
Contributor

Unfortunately, I don't know enough about where ZSH is pulling its modules from - it appears to be a problem dynamically loading the module, rather than not having the right mode built.

We unfortunately need the help of someone who understands ZSH better

@x1a0
Copy link

x1a0 commented Sep 22, 2016

@KaraokeStu @forivall
Hi, I can confirm if you modify config.modules file generated in zsh folder during configuration and make zsh/regex module link=static then it works.
But I don't know what's the best way to patch it during compilation.
(I tested on my 1515+, make arch-avoton-5.2)

@KaraokeStu
Copy link
Contributor

Great, thanks for the info. I'll need to check with @Diaoul to see how we can patch this into the make file.

@forivall Any ideas if there are any other modules you'd expect to be available too?

Ideally, it'd be better to get the dynamic module loading working, but I'm not sure how!

@forivall
Copy link
Author

@KaraokeStu I would need to take a look at what modules are in zsh in the first place; I ran into this first when trying to load my dotfiles. The only one that came to mind are the vcs hooks.

Googling gets me the full list: http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html

I'll try that when I get home.

@KaraokeStu
Copy link
Contributor

@forivall The main reason I ask is that these modules are all compiled, but they are dynamically linked and only loaded if necessary - this would be ideal especially for the lower-end devices, as it reduces the memory overhead - however, we need to work out how to configure the system to be able to access these shared dynamic modules - I'm sure it's as simple as tagging something in the configuration, however I don't know enough about ZSH to even know where to start

@forivall
Copy link
Author

the list of modules available in the synology zsh package are:

zsh/compctl
zsh/complete
zsh/complist
zsh/computil
zsh/datetime
zsh/langinfo
zsh/main
zsh/parameter
zsh/sched
zsh/termcap
zsh/terminfo
zsh/zle
zsh/zleparameter
zsh/zutil

The modules I have loading in my typical zsh sessions are:

zsh/compctl
zsh/complete
zsh/complist
zsh/datetime
zsh/langinfo
zsh/main
zsh/parameter
zsh/regex
zsh/stat
zsh/terminfo
zsh/zle
zsh/zleparameter
zsh/zpty
zsh/zutil

So, the ones that I would need to be added are: (comm -23 <(zmodload) <(pbpaste || xclip -sel c -o))

zsh/regex
zsh/stat
zsh/zpty

As far as figuring out how to get shared dynamic modules working, I also don't know where to start. If statically linking the modules would be necessary, other people can run the above command in their shell (with the top list in their clipboard) to see what modules they need.

@ryantrip
Copy link

ryantrip commented Feb 26, 2017

@x1a0 How do I accomplish this step by step? This issue seems to still be relevant at this time, and I want to fix it manually. I don't have enough know-how to resolve this without help.

@agross
Copy link
Contributor

agross commented Aug 26, 2017

I've spent the day to look into this (the first time I looked at a Makefile in detail). I have a DS-2415+.

While compiling noarch dynamic modules get compiled, but obviously the resulting binaries won't run on the DS.

I then inspected zsh's configure.ac and found that this line is the culprit where a previously-defined $dynamic = 'yes' variable is reset to no, hence no compilation of dynamic modules. Then I went and patched that line to have $dynamic == 'yes' for the rest of the script.

A following make arch-avoton in the spk/zsh directory failed nonetheless.

If one doesn't care about the size of the zsh binary, static compilation would probably work, but the work-avoton-5.2/zsh-5.4.1/config.modules would have to be patched before the build.

@jan-auer
Copy link

jan-auer commented Dec 29, 2018

@agross I think this might have regressed with one of the recent updates. With zsh 5.6.2 x86_64-pc-linux-gnu I'm receiving "-regex-match not available for regex" again. zmodload also only outputs these:

zsh/compctl
zsh/complete
zsh/main
zsh/zle

Edit: Just realized that I had installed the package without modules. It works just fine.

@agross
Copy link
Contributor

agross commented Dec 29, 2018

@jan-auer Alright ;-)

@busyhe
Copy link

busyhe commented Nov 9, 2019

+1

async_worker_eval:12: command not found: zpty
async_job:12: command not found: zpty

@agross
Copy link
Contributor

agross commented Nov 9, 2019

@busyhe

What do you mean by "+1"?

$ zmodload zsh/zpty

$ zmodload
zsh/compctl
zsh/complete
zsh/complist
zsh/datetime
zsh/main
zsh/parameter
zsh/regex
zsh/stat
zsh/system
zsh/termcap
zsh/terminfo
zsh/zle
zsh/zleparameter
zsh/zpty
zsh/zutil

$ zpty test sleep 10

# Wait a bit.
$ zpty -
(finished) test: sleep 10

@chickenandpork
Copy link
Member

A “+1” is like a laconic show of support: a vote, a “me too please”

@agross
Copy link
Contributor

agross commented Nov 9, 2019

Thanks, I was aware of that. He didn't comment about what he is supporting, though. Does he have an issue? Because he didn't install the "with modules" variant? Is something broken in his "with modules variant?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/help-wanted update request to update existing package
Projects
None yet
Development

No branches or pull requests

8 participants