Hacker News new | past | comments | ask | show | jobs | submit login

I tried using Bazel a while back but immediately ran into a few issues.

The existing codebase I was working with did not lay out its dependencies and files in the manner expected by Bazel so dealing with dependency/include hell was frustrating.

Then there was a large portion of the project that depended on generated code for its interfaces (ie. similar to protobuf but slightly different) and trying to dive into the Bazel rules and toolchain with no other Bazel experience was not fun. I attempted to build off of the protobuf implementation but kept finding additional layers to the onion that didn't exactly translate to the non protobuf tooling. The project documentation seemed out of date in this area (ie. major differences in the rules engine between 1.0 and subsequent versions) and I couldn't find many examples to look at other than overly simplified toy examples.

All in all a frustrating experience. I could not even get far enough along to compile the interfaces for the project.




Did you find genrule? It’s a generic escape hatch rule that can be used to just run any program. Of course it still needs the input and output dependencies declared and you are responsible for ensuring it is hermetic.


Yes, I started out by using genrule before going down the custom rule path. I was able to properly trigger bazel to generate the interface bindings but then lost the thread when trying to properly configure the output files to act as proper dependencies to other code (ie. generate C++ headers and libraries that could then be properly listed as dependencies by client code.)

I think part of the issue was that the generated code from the 3rd party tool did not align with the Bazel expectations about code layout (ie. paths relative to WORKSPACE). Likely solvable but not in the amount of time I had available to dedicate to the effort.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: