Subject: 29.0.50; inhibit-automatic-native-compilation does not work as expected.

From: Max Brieiev <[email-masked]>
Date: Tue, 11 Oct 2022 10:21:45 +0300

I have configured Emacs with --with-native-compilation (for the first
time) and it seemingly compiled fine.

However, libgccjit on my system seems to be broken (or something like
that). When Emacs starts I see lots of native compilation errors.

So I decided to (temporarily) disable this feature until I figure out
what is wrong with my system.

I start Emacs like this:

    $ EMACS_INHIBIT_AUTOMATIC_NATIVE_COMPILATION=t emacs

Now it starts without compilation errors. And it works just fine during
basic usage like sending this bug report.

However, when I invoke magit, I see this:

    Deleting /tmp/comp-lambda-RCGJQI.eln
    comp--native-compile: Native compiler error: (lambda (&rest arg1) (let ((f #'make-process)) (apply f arg1))), "Compiling /tmp/comp-lambda-RCGJQI.eln...
    x86_64-unknown-linux-gnu-gcc-10.3.0: fatal error: cannot execute ‘as’: execvp: No such file or directory
    compilation terminated.

which makes the package unusable.

Some other packages also produce similar errors, but others like Eglot
work just fine.

I am not sure that this is a valid bug report, because the manual says
that the compiler may still be invoked even if
inhibit-automatic-native-compilation is non-nil, though the result
shouldn't be written to disk. But if I understand the output in Message
buffer, it tries to write the file to disk?

Would it be hard to enhance this feature to completely disable native
compiler?

In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.30, cairo version 1.16.0)
Windowing system distributor 'The X.Org Foundation', version 11.0.12101004
System Description: Guix System

Configured using:
 'configure
 CONFIG_SHELL=/gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal-5.1.8/bin/bash
 SHELL=/gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal-5.1.8/bin/bash
 --prefix=/gnu/store/jz3p1yvfm53j28dmyxpkjji1mimfi5lz-emacs-next-git.master
 --enable-fast-install --with-modules --with-cairo
 --with-native-compilation --disable-build-details'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX 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 GTK3 ZLIB

Important settings:
  value of $EMACSLOADPATH: /home/max/.guix-profile/share/emacs/site-lisp:/gnu/store/jz3p1yvfm53j28dmyxpkjji1mimfi5lz-emacs-next-git.master/share/emacs/29.0.50/lisp
  value of $LANG: en_US.utf8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  shell-dirtrack-mode: t
  paredit-mode: t
  hl-line-mode: t
  global-corfu-mode: t
  corfu-mode: t
  marginalia-mode: t
  vertico-mode: t
  override-global-mode: t
  which-function-mode: t
  savehist-mode: t
  repeat-mode: t
  recentf-mode: t
  pixel-scroll-precision-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  context-menu-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/max/.emacs.d/elpa/transient-20220918.2101/transient hides /gnu/store/jz3p1yvfm53j28dmyxpkjji1mimfi5lz-emacs-next-git.master/share/emacs/29.0.50/lisp/transient

Features:
(shadow sort mail-extr emacsbug cl-print package-x js2-mode etags
fileloop generator js cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs dired-aux eglot array
filenotify jsonrpc ert ewoc xref flymake-proc flymake thingatpt compile
shell pcomplete comint ansi-osc server ansi-color magit-mode transient
comp comp-cstr warnings magit-git magit-base magit-section format-spec
crm dash compat-27 compat-26 rx add-log mule-util cursor-sensor vc-git
diff-mode vc vc-dispatcher project paredit-menu paredit hl-line message
yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg
rfc6068 epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader smtpmail sendmail rfc2047 rfc2045
ietf-drums gnus nnheader gnus-util time-date mail-utils range mm-util
mail-prsvr modus-operandi-theme modus-themes pcase files-x
consult-vertico consult compat-28 compat compat-macs bookmark
text-property-search corfu orderless cus-edit pp icons marginalia
vertico edmacro kmacro cl-extra use-package use-package-ensure
use-package-delight use-package-diminish use-package-bind-key bind-key
easy-mmode use-package-core which-func imenu edebug debug backtrace
find-func savehist repeat recentf tree-widget wid-edit pixel-scroll
cua-base cus-load guix-emacs corfu-autoloads eglot-autoloads
embark-consult-autoloads consult-autoloads embark-autoloads
geiser-guile-autoloads geiser-impl help-fns radix-tree help-mode
geiser-custom geiser-base ring geiser-autoloads js2-mode-autoloads
magit-autoloads git-commit-autoloads magit-section-autoloads
dash-autoloads marginalia-autoloads orderless-autoloads
paredit-menu-autoloads paredit-autoloads transient-autoloads
use-package-autoloads bind-key-autoloads vertico-autoloads
with-editor-autoloads info package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie generate-lisp-file
url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv
bytecomp byte-compile cconv url-vars cl-loaddefs cl-lib 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 dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 444658 55840)
 (symbols 48 29470 55)
 (strings 32 89288 3681)
 (string-bytes 1 3667419)
 (vectors 16 50532)
 (vector-slots 8 818358 54689)
 (floats 8 373 261)
 (intervals 56 766 266)
 (buffers 1000 16))