Skip to content

feat(cli): concurrent builds of the same grammar on different locations on disk#5174

Merged
WillLillis merged 3 commits intotree-sitter:masterfrom
stackmystack:concurrent
Dec 29, 2025
Merged

feat(cli): concurrent builds of the same grammar on different locations on disk#5174
WillLillis merged 3 commits intotree-sitter:masterfrom
stackmystack:concurrent

Conversation

@stackmystack
Copy link
Contributor

@stackmystack stackmystack commented Dec 26, 2025

Hello,

The test suite of tsdl runs many builds of the same grammars (same name ofc) in parallel, and the tests were flaky, which required me to put a --retries 2 defensively, and it's not always guaranteed to work.

I skimmed through the cli, and I figured there shouldn't be a reason to disallow concurrent builds like this.

So I did the fix, and it works for me now.

The choices I made with the hashing and lock file names are ofc arbitrary :)

Copy link
Member

@WillLillis WillLillis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for digging into this! I have a few suggestions/questions.

@stackmystack
Copy link
Contributor Author

But on a more general note, I am not quite sure why the locking is necessary: to protect output path or the parser path ? If the former, then this PR addresses it, but if it's the latter, shouldn't we hash config.parser_path ?

@WillLillis
Copy link
Member

But on a more general note, I am not quite sure why the locking is necessary: to protect output path or the parser path ? If the former, then this PR addresses it, but if it's the latter, shouldn't we hash config.parser_path ?

My understanding is that the locking is protecting the output path. This PR addresses that issue and (presumably) fixes the problem you were running into with tsdl, so I think it's good as is :)

Instead of panicking somehere else.

This happens on concurrent builds of the the same grammar.
Copy link
Member

@WillLillis WillLillis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@WillLillis WillLillis merged commit 5d9605a into tree-sitter:master Dec 29, 2025
19 checks passed
@tree-sitter-ci-bot
Copy link

Successfully created backport PR for release-0.26:

stackmystack added a commit to stackmystack/tsdl that referenced this pull request Feb 19, 2026
My PR fixed the flakiness issue, so it's time to be strict

tree-sitter/tree-sitter#5174
stackmystack added a commit to stackmystack/tsdl that referenced this pull request Feb 20, 2026
My PR fixed the flakiness issue, so it's time to be strict

tree-sitter/tree-sitter#5174
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants