-
-
Notifications
You must be signed in to change notification settings - Fork 577
fix(gazelle): Use dougthor42's go-tree-sitter
via replace
instead of modifying names
#2667
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
base: main
Are you sure you want to change the base?
fix(gazelle): Use dougthor42's go-tree-sitter
via replace
instead of modifying names
#2667
Conversation
That looks right, but the CI error seems to be the "fatal error: ../array.h: No such file or directory" error which required the custom BUILD files? Yet only bzlmod is failing? :/ |
The issue is that go.mod
So while the |
So this solution won't work? There must be another way to do this other then today's solution 😢 |
@dougthor42 how about adding to the default_gazelle_overrides.bzl. I've never investigated it before so I'm not entirely sure if that's right, and it seems to be in a "bzlmod" directory. Can we just contribute to that file to get gazelle properly generating BUILDs for |
As is, no it will not work 😞
Option 1: Split brainGiven that the WORKSPACE stuff in this PR seems to work, I think our next step is to raise bazelbuild/bazel-central-registry#3366 from the dead
@aignas @rickeylev thoughts on this approach? Option 2: Fix Gazelle itselfBasically get upstream Gazelle to fix bazel-contrib/bazel-gazelle#2059. There's got to be a way to have Gazelle generate the correct code for C code that has an up-level import like is used in go-tree-sitter https://github.com/smacker/go-tree-sitter/blob/dd81d9e9be82a8cac96ed1d50c7389c5f1997c02/python/scanner.c#L1: #include "../array.h" However, this sort of fix is outside of my wheelhouse. |
I think option 2 is the right fix here. Let's see what the maintainers have to say. If option 2 is not possible, then option 1 is OK for the time being. |
I was wondering if a set of gazelle directives could possibly fix this issue, to generate the correct files. I don't know the actual bug well enough to understand though, I've always just patched it 🤷 |
Fixes #2630.
In #2496 we added support for Python 3.12 syntax using the less-than-ideal method of "fork and rename everything". This turned out to be a Bad Idea ™️ for people who happened to be using
smacker/go-tree-sitter
as a direct dependency.This PR effectively reverts #2496 and replaces it with a more correct way of doing go module forking: the
replace
directive forgo.mod
.Special thanks goes out to @jbedard for raising the issue and for continuing to poke me to fix it!
If we look at #2496 plus this PR, the net diff to get Python 3.12 support is approximately1:
Footnotes
Manually generated; ignores the Python 3.12 test ↩