elisp-tree-sitter
elisp-tree-sitter copied to clipboard
Process running from dynamic link
If I have tree-sitter running with dynamic link file (dll) then I am not able to upgrade tree-sitter-langs package.
Steps of reproduce
- Open any file with
tree-sittersupport (ensure there is process running with dll file) package-list-packages, and try to remove packagetree-sitter-langs
Then you should get an error with process running, not able to delete package, etc.
Environments
- OS: Windows 10 x64
- Emacs version: 27.1
Windows seems to disallow deleting loaded dll files.
I'm not familiar enough with Windows to fix this, or to suggest workarounds.
I think you can customize tree-sitter-langs-grammar-dir for that. So the langs dll is stored outside of package and will not be delete when upgrading.
(use-package tree-sitter-langs
:ensure t
:defer t
:custom
(tree-sitter-langs-grammar-dir (expand-file-name ".cache/tree-sitter-langs/" user-emacs-directory)))
In Windows, loaded dll cannot be deleted online but can be moved and marked to delete next time PC reboot.
Perhaps package.el should use that, i.e, move loaded dll file to $TEMP and mark it as delete on reboot, then we can cleanly upgrade package on Windows without worry about file deletion error.