zsh-users
 help / color / mirror / code / Atom feed
From: Tomasz Pala <gotar@polanet.pl>
To: zsh-users@zsh.org
Subject: zcompiled files not used
Date: Sat, 7 Aug 2021 13:46:40 +0200	[thread overview]
Message-ID: <20210807114640.GA16427@polanet.pl> (raw)

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@pld-linux.org>


             reply	other threads:[~2021-08-07 11:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-07 11:46 Tomasz Pala [this message]
2021-08-07 14:01 ` Tomasz Pala

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=20210807114640.GA16427@polanet.pl \
    --to=gotar@polanet.pl \
    --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).