From 05d1238642a4e58c9eef41d7422f18bf1bb4dae1 Mon Sep 17 00:00:00 2001 From: Lin Jian Date: Mon, 16 Sep 2024 09:06:10 +0800 Subject: [PATCH] emacs: do not do native compilation for .dir-locals.el This file is not a valid Emacs lisp file. Some packages, such as auctex, el-get, helm and org, include this file without using no-byte-compile in file-local variables to skip native compilation, causing native compilation error like this: Wrong type argument: "/nix/store/-emacs-org-9.7.10/share/emacs/site-lisp/elpa/org-9.7.10/.dir-locals.el", proper-list-p, (# . 0) Some[1,2,3] of them decide to exclude this file. Org includes this file intendedly[4] but may add no-byte-compile to file-local variables. Hopefully, newer versions of them do not have this error. However, to support old versions of them and potentially other new packages with this problem, let's filter out this file in Nixpkgs. [1]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=73215 [2]: https://github.com/melpa/melpa/pull/9164 [3]: https://github.com/melpa/melpa/pull/9165 [4]: https://lists.gnu.org/archive/html/emacs-orgmode/2024-09/msg00179.html --- pkgs/applications/editors/emacs/build-support/generic.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/editors/emacs/build-support/generic.nix b/pkgs/applications/editors/emacs/build-support/generic.nix index 3ff10ee865fb..d22e6495c1d2 100644 --- a/pkgs/applications/editors/emacs/build-support/generic.nix +++ b/pkgs/applications/editors/emacs/build-support/generic.nix @@ -86,7 +86,7 @@ libBuildHelper.extendMkDerivation' stdenv.mkDerivation (finalAttrs: source ${./emacs-funcs.sh} addEmacsVars "$out" - find $out/share/emacs -type f -name '*.el' -print0 \ + find $out/share/emacs -type f -name '*.el' -not -name ".dir-locals.el" -print0 \ | xargs --verbose -0 -I {} -n 1 -P $NIX_BUILD_CORES sh -c \ "emacs \ --batch \