Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zero byte sized *.eln files #3

Closed
jimeh opened this issue Aug 20, 2020 · 2 comments
Closed

Zero byte sized *.eln files #3

jimeh opened this issue Aug 20, 2020 · 2 comments

Comments

@jimeh
Copy link
Owner

jimeh commented Aug 20, 2020

Sometimes when quitting Emacs while native compilation is running, it will leave
one or more *.eln files behind with a size of zero bytes. These files will
prevent Emacs from launching until they're deleted either manually, or via the
suggested configuration snippet above in the Configuration section.

Currently I work around this issue by finding and deleting any *.eln files in
my eln-cache directory at startup, along with also setting a custom eln-cache
directory:

(when (boundp 'comp-eln-load-path)
  (let ((eln-cache-dir (expand-file-name "cache/eln-cache/"
                                         user-emacs-directory))
        (find-exec (executable-find "find")))
    (setcar comp-eln-load-path eln-cache-dir)
    ;; Quitting emacs while native compilation in progress can leave zero byte
    ;; sized *.eln files behind. Hence delete such files during startup.
    (when find-exec
      (call-process find-exec nil nil nil eln-cache-dir
                    "-name" "*.eln" "-size" "0" "-delete" "-or"
                    "-name" "*.eln.tmp" "-size" "0" "-delete"))))
@jimeh jimeh changed the title Zero byte sized *.eln files Zero byte sized *.eln files Aug 20, 2020
@jimeh jimeh added the bug label Aug 20, 2020
@jimeh
Copy link
Owner Author

jimeh commented Sep 20, 2020

Recent builds seem to create zero-sized *.eln.tmp files instead of *.eln files, meaning their existence do no prevent Emacs from starting. But they can still get left behind in some situations, so I've updated the config snippet to trash both *.eln and *.eln.tmp files with a size of zero bytes.

jimeh added a commit that referenced this issue Sep 22, 2020
Recent builds seem to pre-allocate empty `*.eln.tmp` files rather than
empty `*.eln` files. So the issue of empty `*.eln` files preventing
Emacs from starting should no longer be an issue.

I'm leaving #3 open for now, in case anyone is using older git SHAs from
the list of known good commits in #6.
@jimeh
Copy link
Owner Author

jimeh commented Nov 27, 2021

I believe that this is not really an issue at all anymore, so I'm closing this issue.

@jimeh jimeh closed this as completed Nov 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant