Straight.el: native-compiler-error-empty-byte for every package

Created on 21 Jan 2021  路  9Comments  路  Source: raxod502/straight.el

What's wrong

Getting the following error for straight with emacs 0ffb3dfaa483b0c5cf1f7f367efcb5e9c041ab53 (I assume HEAD).

image

These errors show for any package and no settings I change seem to have an effect.

Directions to reproduce

The above screenshot is generated from emacs -Q -l straight.el with the contents of said file being:

(setq comp-deferred-compilation nil)
(setq load-prefer-newer t)
(setq straight-repository-branch "develop"
      straight-vc-git-default-clone-depth 1)
(setq straight-use-package-by-default t)
(setq straight-enable-package-integration t)
(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  ;; catch emacs updates that have native compiled leftovers
  (unless (catch 'emacs-version-changed
        (load bootstrap-file nil 'nomessage))
    (when (boundp 'comp-eln-load-path)
      ;; remove leftovers, with confirmation just to be safe
      (when (yes-or-no-p (format "Delete '%s'?" (car comp-eln-load-path)))
    (delete-directory (expand-file-name (car comp-eln-load-path)) t))
      ;; and try again
      (load bootstrap-file nil 'nomessage))))
(straight-use-package 'use-package)

Version information

  • Emacs version: 28.0.5 (commit 0ffb3dfaa483b0c5cf1f7f367efcb5e9c041ab53)
  • Operating system: Arch Linux
bug external bug native compilation

All 9 comments

Thank you for the report. If possible, please prefer text over images in the future for any Emacs output. It will give use more information and make that information searchable in the future.

I can confirm this behavior using the latest container here:
https://hub.docker.com/r/andreacorallo/emacs-nativecomp

Is this happening on every startup for you, or just after a fresh straight bootstrap?
When I tested this only happened on the startup on which straight was bootstrapped, and so
I suspect the problem is in https://github.com/raxod502/straight.el/blob/develop/bootstrap.el

Apologies, I copied my report from another source.

No just the bootstrap step, I clear out eln-cache and straight folders beforehand.

I noticed with the docker image I tested that I'm only seeing this error with
the generated autoloads files. That seems to be the case in the screenshot you shared as well.

This should prevent those files from being native compiled:

(setq comp-deferred-compilation-deny-list '("\\(?:[^z-a]*-autoloads\\.el$\\)"))

I'm not sure on the correct behavior here yet, as I do not personally use the native comp branch.
Perhaps @flatwhatson would have some insight here?

I'm also seeing this with my native-comp build. Anything I can do to help track down what might be going on?

I suspect that's what happening too but I don't know the correct behaviour. I would guess you don't want to compile the autoloads too.

Does this problem prevent any of the speedup I should expect from using the native-comp build?

This is related to an upstream "bug", compilation warnings have been made more visible: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=44746

In this case, I'd guess native-compiler-error-empty-byte is due to byte-compilation returning no output. Perhaps these autoloads fail byte-compilation, subsequently triggering a warning from native-comp? This should be reported upstream.

Adding autoloads to comp-deferred-compilation-deny-list seems like a reasonable workaround, but at this stage I don't think this is a bug in straight.el.

Happy to close this then if you're sure it's an emacs issue.

As per discussion with @flatwhatson, this isn't a straight issue so I'm closing this

Was this page helpful?
0 / 5 - 0 ratings