Two possible bugs in doom-packages involving the eln cache path, and its .error files #153
Unanswered
egorelik93
asked this question in
Issues
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I confirm that...
I searched the FAQ, issue tracker, discussions board, documentation, and wiki, and found nothing about my issue.
I read the debugging guide and researched the issue to the best of my ability.
My issue can be observed on the latest available commit of Doom.
My issue can be observed on a stable release of Emacs (i.e. doesn't end in
.50,.60, or.9*)Describe your issue
While debugging some behavior in doom sync, I noted that the log created by DEBUG=1 is filled with hundreds of lines like this:
Now I'm not sure why there would be an error from nativecomp (many, but not all, are autoload files), but that is a separate matter. I thought that this path looked strange in two regards - the first because it is trying to write .error into its own directory, and reporting it cannot. That location is not read-only in any of my installations. I got the same general behavior on my WSL installation - with a slight difference in path, which relates to the second issue.
The thing about this path is the
.emacs.dis not actually the right directory in the first place; on WSL I am using chemacs, and my doom install is in ~/.doom-emacs.d. And that made me realize that in both cases, it is trying to write the error file into into .emacs.d/eln-cache rather than the actual eln cache doom uses.So I did some digging into doom-packages. Right now the code to get the path for these
.errorfiles usesfile-name-concat, which turns every component into its own path segment. It looks like it has been that way for a few years, but when I followed the git blame trail, it seems to be a change from the prior behavior, which would have just written something likeorderless-e52222e0-81543c69.eln.errorwithout a subdirectory. I do not know if this by design. However, a somewhat later change to doom-packages put in a check for whether the parent directory of the error file is writeable - and that is what is technically responsible for the log. The problem is that parent directory almost certainly does not exist (in theory it may even be a file, though I have not seen that happen). In my testing, whilefile-writable-pis fine with files that do not exist, if given a directory that does not exist (as determined by ending in a slash), it will always return nil. So, the combination offile-name-concatandfile-writable-pseems to cause error files to never be written. I don't entirely understand how the error files get used, so it is unclear to me if this harms anything or is just polluting the logs.On the matter of the eln cache location, I looked into that as well. doom.el does set
native-comp-eln-load-pathto the right path. But before that, doom.el in noninteractive mode requires doom-cli. And doom-cli requires doom-packages, which immediately setsdoom-packages--eln-output-pathusingnative-comp-eln-load-pathbefore it gets the fixed value, and never gets updated. I am unsure if this intended.Neither of these seem to cause issues in emacs itself. I suspect, but have been unable to determine one way or the other, that the eln cache issue may play a part in why my WSL/chemacs install (but not my Windows install) seems to insist on JIT-compiling on startup even immediately after a
doom sync --rebuild --aot. But they do not technically break anything, and in any case I can work around them.Steps to reproduce
DEBUG=1 doom sync --aot --rebuildSystem information
https://pastebin.com/eHqfFv15
All reactions