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

zcompiled files not used



Hello,

I've stumbled upon a weird zsh behaviour regarding zwc files.
There's a read-only root filesystem with overlayfs (just a regular boot
with systemd.volatile=overlay).

$ cat /etc/zshrc
autoload -U compinit
compinit

$ strace -efile -f zsh -i -c exit 2>&1 | grep /etc/zshrc
stat64("/etc/zshrc.zwc", {st_mode=S_IFREG|0444, st_size=312, ...}) = 0
stat64("/etc/zshrc", {st_mode=S_IFREG|0644, st_size=31, ...}) = 0
openat(AT_FDCWD, "/etc/zshrc.zwc", O_RDONLY|O_LARGEFILE) = 3
openat(AT_FDCWD, "/etc/zshrc.zwc", O_RDONLY|O_LARGEFILE) = 3

- this seems fine, but following doesn't:

$ strace -efile -f zsh -i -c exit 2>&1 | grep _zip
lstat64("/usr/share/zsh/5.8/functions/_zip.zwc", {st_mode=S_IFREG|0444, st_size=19312, ...}) = 0
lstat64("/usr/share/zsh/5.8/functions/_zip", {st_mode=S_IFREG|0644, st_size=9735, ...}) = 0
openat(AT_FDCWD, "/usr/share/zsh/5.8/functions/_zip", O_RDONLY|O_NOCTTY|O_LARGEFILE) = 3


/usr/share/zsh/5.8/functions$ stat _zip _zip.zwc
  File: _zip
  Size: 9735            Blocks: 24         IO Block: 4096   regular file
Device: 2bh/43d Inode: 1226        Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2021-08-07 13:06:04.699999998 +0200
Modify: 2020-02-19 00:48:26.000000000 +0100
Change: 2021-08-07 13:05:56.013333331 +0200
 Birth: -
  File: _zip.zwc
  Size: 19312           Blocks: 40         IO Block: 4096   regular file
Device: 2bh/43d Inode: 1284        Links: 1
Access: (0444/-r--r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2021-08-07 13:17:19.136666661 +0200
Modify: 2021-08-07 13:17:05.169999992 +0200
Change: 2021-08-07 13:17:05.169999992 +0200
 Birth: -

/usr/share/zsh/5.8/functions$ zcompile -t _zip.zwc
zwc file (mapped) for zsh-5.8
_zip


The same happens with zcompiled -R -U -z -k.


This is 32-bit image for HP thin client, this time run in 64-bit
QEMU/KVM guest. However, when I chroot into this directly from the 64-bit 
host, the behavior seems fine - there's a bunch of lstat64() without
openat() of _zip file (esp. when I create digest functions.zwc).


My intention is to generate /usr/share/zsh/5.8/functions.zwc on boot:

zcompile /usr/share/zsh/5.8/functions.zwc /usr/share/zsh/5.8/functions/*

as the destination thin client has very slow CPU and flash drive (20 MB/s
sequential read) and it takes over 1 second to read all the 7 MBs of
completion files and spawn new shell each time.

regards,
-- 
Tomasz Pala <gotar@xxxxxxxxxxxxx>




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