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

Re: Portability of zwc files between zsh versions



On Sun, Aug 14, 2022 at 11:19 AM Glenn Morris <rgm@xxxxxxxxxxxx> wrote:
>
> The comments in Src/parse.c make me think that the intent was that zwc
> files should be loadable so long as FD_MAGIC|FD_OMAGIC haven't changed

In fact the files are not loadable in the event that any of the
wordcode definitions in parse.c have changed, such as the WC_FUNCDEF
edit in March 2020, among other possible conditions.

Possibly the right thing to do would be to remove the version check
and instead be more diligent about updating the *MAGIC values, I
suspect that the habit of doing the latter was forgotten when the
version check subsumed it.

> It's a bit of a
> nuisance to have to maintain a separate zwc file for each zsh version.

compinit already maintains separate compdumps of autoloads for each
version, so the expectation that the function bodies might need to be
re-zcompiled isn't especially outlandish?

> Is it intentional that zwc files aren't portable between zsh versions?
> If so, it would seem like the endian duplication wouldn't be that useful
> in practice?

The endian duplication is in case you have equivalent versions of zsh
on different machine architectures.  That might not be as common as it
once was.

There have also been some significant improvements in file parsing
speed, so zcompile might not be as advantageous as in the past.




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