by duality · 9y ago · 0 comments
Nor does Bazel use C++ syntax to describe the build, instead using a variant of Python called Skylark, but this feels (to me) much less onerous to pick up than the custom scripting language CMake uses.
Bazel also provides a notion of visibility of dependencies that allow you in effect to control which build targets are exposed to other targets as allowed dependencies. And allows the build tool to specify a toolchain (compiler, linker, etc.) and machine architecture. This information is used when building all the dependencies, which in effect satisfies the author's request for compatibility between packages. You might even argue that a (caching) build from source may be better than attempting to serve prebuilt binaries.
Getting up to speed can take a little doing though as the original docs weren't great and there are some counter intuitive things about it. I think the docs are improving but some things a little odd like everything gets dumped into ~/.cache/bazel without any command line option to change [1]. Feels like the first time I used git where you suspect that the authors designed it to be difficult to keep the lazy away.
https://docs.bazel.build/versions/master/output_directories....
You can also specify a toolchain, have custom actions for asset or code generation, etc..
GN itself is in C++, unlike the older build system for chrome 'GYP', and it produces a binary tool, that can process meta build file with a syntax very similar to Bazel.
https://chromium.googlesource.com/chromium/src/tools/gn/
https://chromium.googlesource.com/chromium/src/+/lkgr/tools/...
Would you use it for an open source project? It feels onerous to ask users and contributors to install a moderately esoteric build tool (which in turn requires Java) to build a C++ project.