* bug#27340: 26.0.50; byte-compile-delete-errors value changes unexpectedly
@ 2017-06-12 10:30 Katsumi Yamaoka
2017-06-12 11:12 ` npostavs
0 siblings, 1 reply; 6+ messages in thread
From: Katsumi Yamaoka @ 2017-06-12 10:30 UTC (permalink / raw)
To: 27340
Hi,
When loading a certain Lisp module that requires eieio, the value
of `byte-compile-delete-errors' is changed to t (the default nil)
unexpectedly. For instance:
emacs -batch -Q -l auth-source -eval '(message "%s" byte-compile-delete-errors)'
=> t
Because of this, the byte compiler gets oddly quiet when compiling
a Lisp source on a running Emacs than `batch-byte-compile'. What
changes the value of `byte-compile-delete-errors' is the following
section of eieio-core.el:
--8<---------------cut here---------------start------------->8---
(cl-defstruct (eieio--class
(:constructor nil)
(:constructor eieio--class-make (name))
(:include cl--class)
(:copier nil))
children
initarg-tuples ;; initarg tuples list
(class-slots nil :type eieio--slot)
class-allocation-values ;; class allocated value vector
default-object-cache ;; what a newly created object would look like.
; This will speed up instantiation time as
; only a `copy-sequence' will be needed, instead of
; looping over all the values and setting them from
; the default.
options ;; storage location of tagged class option
; Stored outright without modifications or stripping
)
--8<---------------cut here---------------end--------------->8---
Though I don't know why it changes `byte-compile-delete-errors',
I think it's a bug.
Thanks.
In GNU Emacs 26.0.50 (build 1, i686-pc-cygwin, GTK+ Version 3.18.9)
of 2017-06-12 built on localhost
Windowing system distributor 'The Cygwin/X Project', version 11.0.11900000
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#27340: 26.0.50; byte-compile-delete-errors value changes unexpectedly
2017-06-12 10:30 bug#27340: 26.0.50; byte-compile-delete-errors value changes unexpectedly Katsumi Yamaoka
@ 2017-06-12 11:12 ` npostavs
2017-06-15 8:49 ` Katsumi Yamaoka
0 siblings, 1 reply; 6+ messages in thread
From: npostavs @ 2017-06-12 11:12 UTC (permalink / raw)
To: Katsumi Yamaoka; +Cc: 27340
found 27340 25.2
tags 27340 + confirmed
quit
Katsumi Yamaoka <yamaoka@jpl.org> writes:
> When loading a certain Lisp module that requires eieio, the value
> of `byte-compile-delete-errors' is changed to t (the default nil)
> unexpectedly.
[...]
> Though I don't know why it changes `byte-compile-delete-errors',
> I think it's a bug.
It's because of the 'cl-declaim' around that 'cl-defstruct':
(progn
;; Arrange for field access not to bother checking if the access is indeed
;; made to an eieio--class object.
(cl-declaim (optimize (safety 0)))
(cl-defstruct (eieio--class
...
)
;; Set it back to the default value.
(cl-declaim (optimize (safety 1))))
The problem is that the default (safety 1) value is not default with
respect to byte-compile-delete-errors:
(defun cl--do-proclaim (spec hist)
...
(let (...
(safety (assq (nth 1 (assq 'safety (cdr spec)))
'((0 t) (1 t) (2 t) (3 nil)))))
...
(if safety (setq cl--optimize-safety (car safety)
byte-compile-delete-errors (nth 1 safety)))))
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#27340: 26.0.50; byte-compile-delete-errors value changes unexpectedly
2017-06-12 11:12 ` npostavs
@ 2017-06-15 8:49 ` Katsumi Yamaoka
2017-06-16 11:37 ` npostavs
0 siblings, 1 reply; 6+ messages in thread
From: Katsumi Yamaoka @ 2017-06-15 8:49 UTC (permalink / raw)
To: npostavs; +Cc: 27340
On Mon, 12 Jun 2017 07:12:24 -0400, npostavs@users.sourceforge.net wrote:
> It's because of the 'cl-declaim' around that 'cl-defstruct':
> (progn
> ;; Arrange for field access not to bother checking if the access is indeed
> ;; made to an eieio--class object.
> (cl-declaim (optimize (safety 0)))
> (cl-defstruct (eieio--class
> ...
> )
> ;; Set it back to the default value.
> (cl-declaim (optimize (safety 1))))
> The problem is that the default (safety 1) value is not default with
> respect to byte-compile-delete-errors:
I see both (cl-declaim..) forms set `byte-compile-delete-errors'
to t. Thanks. Then I tried this:
--8<---------------cut here---------------start------------->8---
--- eieio-core.el~ 2017-04-19 22:03:44.676418700 +0000
+++ eieio-core.el 2017-06-15 08:46:36.995604500 +0000
@@ -82,5 +82,7 @@
(defvar eieio-default-superclass nil)
-(progn
+(require 'bytecomp)
+(require 'cl-macs)
+(let ((byte-compile-delete-errors byte-compile-delete-errors))
;; Arrange for field access not to bother checking if the access is indeed
;; made to an eieio--class object.
--8<---------------cut here---------------end--------------->8---
This solves the problem, though I'm not sure it is the right way.
Loading bytecomp is necessary for `byte-compile-delete-errors',
and cl-macs is necessary not to defer performing cl-declaim,
i.e., to perform cl-declaim while `byte-compile-delete-errors'
is let-bound.
Regards,
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#27340: 26.0.50; byte-compile-delete-errors value changes unexpectedly
2017-06-15 8:49 ` Katsumi Yamaoka
@ 2017-06-16 11:37 ` npostavs
2017-06-19 9:23 ` Katsumi Yamaoka
0 siblings, 1 reply; 6+ messages in thread
From: npostavs @ 2017-06-16 11:37 UTC (permalink / raw)
To: Katsumi Yamaoka; +Cc: 27340
Katsumi Yamaoka <yamaoka@jpl.org> writes:
> -(progn
> +(require 'bytecomp)
> +(require 'cl-macs)
> +(let ((byte-compile-delete-errors byte-compile-delete-errors))
> ;; Arrange for field access not to bother checking if the access is indeed
> ;; made to an eieio--class object.
>
> This solves the problem, though I'm not sure it is the right way.
> Loading bytecomp is necessary for `byte-compile-delete-errors',
> and cl-macs is necessary not to defer performing cl-declaim,
> i.e., to perform cl-declaim while `byte-compile-delete-errors'
> is let-bound.
Another possibility is to put `cl-declaim's in (eval-when-compile ...),
this stops them having effect when loading eieieo-core.elc (the process
compiling eieio-core.el would still be affected, but since that is
usually a batch Emacs spawned by make, it doesn't really matter).
--- i/lisp/emacs-lisp/eieio-core.el
+++ w/lisp/emacs-lisp/eieio-core.el
@@ -84,7 +84,7 @@ (defvar eieio-default-superclass nil)
(progn
;; Arrange for field access not to bother checking if the access is indeed
;; made to an eieio--class object.
- (cl-declaim (optimize (safety 0)))
+ (eval-when-compile (cl-declaim (optimize (safety 0))))
(cl-defstruct (eieio--class
(:constructor nil)
@@ -104,7 +104,7 @@ (cl-defstruct (eieio--class
; Stored outright without modifications or stripping
)
;; Set it back to the default value.
- (cl-declaim (optimize (safety 1))))
+ (eval-when-compile (cl-declaim (optimize (safety 1)))))
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#27340: 26.0.50; byte-compile-delete-errors value changes unexpectedly
2017-06-16 11:37 ` npostavs
@ 2017-06-19 9:23 ` Katsumi Yamaoka
2017-06-24 14:19 ` npostavs
0 siblings, 1 reply; 6+ messages in thread
From: Katsumi Yamaoka @ 2017-06-19 9:23 UTC (permalink / raw)
To: npostavs; +Cc: 27340
On Fri, 16 Jun 2017 07:37:46 -0400, npostavs@users.sourceforge.net wrote:
> Another possibility is to put `cl-declaim's in (eval-when-compile ...),
> this stops them having effect when loading eieieo-core.elc (the process
> compiling eieio-core.el would still be affected, but since that is
> usually a batch Emacs spawned by make, it doesn't really matter).
At the moment I think this is the best solution. Thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#27340: 26.0.50; byte-compile-delete-errors value changes unexpectedly
2017-06-19 9:23 ` Katsumi Yamaoka
@ 2017-06-24 14:19 ` npostavs
0 siblings, 0 replies; 6+ messages in thread
From: npostavs @ 2017-06-24 14:19 UTC (permalink / raw)
To: Katsumi Yamaoka; +Cc: 27340
tags 27340 fixed
close 27340 26.1
quit
Katsumi Yamaoka <yamaoka@jpl.org> writes:
> On Fri, 16 Jun 2017 07:37:46 -0400, npostavs@users.sourceforge.net wrote:
>> Another possibility is to put `cl-declaim's in (eval-when-compile ...),
>> this stops them having effect when loading eieieo-core.elc (the process
>> compiling eieio-core.el would still be affected, but since that is
>> usually a batch Emacs spawned by make, it doesn't really matter).
>
> At the moment I think this is the best solution. Thanks.
I pushed it to master [1: c75eb1030f].
[1: c75eb1030f]: 2017-06-24 10:12:53 -0400
Don't change byte-compile-delete-errors at runtime (Bug#27340)
http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=c75eb1030fbb606765cc8a5e5ecbab4a9cf435ed
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-06-24 14:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-12 10:30 bug#27340: 26.0.50; byte-compile-delete-errors value changes unexpectedly Katsumi Yamaoka
2017-06-12 11:12 ` npostavs
2017-06-15 8:49 ` Katsumi Yamaoka
2017-06-16 11:37 ` npostavs
2017-06-19 9:23 ` Katsumi Yamaoka
2017-06-24 14:19 ` npostavs
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).