GNU bug report logs - #45854
28.0.50; [feature/native-comp] autoload behavior different in the presence of errors

Previous Next

Package: emacs;

Reported by: Mauricio Collares <mauricio <at> collares.org>

Date: Thu, 14 Jan 2021 02:53:02 UTC

Severity: normal

Found in version 28.0.50

Done: Andrea Corallo <akrl <at> sdf.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 45854 <at> debbugs.gnu.org (full text, mbox):

From: Mauricio Collares <mauricio <at> collares.org>
To: 45854 <at> debbugs.gnu.org
Subject: Re: bug#45854: 28.0.50; [feature/native-comp] autoload behavior
 different in the presence of errors
Date: Thu, 14 Jan 2021 09:01:18 -0300
This might be slightly off-topic (in the sense that the previous message
stands alone and is not corrected by this one) but I have a related
question to ask about the actual error I was hitting. To reproduce the
error, one can use git-commitx.el and elpa2nix.el from the previous
email and the following transientx.el file:

;;; transientx.el --- x -*- lexical-binding: t; -*-

;; Package-Requires: ((emacs "25.1"))
;; Package-Version: 0

(require 'cl-lib)
(require 'eieio)

(defclass transient-suffix () ())
(cl-defmethod transient--init-suffix-key ((obj transient-suffix)))

(advice-add 'top-level :before 'identity)

(provide 'transientx)

;;; transientx.el ends here

That is, the "provide" line is uncommented but there's now an advice-add
call. Running the following commands causes a problem similar to the one
in the previous message:

$ --batch -Q -l ~/elpa2nix.el -f elpa2nix-install-package /home/collares/transientx.el 
$ --batch -Q --eval "(setq comp-eln-load-path '())" -l ~/elpa2nix.el -f elpa2nix-install-package /home/collares/git-commitx.el 

git-commitx.el:6:1: Error: Cannot find suitable directory for output in ‘comp-eln-load-path’
Done (Total of 0 files compiled, 1 failed, 2 skipped)
Debugger entered--Lisp error: (error "transient--init-suffix-key is already defined as s...")
  error("%s is already defined as something else than a gen..." transient--init-suffix-key)
  cl-generic-ensure-function(transient--init-suffix-key)

Apparently, advice-add caused native compilation to happen, and that
failed because comp-eln-load-path was empty. This error plays a role
similar to the lack of "(provide 'transientx)" in the previous email,
leading to the second error which does not happen in trunk.

In this email, however, I would like to address the first error. My
question is: Is it possible to disable the native compilation caused by
advice-add in the above example? In Nix we run batch-native-compile
separately after installing the package, and comp-eln-load-path is not
set up until that point, so an option to disable all native compilation
for a single batch session would be helpful. I tried setting
comp-deferred-compilation and comp-enable-subr-trampolines to nil but
still got the "Cannot find suitable directory for output in
‘comp-eln-load-path’" error with an empty comp-eln-load-path.

Best,
Mauricio




This bug report was last modified 4 years and 109 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.