3 ms·
> In my mind, the biggest problem is that it offers you virtually no help in writing correct parallel and incremental builds. That’s interesting, because in my
by klodolph 8y ago
> In my mind, the biggest problem is that it offers you virtually no help in writing correct parallel and incremental builds.
That’s interesting, because in my mind, parallel and incremental builds are the main features of Make, the features that it is best at, and all other features are secondary.
It sounds like your problem is with the correctness part. Make gives you no tools to enforce that your build rules are actually correct. Very few build systems provide any help here. What you are looking for is hermeticity. Bazel does this by sandboxing execution of all the build rules, and only the specified rule inputs are included in the sandbox. I recommend Bazel.
Otherwise, it is up to you to get your build rules correct, and switching build systems won’t help in general (although they may help in specific cases).
I find it surprising that you talk about using Make for a clean serial build, because if you want a clean serial build, you might as well use a shell script. Make’s only real purposes are to give you tools for incremental and parallel builds. Nearly any other tool you replace Make with will either have you sacrifice incremental/parallel builds or will give you the same hermeticity problems you would encounter with Make. Replacing Make, the main paths I see are towards improved versions of the same thing (e.g. Ninja, tup), completely redesigned versions of the same thing (Ant, SCons), systems and languages which generate makefiles (e.g. autotools, CMake), and the new wave of build systems which provide hermeticity (Bazel, Buck, Pants, Please). This last group is a very recent addition.
Mind you, Make is old and not especially well-designed, and it has plenty of limitations, but it’s good enough at incremental/parallel builds that it has stuck around for so many decades. Make is good enough at what it provides that replacements like Ant, SCons, Tup, Ninja, etc. don’t seem like much of an improvement.
- chubot 8y agoYeah I think we're in agreement, except that Ninja is not a replacement for Make. Make is both a high-level and a low-level build tool (i.e. logic/graph description vs. execution) Ninja is only a low-level build tool -- it focuses on execution only, punting logic to a higher level, which I like. See my comments here: https://news.ycombinator.com/item?id=19057836 https://news.ycombinator.com/item?id=19057836 I used Bazel/Blaze for many years, and even contributed to it a long time ago, and I agree it has many nice properties (although I'm more interested in building open source projects with diverse dependencies, which it isn't great for AFAIK.) Another potential advantage of a build generator (described in that comment) is having one mode to enforce correctness of the build description, and another mode to be fast. In other words, you could generate a Ninja file with a sandbox like Bazel uses. You could use a tree of symlinks or run in a chroot with a setuid helper.
- klodolph 8y ago> Yeah I think we're in agreement, except that Ninja is not a replacement for Make. I would definitely disagree with this. Make's higher-level logic/graph description features are only incidental, as Ninja proved, you can remove those features and end up with a tool that is equally valuable, more or less. To abuse an analogy, if I'm shopping for notebooks, I don't need to buy a notebook and pen shrink-wrapped together. I already have plenty of pens. You're right that Bazel isn't good for open-source projects with diverse dependencies, but I think this is a problem that can be solved by developing some more infrastructure for that and writing the appropriate Starlark code (to be called from your your WORKSPACE file and create the appropriate repositories somehow). That code just isn't around yet.
- chubot 8y agoAll I'm saying is that Make was designed to be hand-written and often is, and Ninja was designed to be generated, and almost always is. See the manual: https://ninja-build.org/manual.html#_philosophical_overview https://ninja-build.org/manual.html#_philosophical_overview Concretely, if you look at how Android or buildroot used GNU make, you can't do that with Ninja alone -- you need another tool. GNU make is Turing complete, and Ninja isn't. IMO the Ninja design is better (which isn't surprising since it's not an accretion over decades).
- jschwartzi 8y agoAs I recall, the guy who developed Make wrote it in a weekend.
- klodolph 8y agoAnd never expected it to be so successful, and realized that he couldn't fix some of its problems because people were already relying on it.
- kazinator 8y agoThat may be true, but GNU Make wasn't built in a weekend. Just like a crappy Lisp interpreter can be built in a weekend, but an ANSI Common Lisp or Racket won't be built in a weekend.
- mcguire 8y agoI'd just like to point out that Ant, the only alternative to make you list that I've used extensively, is essentially a scripting system.