Subject: 29.0.50; Native-compiling the same files at every start
From: Holger Schurig <[email-masked]>
To: [email-masked]
Date: Mon, 3 Oct 2022 00:11:38 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

* I compiled Emacs from GIT by myself (version emacs-28.2-159399-g2973f91fb3)
* installed it via GNU Stow into /usr/local/emacs
* whenever I now run "emacs -Q" the same files will always be
byte-compiled according to "*Async-native-compile-log*":

Compiling /usr/local/share/emacs/29.0.50/lisp/emacs-lisp/cl-loaddefs.el.gz...
uncompressing cl-loaddefs.el.gz...
uncompressing cl-loaddefs.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/emacs-lisp/cl-lib.el.gz...
uncompressing cl-lib.el.gz...
uncompressing cl-lib.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/emacs-lisp/cl-extra.el.gz...
uncompressing cl-extra.el.gz...
uncompressing cl-extra.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/help-mode.el.gz...
uncompressing help-mode.el.gz...
uncompressing help-mode.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/emacs-lisp/gv.el.gz...
uncompressing gv.el.gz...
uncompressing gv.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/emacs-lisp/cl-macs.el.gz...
uncompressing cl-macs.el.gz...
uncompressing cl-macs.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/emacs-lisp/cl-seq.el.gz...
uncompressing cl-seq.el.gz...
uncompressing cl-seq.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/emacs-lisp/rx.el.gz...
uncompressing rx.el.gz...
uncompressing rx.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/emacs-lisp/subr-x.el.gz...
uncompressing subr-x.el.gz...
uncompressing subr-x.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/emacs-lisp/icons.el.gz...
uncompressing icons.el.gz...
uncompressing icons.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/emacs-lisp/warnings.el.gz...
uncompressing warnings.el.gz...
uncompressing warnings.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/display-line-numbers.el.gz...
uncompressing display-line-numbers.el.gz...
uncompressing display-line-numbers.el.gz...done
Compilation finished.
Compilation finished.
Compiling /usr/local/share/emacs/29.0.50/lisp/mail/mail-utils.el.gz...
uncompressing mail-utils.el.gz...
uncompressing mail-utils.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/mail/ietf-drums.el.gz...
uncompressing ietf-drums.el.gz...
uncompressing ietf-drums.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/gnus/mm-util.el.gz...
uncompressing mm-util.el.gz...
uncompressing mm-util.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/mail/rfc2045.el.gz...
uncompressing rfc2045.el.gz...
uncompressing rfc2045.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/mail/rfc2047.el.gz...
uncompressing rfc2047.el.gz...
uncompressing rfc2047.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/mail/sendmail.el.gz...
uncompressing sendmail.el.gz...
uncompressing sendmail.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/mail/mailheader.el.gz...
uncompressing mailheader.el.gz...
uncompressing mailheader.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/gnus/gmm-utils.el.gz...
uncompressing gmm-utils.el.gz...
uncompressing gmm-utils.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/mail/mailabbrev.el.gz...
uncompressing mailabbrev.el.gz...
uncompressing mailabbrev.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/mail/rfc2231.el.gz...
uncompressing rfc2231.el.gz...
uncompressing rfc2231.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/mail/mail-parse.el.gz...
uncompressing mail-parse.el.gz...
uncompressing mail-parse.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/gnus/mm-encode.el.gz...
uncompressing mm-encode.el.gz...
uncompressing mm-encode.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/gnus/mm-decode.el.gz...
uncompressing mm-decode.el.gz...
uncompressing mm-decode.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/gnus/mm-bodies.el.gz...
uncompressing mm-bodies.el.gz...
uncompressing mm-bodies.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/calendar/time-date.el.gz...
uncompressing time-date.el.gz...
uncompressing time-date.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/emacs-lisp/text-property-search.el.gz...
uncompressing text-property-search.el.gz...
uncompressing text-property-search.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/gnus/gnus-util.el.gz...
uncompressing gnus-util.el.gz...
uncompressing gnus-util.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/epg-config.el.gz...
uncompressing epg-config.el.gz...
uncompressing epg-config.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/mail/rfc6068.el.gz...
uncompressing rfc6068.el.gz...
uncompressing rfc6068.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/epg.el.gz...
uncompressing epg.el.gz...
uncompressing epg.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/emacs-lisp/derived.el.gz...
uncompressing derived.el.gz...
uncompressing derived.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/epa.el.gz...
uncompressing epa.el.gz...
uncompressing epa.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/password-cache.el.gz...
uncompressing password-cache.el.gz...
uncompressing password-cache.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/gnus/mml-sec.el.gz...
uncompressing mml-sec.el.gz...
uncompressing mml-sec.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/gnus/mml.el.gz...
uncompressing mml.el.gz...
uncompressing mml.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/mail/rfc822.el.gz...
uncompressing rfc822.el.gz...
uncompressing rfc822.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/dired.el.gz...
uncompressing dired.el.gz...
uncompressing dired.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/net/puny.el.gz...
uncompressing puny.el.gz...
uncompressing puny.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/yank-media.el.gz...
uncompressing yank-media.el.gz...
uncompressing yank-media.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/net/mailcap.el.gz...
uncompressing mailcap.el.gz...
uncompressing mailcap.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/gnus/message.el.gz...
uncompressing message.el.gz...
uncompressing message.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/mail/emacsbug.el.gz...
uncompressing emacsbug.el.gz...
uncompressing emacsbug.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/mail/mail-extr.el.gz...
uncompressing mail-extr.el.gz...
uncompressing mail-extr.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/sort.el.gz...
uncompressing sort.el.gz...
uncompressing sort.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/emacs-lisp/shadow.el.gz...
uncompressing shadow.el.gz...
uncompressing shadow.el.gz...done
Compiling /usr/local/share/emacs/29.0.50/lisp/emacs-lisp/pp.el.gz...
uncompressing pp.el.gz...
uncompressing pp.el.gz...done
Compilation finished.

So, when I stop Emacs and start it again, I get the same behavior.

I think the underlying problem is that /usr/local/share is root owned,
and my running Emacs as a user don't have write access. So no *.eln
files end up in this path. And this makes Emacs trying to byte-compile
them again.

Couldn't Emacs byte-compile them at "make" or "make install" steps?

In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.34, cairo version 1.16.0) of 2022-10-03 built on holger
Repository revision: 2973f91fb3de824cd21399dc5cd298d4b8be4022
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101003
System Description: Debian GNU/Linux bookworm/sid

Configured using:
 'configure -C --with-cairo --with-dbus --with-file-notification=inotify
 --with-gnutls --with-gpm=no --with-harfbuzz --with-imagemagick
 --with-json --with-modules --with-native-compilation --with-rsvg
 --with-small-ja-dic --with-sound=alsa --with-threads
 --with-toolkit-scroll-bars --with-x-toolkit=gtk3 --with-xml2
 --with-xwidgets --without-gconf --without-gpm --without-gsettings
 --without-hesiod --without-imagemagick --without-kerberos
 --without-kerberos5 --without-ns --without-pop --without-selinux
 --without-wide-int --without-xft --without-xim 'CFLAGS=-g -O2
 -march=native -ffile-prefix-map=/home/holger=. -fstack-protector-strong
 -Wformat -Werror=format-security -Wall -fno-omit-frame-pointer''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS HARFBUZZ JPEG JSON LCMS2
LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY
PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS
X11 XDBE XIM XINPUT2 XPM XWIDGETS GTK3 ZLIB

Important settings:
  value of $LANG: C.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  buffer-read-only: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: (only . t)
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
display-line-numbers comp comp-cstr warnings icons subr-x rx cl-seq
cl-macs gv cl-extra help-mode cl-loaddefs cl-lib bytecomp byte-compile
cconv rmc iso-transl tooltip eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads
xwidget-internal dbusbind inotify lcms2 dynamic-setting
font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 81135 9949)
 (symbols 48 7182 0)
 (strings 32 23229 3214)
 (string-bytes 1 738678)
 (vectors 16 19025)
 (vector-slots 8 332533 13684)
 (floats 8 43 20)
 (intervals 56 316 0)
 (buffers 1000 12))