4 ms·
Problem: There are N confusing build systems with arcane rules and you just want to compile your program. Solution: Design a simple, straightforward build tool
by taneq 7y ago
Problem: There are N confusing build systems with arcane rules and you just want to compile your program.
Solution: Design a simple, straightforward build tool.
Problem: There are N+1 confusing build systems with arcane rules.
- new_realist 7y agoI wouldn’t call Bazel confusing or arcane, but it is powerful. I find it rather delightful to use.
- mook 7y agoAs a relatively newcomer to bazel, I did find it arcane: - I couldn't find an easy way to list targets - in particular, a way to show me the path to the build artifacts (so that I could inspect it in my editor) - I couldn't find a way to do build configurations (especially intersections of build configurations) - it didn't seem great at handling non-file build steps (set up a cluster / server / whatever so I can run my tests) - the documentation was slow to load and hard to find things in (you basically had to use search, instead of browsing a good table of contents) As I said, though, I'm a newcomer; it's quite possible there are good ways to do those things, I just hadn't managed to find it in the documenting yet. That and the issues are by no means unique to bazel. I also do like some aspects of it (like enforced out-of-tree builds), but that's off-topic ;)
- joshuamorton 7y agoConfigs: look into select() and modes. Non-file steps: normally in bazel you would consider the server setup a part of the test. So `blaze build :my_test` creates an artifact, and blaze run or blaze test runs the artifact which does non-hermetic stuff like setting up a server.
- emidln 7y agoListing targets in a package: bazel query //some/package:* Listing targets in a package including subpackages: bazel query //some/package/... These and more are covered in the documentation on querying: https://docs.bazel.build/versions/1.0.0/query.html#target-patterns https://docs.bazel.build/versions/1.0.0/query.html#target-pa...
- fizwhiz 7y agoobligatory: https://xkcd.com/927/ https://xkcd.com/927/
- taneq 7y agoThat's the one!
- klodolph 7y agoI’m getting a little tired of this particular brand of lazy cynicism. I’m happy to see people inventing new build systems, programming languages, game engines, ORMs, or anything else where the conventional wisdom is to use the existing tools. It may be crazy optimistic but we need people to keep these skill sets alive.
- taeric 7y agoI agree at a personal level. If anyone is pushing a toy project, basically no reason to knock it. Reason that Serenity OS story a few days ago was awesome. However, solutions pushed by corporations with grandiose claims do strike a nerve with me. If only because they are typically pushed with the idea that they will spread through some technical superiority. I'm much more open to this getting more use strictly from who is pushing it, not what it is capable of.
- halflings 7y agoCompanies using bazel [1]: * Asana * Databricks * Dropbox * Google * Huawei * Lyft * Pinterest * Stripe * TwoSigma * Uber ... This is not a new project that needs pushing. [1] https://github.com/bazelbuild/bazel/wiki/Bazel-Users https://github.com/bazelbuild/bazel/wiki/Bazel-Users
- taeric 7y agoThis seems silly. If I was to make a similar list of companies using Make, would that have deterred building bazel? Because I guarantee the number was non-zero and included some major players.
- klodolph 7y agoIt is successful enough that it has spawned a few clones—Buck, Pants, Please.build, and the thing that Chromium uses now. From what I can tell, before Bazel was open-source, everyone who left Google wanted to use Blaze badly enough to write their own version.
- joshuamorton 7y agoBazel's goal wasn't (explicitly) to be simpler or more straightforward (though I'd argue that its restrictions do cause that in many cases). It was built to solve problems that other build systems (make-like) don't: hermeticity and reliability of builds.
- halflings 7y agoBazel is almost a standard for build systems at this point. Did you ever use it, or at least see what a bazel build rule looks like [1] before calling it arcane? [1] https://docs.bazel.build/versions/1.0.0/tutorial/cpp.html#understand-the-build-file https://docs.bazel.build/versions/1.0.0/tutorial/cpp.html#un...
- alrs 7y agoBazel has yet to even land in Debian, it's some years short of being the standard.
- pja 7y agoBuild rules for bazel are straightforward when you’re on the happy path & trying to do something that bazel already understands. It’s when you’re not on the happy path that things get awkward. E.g. How easy is it to integrate a new C++ compiler into bazel? (and I don’t just mean what you get by changing CC to point somewhere else. I want the full integration with the bazel build system in order to get those hermetic builds that are the whole point of using bazel in the first place). How easy is it to build things which are not in the set of blessed languages? What if I have a Haskell component? Can I easily integrate that into my bazel build? Last time I tried the answer was definitely not. If you can use the pre-defined BUILD rules then bazel is pretty great. If you can’t and have to start wading into the weeds of bazel’s hinterland then it rapidly stops being so. If you’re inside Google, then you’re probably fine because a blaze/bazel engineer is ultimately only an email away. For the rest of us outside the Googleplex, extending bazel is an extended exercise in frustration in my experience.
- ondrasej 7y agoThere's genrule() which basically runs a shell script. With that, you can build anything for which you can write a command-line. And you can go as far as invoke a binary that is built by another bazel rule. You can also define your own rules in a subset of Python (by wrapping other rules including genrule()), so adding new languages should be simple enough.
- 7y ago
- paulddraper 7y agoThat's not really the problem Bazel is trying to solve. Yes, a big design requirement is to be polyglot, but if that's all you want, Make has been around thirty years. Bazel attempts to solve the problem of performance and correctness in large codebases. Most build tools do not scale well.
- trimbo 7y agoExcept half of the N were Xooglers implementing their own clone of Blaze.