-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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: add option to build with system library #16679
Conversation
Add the same for acr |
Awesome! So quick!! Is there already a distro that ships tree-sitter as system library where I can try this PR? |
Yes.
|
Not sure if it works with your package, but just with the tree-sitter.pc file provided by upstream, meson fails because it cannot find |
No, I can reproduce. |
It works fine if you just define it outside the if. diff --git a/shlr/meson.build b/shlr/meson.build
index b36680531..bde5cc28b 100644
--- a/shlr/meson.build
+++ b/shlr/meson.build
@@ -233,6 +233,7 @@ sdb_gen_cmd = [
]
# handle tree-sitter
+tree_sitter_inc = []
tree_sitter_dep = dependency('tree-sitter', required: false)
if not tree_sitter_dep.found() or not get_option('use_sys_tree_sitter')
message('Use bundled tree-sitter') |
As of tree-sitter/tree-sitter#602 it is possible to install tree-sitter as a system shared library, and distros want to be able to disable vendored code.
@FFY00 This would be wrong and result in empty includes, which relies on the tree-sitter includedir being /usr/include as that is already available for other reasons. I used a partial_dependency instead, and bumped the minimum meson version due to a warning that sounds like we might be affected by (for partial_dependency on a declare_dependency result). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM! It seems to work on ubuntu where I tested, let's just wait for CI and then we can merge.
You are right, I should have gotten |
This (configure.acr I assume?) seems to be a custom grammar for configure scripts, and I'm not entirely sure how this will normally toggle between system and vendored deps. e.g. autotools would do PKG_CHECK_MODULES() and define TREE_SITTER_CFLAGS and TREE_SITTER_LIBS, and if you don't find the module, you'd define those variables some other way. I'm not sure I follow how to override |
@eli-schwartz I can actually do the acr part, don't worry... I understand nobody uses/know acr :) (I'm not very familiar with either and I try to stay away from it eheh) |
Just for the record - |
As of tree-sitter/tree-sitter#602 it is possible to install tree-sitter as a system shared library, and distributions that want to be able to disable vendored code.
As of tree-sitter/tree-sitter#602 it is possible to install tree-sitter as a system shared library, and distros want to be able to disable vendored code.
/cc @anthraxx @FFY00 @SantiagoTorres (who want this for packaging radare2 on Arch Linux)
Your checklist for this pull request