Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Portability of zwc files between zsh versions
- X-seq: zsh-users 27952
- From: Glenn Morris <rgm@xxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Portability of zwc files between zsh versions
- Date: Sun, 14 Aug 2022 11:19:29 -0700
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=stanford.edu; dmarc=pass action=none header.from=stanford.edu; dkim=pass header.d=stanford.edu; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=azUwEu0sD1r71Iv3Xnqhk+X8zAwMvgGreMq4MtZ0huo=; b=XEwqQ5nIay7NWxUILO7ronpClR6WqGh1Opx+opXewttMxwRwPLHz0RVkcAODP0f/Rxhz58PPIK+fmJ2iNhlEb4VtRiXXg6r9j/Oei4eZYhLSp7u5odJ0WsOy72iPuJHR3no7Ym+V73QDmrRh9WuRGY5ovXnjCq8XUpSMvY0hcgrkXNsJMLkICCrqhaos69E3+c2+v4mFyc5zoJKgyzfOskP5xAWpo3w/xaq+MEqR5t1li8yi3My34+m6ETrILON3ib9urwKGoe3S8WHwRu52imEsuu0k3AZPpi/rojLacz8mJHds7PoCcvnzRbjZPOmVanEeINShc9VzfgPBReDxlQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PHgoYk1dLHGc/r4MaIR899aBQbtK+dSFzPpewwVj6cSCSb9pV+KEXnOfNMfl1PegOdsutg2WTTndrf9RhjYDmebvA2/MNu0ajx+8hwiojWqT9c+u9SLwtCNL3GOW2SxkhbRt3Ut4PiCeHwn96ZbSDx0Kp5twexwsNaDzlsCYrq/Svj91SnuWrPBix6y1XB6i7ycweOBf9X74heq0Tc6eY5AeSBSEGcQo36VXVGVkL/zJx/fbTrT8y5/aGJ+Au5KYRFVSDEV2SYCDBTReD3yoLdrRD4MSzk/mXCX1fBWgHZ8s1SLkp5OS520EtULGeBGinuLke8NkhoNz3PVxmZkXOg==
- Archived-at: <https://zsh.org/users/27952>
- List-id: <zsh-users.zsh.org>
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author