extensions: Don't recompile Tree-sitter parsers when up-to-date (#43442)

When installing local "dev" extensions that provide tree-sitter
grammars, compiling the parser can be quite intensive[^anecdote]. This
PR changes the logic to only compile the parser if the WASM object
doesn't exist or the source files are newer than the object (just like
`make(1)` would do).

[^anecdote]: The tree-sitter parser for LLVM IR takes >10 minutes to
compile and uses 20 GB of memory on my laptop.

Release Notes:

- N/A

---------

Co-authored-by: Finn Evers <finn.evers@outlook.de>
This commit is contained in:
Kian Kasad
2025-12-08 13:48:04 +00:00
committed by GitHub
co-authored by Finn Evers
parent 7ef45914e8
commit e6214b2b71
3 changed files with 97 additions and 19 deletions
Generated
+1
View File
@@ -5809,6 +5809,7 @@ dependencies = [
"serde",
"serde_json",
"task",
"tempfile",
"toml 0.8.23",
"url",
"util",