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

Re: Static link of curses module

On Sun, 27 Sep 2015 15:16:10 +0200
Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx> wrote:
> Hello
> Editing Src/Modules/curses.mdd, putting:
> name=zsh/curses
> link=static
> load=yes
> to the beginning there (the script that's there by default doesn't
> work) doesn't result in availability of the module (in the produced
> zsh).

(the above emended as in the follow-up).

The infrastrcture for handling modules doesn't get much love and
attention and is inadequate in many respects.  (In constrast, so far as
I know. the module code within the shell to deal with modules after the
build system has done its job is generally effective.)

Typically, you'd do this by editing config.modules rather than the .mdd
file, but I think the result is the same.  The module is correctly
linked in statically, but isn't actually loaded until you use zmodload,
or mark something for autoload and then use it.

I'm not sure how this is supposed to work.  I can see the module being
registered automatically, but I don't see any evidence that there was
ever a mechanism for running the request "load_module" based on
load=yes.  zsh/main is specially handled, as is zsh/zle and completion,
and the autoload mechanism means that you can cause the module to be
loaded based on configuration, but that looks like it.  I may be looking
in the wrong place.

This isn't generally a problem --- you're generating a variant of the
shell that has expectations about the availability of commands
incompatible with standard builds, i.e. you can run zcurses without any
preliminaries --- but is typical of the problems facing module

I don't see why bltinmods.list shouldn't be able to do the load_module()
after the register_module() if load=yes, but I don't know why it


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