Subject: bug#58267: closed (Re: bug#58267: 29.0.50; Native-compiling the same files at every start)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 05 Oct 2022 05:27:02 +0000

Your bug report

#58267: 29.0.50; Native-compiling the same files at every start

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
58267: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58267
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#58267: 29.0.50; Native-compiling the same files at every start
From: Eli Zaretskii <[email-masked]>
To: Holger Schurig <[email-masked]>
Cc: [email-masked]
Date: Wed, 05 Oct 2022 08:26:14 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Holger Schurig <[email-masked]>
> Date: Tue, 4 Oct 2022 22:13:24 +0200
> 
> > cl-loaddefs.el has a "no-native-compile: t" cookie, so it's expected
> 
> Ah, okay. Still weird that the log claims that it's logged as if it is compiled:
> 
> 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
> 
> Would I have read
> 
> Uncompress /usr/local/share/emacs/29.0.50/lisp/emacs-lisp/cl-loaddefs.el.gz...
> ...done. no-native-compile set, ignored
> 
> then I wouldn't have wondered into this trap.
> 
> > If you start "emacs -Q" and type "M-x load-library RET pcase RET", does pcase get compiled and
> deposited into your eln-cache?
> 
> Ah, that is the difference. Yes, this time it did. Previously it didn't. And the difference was ...  I started
> "emacs" without -Q for the pcase.el example. So I did start Emacs Doom, not vanilla Emacs. And Dooms
> one sets different cache directories:
> 
> > native-comp-eln-load-path is a variable defined in comp.c.
> >
> > Value
> > ("/home/holger/.emacs.d/.local/cache/eln/" "/home/holger/.emacs.d/eln-cache/"
> "/usr/local/stow/emacs/lib/emacs/29.0.50/native-lisp/")
> 
> So the native-compiled pcase.el ended up in Doom's place, not in Emacs' place, where I did expect it.
> 
> That also explains what I reported in my original post.
> 
> * I started "emacs" (Doom) and noticed several files in the Async log
> * Then I started "emacs -Q" and saw the same files again
> * This was because Doom wrote the compiled ones into his directory, hidden from vanilla Emacs, and
> vanilla Emacs had to compile them. Again.
> * On top of that the cl-loaddefs file with the no-native-compile cookie confused me further
> 
> So, sorry that I bothered you. This bug isn't a bug and can be closed.

Thanks, I'm therefore closing this bug.

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))