From: Glenn Morris <rgm@stanford.edu>
To: zsh-users@zsh.org
Subject: Portability of zwc files between zsh versions
Date: Sun, 14 Aug 2022 11:19:29 -0700 [thread overview]
Message-ID: <87edxiadsf.fsf@xoc19.stanford.edu> (raw)
Hi,
If I use zcompile to create a digest with zsh 5.5, I find I cannot load
the resulting file with zsh 5.8 (or vice versa).
'zcompile -t' prints: "zcompile: zwc file has wrong version"
It seems from the source:
https://github.com/zsh-users/zsh/blob/master/Src/parse.c#L3250
that in order to use a zwc file, the version of zsh it was created with
must match exactly the version of zsh trying to load it?
I was expecting zwc files to be more portable than this, given the
comments in the manual:
The created file always contains two versions of the compiled
format, one for big-endian machines and one for small-endian
machines. The upshot of this is that the compiled file is machine
independent [...]
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 -
they last changed in 52b830353 (2001).
Ref also https://www.zsh.org/mla/workers/2000/msg01327.html
It seems that the ZSH_VERSION check was added back in d296535d3 (2007),
"23313: fix test for incorrect version in ZWC file".
I noticed this issue after zcompiling on a RHEL9 system (zsh 5.8) where
HOME is also accessible to RHEL8 (zsh 5.5) hosts. It's a bit of a
nuisance to have to maintain a separate zwc file for each zsh version.
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?
Thanks.
next reply other threads:[~2022-08-14 18:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-14 18:19 Glenn Morris [this message]
2022-08-14 19:38 ` Bart Schaefer
2022-08-14 20:16 ` Peter Stephenson
2022-08-14 21:05 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87edxiadsf.fsf@xoc19.stanford.edu \
--to=rgm@stanford.edu \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).