Straight.el: Breaks eval-after-load with string argument

Created on 24 Aug 2020  Â·  10Comments  Â·  Source: raxod502/straight.el

What's wrong

While using straight.el, eval-after-load with string argument does not get called.

Directions to reproduce

init.el

;;; bootstrap straight.el
;;; .......

(eval-after-load "evil" '(progn (message "loaded evil string")))
(eval-after-load 'evil '(progn (message "loaded evil symbol")))

(straight-use-package 'evil)
(require 'evil)
(evil-mode t)

expected behavior

Both "loaded evil string" and "loaded evil symbol" should be printed.

actual behavior

Only "loaded evil symbol" is printed.

Without straight.el

(eval-after-load "evil" '(progn (message "loaded evil string")))
(eval-after-load 'evil '(progn (message "loaded evil symbol")))

(add-to-list 'load-path "~/.emacs.d/evil/")
(require 'evil)
(evil-mode t)

This would produce the expected behavior

Version information

  • Emacs version: 28 native-comp branch
  • Operating system: linux
bug compatibility native compilation

All 10 comments

Your example works for me:

Bootstrapping straight.el...done                                                                                                                                                                                   
Rebuilding all packages due to build cache schema change                                                                                                                                                           
Looking for gnu-elpa-mirror recipe → Cloning melpa...done                                                                                                                                                          
Looking for emacsmirror-mirror recipe → Cloning gnu-elpa-mirror...done                                                                                                                                             
Looking for straight recipe → Cloning emacsmirror-mirror...done                                                                                                                                                    
Building straight...done                                                                                                                                                                                           
Cloning evil...done                                                                                                                                                                                                
Building evil...                                                                                                                                                                                                   
Building evil → Cloning undo-tree...done                                                                                                                                                                           
Building evil → Building undo-tree...done                                                                                                                                                                          
Building evil → Cloning goto-chg...done                                                                                                                                                                            
Building evil → Building goto-chg...done                                                                                                                                                                           
Building evil...done                                                                                                                                                                                               
loaded evil string                                                                                                                                                                                                 
loaded evil symbol                                                                                                                                                                                                 
For information about GNU Emacs and the GNU system, type C-h C-a.                                                                                                                                                  

Running GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.21, cairo version 1.17.3) of 2020-08-10 on Manjaro Linux.

Yes I just found that it works in the first launch. But not on the second launch. Also, removing build-cache.el seems help.

On second launch, I get:

loaded evil string
loaded evil symbol
For information about GNU Emacs and the GNU system, type C-h C-a.

Did you get unlucky and get a temporary regression in the commit of Emacs master that you built?

That's odd. Thanks for your response, I'll check another version of emacs when I get time.

It seems that it only happens in native-comp branch of emacs.

Can you reproduce the error without straight.el by adding Evil to the load-path and manually invoking the native compiler?

No. I cannot reproduce this with (native-compile-async "~/.emacs.d/evil/" 'recursively 'late) without straight.el.

Also, with straight.el, setting straight-disable-native-compilation and/or straight-disable-byte-compilation does not make a difference.

However, setting straight-disable-native-compilation to t and straight-cache-autoloads to nil fixes this.


Maybe not directly related: according to https://akrl.sdf.org/gccemacs.html#orgd0c37e9, explicitly calling native compilation seems not required anymore.

setting straight-disable-native-compilation and/or straight-disable-byte-compilation does not make a difference

See #569.

setting both straight-disable-native-compilation and straight-cache-autoloads to t

That is distinctly horrifying, as straight-cache-autoloads has a non-nil value by default.

@raxod502 So sorry, typo, I meant setting straight-cache-autoloads to nil. Last comment was editted.

This issue is resolved after upgrading emacs-native-comp from 28.0.50.143324 to 28.0.50.144078 (both from archlinux AUR). So I may have indeed get unlucky and get a temporary regression from emacs master :joy: I'm closing this issue now, thanks again for your help.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

raxod502 picture raxod502  Â·  3Comments

rsbowman picture rsbowman  Â·  3Comments

progfolio picture progfolio  Â·  3Comments

dertuxmalwieder picture dertuxmalwieder  Â·  3Comments

aspiers picture aspiers  Â·  4Comments