Ihor Radchenko <yanta...@posteo.net> writes: > Lin Jian <m...@linj.tech> writes: > >> Currently, the .dir-locals.el file is included in the GNU ELPA >> tarball[1], which causes this compilation error[2] when doing AOT native >> compilation for Emacs lisp packages in NixOS. > > I do not see why anything is wrong on Org side. > .dir-locals.el is a perfectly valid file that may be created by users as > well. The fact that they are native-compiled is probably a bug in NixOS > or a missing feature in Emacs's native compilation (maybe it should skip > compiling dir locals automatically).
I believe it is up to the file to opt-out of compilation. If the file is created with add-dir-local-variable there is a boiler plate header inserted which opts out: ;;; Directory Local Variables -*- no-byte-compile: t -*- ;;; For more information see (info "(emacs) Directory Variables") >> We can workaround this by skipping native compilation for >> .dir-locals.el. However, I do not think .dir-locals.el has to be >> included in the GNU ELPA tarball. In addition, MELPA ignores[3] that >> file by default. >> >> Could you exclude .dir-locals.el from GNU ELPA tarball? FYI, >> :ignored-files[4] of GNU ELPA specification can be used to do this. > > Having dir locals file in the tarball can be useful for the users who > wish to edit Org mode's source code. We set a number of editing defaults > there that are employed across Org codebase. These defaults make our > life easier when users create patches by directly modifying Org mode code > they got via ELPA. > > Not a bug. > Canceled. > > I suggest you to report a bug or feature request to Emacs upstream about > native compiling .dir-locals.el. I don't think there is any upstream bug. The solution would be to add the missing header to the .dir-locals.el file. -- Morgan Willcock