-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tree-sitter: Move dynamic libraries for grammar parsers into lib/ #230547
tree-sitter: Move dynamic libraries for grammar parsers into lib/ #230547
Conversation
The previous version of the code was creating a tree-sitter "grammars" derivation with all parser's .so file inside the top-level folder. This is unusual. Additionally, this prevents other packages from smartly referencing the parsers. For example, I would expect nix-build -E 'with import ./default.nix {}; pkgs.emacs29.pkgs.withPackages (_: [(pkgs.tree-sitter.withPlugins (p: pkgs.tree-sitter.allGrammars))])' to get an emacs-packages-deps derivation with a lib/ folder and all parser's .so files there. This would make the (add-to-list 'treesit-extra-load-path "$out/lib/") line in build-support/emacs/wrapper.nix work.
Result of |
@clhodapp do you have a working derivation to get tree-sitter .so files inside the emacs' lib/ folder? |
I do, actually. For a while, I was using the That was honestly pretty annoying because it created a LOT of rebuilding for me but it worked so I kept it for a while. However, upstream emacs eventually dropped that script from the emacs 29 development branch and when that happened, I switched to just symlinking the generated files from the existing tree-sitter grammars in nixpkgs. For that, stole from the existing code in |
Honestly the whole build infrastructure in |
@ofborg build vimPlugins.nvim-treesitter.tests |
I'm not sure about changing this in On a side note, breaking changes are now restricted: #223562 |
Description of changes
The previous version of the code was creating a tree-sitter "grammars" derivation with all parser's .so file inside the top-level folder. This is unusual.
Additionally, this prevents other packages from smartly referencing the parsers. For example, I would expect
to get an emacs-packages-deps derivation with a lib/ folder and all parser's .so files there. This would make the
line in
build-support/emacs/wrapper.nix
work.Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)