I recently had a problem that took some time to debug.
When running elinter locally, I had an emacs backup file in my .recipes directory:
[nix-shell:~/elisp/foo]$ ls .recipes/
foo foo~
This was picked up when running elinter:
Looking for recipes in .recipes...
Found .recipes/foo .recipes/foo~
Linking package source files...
Reusing the previous settings for foo:
foo.el
error: list index 0 is out of bounds, at /nix/store/d5hxq1xqrl93f7si3hrksikvzkdh1q2b-elinter-share/share/elinter/nix/copySource.nix:35:16
(use '--show-trace' to show detailed location information)
The foo~ recipe pointed to a non-existent source file.
The copySource.nix expression takes the head of the source files, aborting with the above out of bounds error if there are no source files:
head (filter isMainFile sourceFiles)
This took me a while to debug - I didn't realize that the error was thrown when processing the foo~ recipe
What do you think about adding a per-recipe logging statement?
This PR prints:
Linking package source files for recipe .recipes/foo~ ...
error: evaluation aborted with the following error message: 'Main elisp file not found for recipe /home/zainab/elisp/foo/.recipes/foo~.'
(use '--show-trace' to show detailed location information)
I'm marking this as a WIP while I figure out what's wrong with my nixpkgs-fmt hook. I assume that the hook shouldn't have reformatted the entire copySources.nix file.
Thank you for an excellent tool!
I recently had a problem that took some time to debug.
When running elinter locally, I had an emacs backup file in my
.recipes
directory:This was picked up when running elinter:
The
foo~
recipe pointed to a non-existent source file.The
copySource.nix
expression takes the head of the source files, aborting with the above out of bounds error if there are no source files:This took me a while to debug - I didn't realize that the error was thrown when processing the
foo~
recipeWhat do you think about adding a per-recipe logging statement?
This PR prints:
I'm marking this as a WIP while I figure out what's wrong with my
nixpkgs-fmt
hook. I assume that the hook shouldn't have reformatted the entirecopySources.nix
file.