-
Notifications
You must be signed in to change notification settings - Fork 380
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
How use bazel-gazelle in cpp project? #910
Comments
There's no native support for C++, but you could write an extension (see https://github.com/bazelbuild/bazel-gazelle/blob/master/extend.rst). |
@roderick-liu I may be working on a C++ Gazelle extension soon, if you are interested in collaborating. |
Is it possible to get some info about any c/c++ build file generation that Google already has? I’ve seen references to an unsupported “googlify” script that you can run on code checked into third_party. I suspect a c++ extension won’t be remotely as straightforward as Go’s build system was heavily influenced by Blaze 😰 |
hi |
Some members of the Bazel team have been working on AOSP support for some time: See https://android-review.googlesource.com/q/owner:jingwen%2540google.com, https://blog.bazel.build/2020/11/12/aosp_migrating_to_bazel.html, and Bazel's undocumented native ninja rules: https://github.com/bazelbuild/bazel/tree/master/src/main/java/com/google/devtools/build/lib/bazel/rules/ninja |
Hello, I came here after seeing a recent BazelCon video, https://www.youtube.com/watch?v=ol5hwjr48Q4 where the presenters share that they added gazelle rules for c++ and hence facilitated developers' overheads in their project, which is great. I searched online but couldn't proceed further. Are there any updates on this thread, i.e. have you managed to proceed? Thanks |
Any update on C++ Support? |
@disdi @HALtheWise @roderick-liu My team is interested in the c++ extension as well. Would anyone be interested in a collaboration? If so I'll submit a new issue saying we'll (attempt to) add it |
Is there any place where I can find more about ongoing efforts on this? Gazelle for C++ would be great. If anyone already started working on it I'd love to take look. |
hey alberto our team actually went ahead and created a decent mvp for c++, Going to start working with my company to OSS the solution - we've gotten pretty efficient so it shouldn't take long |
Hey @pieknik can you publish your MVP somewhere ? I would be curious to see if/how it works. |
I found that video too, @nnWhisperer, and I had the same question. @pieknik have you had any luck getting the MVP open-sourced? |
Changes: - Establish a mechanism for defining external python requirements via a `requirements.in`, generating updates to a lock file with `bazel run //:requirements.update` - Configure gazelle python and protobufs - Configures via gazelle directives to use a file based approach, stick with the BUILD configuration, disable go, default visibility to private and resolve py imports - Update dev_setup to install openjdk (java), tree, ranger, ag New Commands: ``` bazel run //:requirements.update bazel run //:gazelle_python_manifest.update bazel run //:gazelle ``` New Tests: ``` //:requirements_test //::gazelle_python_manifest.test ``` Notes: - One of the recurring issues I have every time I deal with updating WORKSPACE is slight incompatibilities with various repos that result in incomprehensible output errors. - stackb/rules_proto is one of the only things that seems to support what I'm looking for, and while it is getting steady contributions hasn't pubilshed a release in about a year. https://github.com/rules-proto-grpc/rules_proto_grpc. Additionally, it could be handy to look into what it would take to make my own "shitty" version of these rules to learn more about what's going on in gazelle's / bazel's internals - bzlmod migration didn't go well for me, most tutorials out there still use WORKSPACE, might be good to look into in the future / figure out how to migrate piecemeal, but bypassed this and 7.0.1 bazel upgrade for now Related Issues: - Noting the issue with requiring a gazelle directive for proto libraries: bazelbuild/rules_python#1703 - bazelbuild/rules_python#1664 fixes the reason I had to "disable" my py_binary, wait for that to release and then update. I could probably patch this in, but don't quite know how 🤷 - Sounds like there's some talk around gazelle c++ bazel-contrib/bazel-gazelle#910 - I'm helping ;) bazelbuild/rules_python#1712 (doc update) References: - https://github.com/bazelbuild/bazel-gazelle - https://github.com/stackb/rules_proto - https://github.com/bazelbuild/rules_python/tree/main/gazelle Future Things to Look Into: - Setup a gazelle test that checks output of `//:gazelle -- -mode diff` is zero - Configure rust with gazelle: https://github.com/Calsign/gazelle_rust - A really cool / general parser / generator (what github uses for "semantic" tool): https://tree-sitter.github.io/tree-sitter/ Could use to make small code generator / modification? Or maybe more general utilities? - General compile command completion: https://github.com/hedronvision/bazel-compile-commands-extractor - Maybe play with https://github.com/rules-proto-grpc/rules_proto_grpc as an alternative to stackb - If I can't use gazelle for some things, mess around with https://github.com/bazelbuild/buildtools/tree/master/buildozer
@pieknik +1 :-) |
hi
It is a very useful tool in golang project. Does it been used in cpp project?
The text was updated successfully, but these errors were encountered: