5 ms·
Recursive Make Considered Harmful (1997) [pdf]
- jeffrallen 8y agoIt still is.
- mistrial9 8y agooffhand, graph traversal is a lot more common now than twenty years ago
- tonyg 8y agoRelevant: https://apenwarr.ca/log/20101214 https://apenwarr.ca/log/20101214. Code: https://github.com/apenwarr/redo https://github.com/apenwarr/redo. It's excellent!
- gonzus 8y agoAnd, sadly, it also doesn't handle correctly / easily the case of a rule building two or more outputs (think yacc producing a .h and a .c file): more contortions are required.
- deleted 8y ago[deleted]
- jjdjr0odo7 8y ago“Unacceptably large” build times. Kind of depends on how much you like your employer, doesn’t it?
- ajross 8y agoYup. But imake is here now and we can all rest easy. OK, maybe not. But this here autotools cleanly handles all those crazy portability edge cases and gives you a nice structure to boot. It's the Right Thing. Sorry about that. But check out scons. That's clearly the way things should have been done in the first place. Late breaking news: supporters of "Ant" in the Java world were just deposed by something called "Gradle"! We'll have experts on shortly to explain why either of these were needed in the first place given that javac handled dependencies automatically in its very first version. But yeah, maybe python wasn't as clean as we hoped. Check out cmake! Here's the new hotness for sure. Pay no attention to the really awful programming language it embeds, it does windows! ---- I mean, yeah, recursive make, specifically, isn't a great idea. And for large projects, make implementations have performance issues. But make is a tool that does two things and does them simple and well: it tracks dependencies between files, and it lets you write simple command sequences in an obvious language to fulfill those dependencies. And until the authors of all these other tools get their heads out of the clouds and stop trying to fix the OTHER problems with make while refusing to preserve these attributes, make isn't going anywhere.
- humanrebar 8y ago> ...it lets you write simple command sequences... People experienced with make might not notice, but Makefiles often become write-only code, especially to novices.
- ajross 8y agoSo does everything else. Find me a big project with a build automation system that isn't a jury-rigged, inscrutable mess. The problem isn't the tools.
- humanrebar 8y agoIf it's all a mess, why not pick a build system that lets you compose a dependency DAG correctly? Not that the problems in the paper here are not specific to make. They describe deficiencies in a certain kind of mathematical model. It is possible (and common) to have the same problems in a non-make build system. Make is not special in this regard, just popular.
- ajross 8y ago> that lets you compose a dependency DAG correctly Gah, that's exactly the fallacy I mentioned above! That's not the requirement, as shown by decades of make's refusal to die. The requirement is that it work simply and easily for the simple tasks needed to get new projects built in their early days where their structure is changing rapidly. Other stuff tends to force you into a world view, which is why we have separate build systems for Android apps, and Rust modules, and cross-platform C++ code, and Java projects, and Linux command line tools, and... That said: I don't know what you're talking about here. Make does a perfectly general DAG via its routine and simple dependency syntax. Recursive make invocations do not, which is what the linked article about. But make works fine for arbitrary dependencies. Go build a kernel to see.
- humanrebar 8y agoThe problem with having one monster make system is that code changes (adding a new dependency) affect build rules indirectly (the build of a test of a downstream library now needs to add a new include search path in a topologically correct way). Now, there are various DRY ways to model that sort of thing in make. But very quickly, the project is no longer an intuitive expression of allegedly simple make. It is a build framework written in make. Nobody denies that Make can model all this. CMake and autoconf actually embrace that quality of make. The concern is that turning "depend on libfoobar.a" or "libfizzbuzz.a now requires FIZZBUZZ_STRING=std::string" into a coherent Makefile change is more often nontrivial, especially without breaking parallelism, correctness, or the ability to do incremental builds.
- hedora 8y agoMany people miss the key point of this article: Break your make build up by recursively including make files instead of recursively invoking them.
- mannykannot 8y agoPrefer lexical/static structure over dynamic structure?
- qcoh 8y agoI tried this once with multiple components (each being built into a static library), components "exporting" public includes (with correct dependencies across component boundaries) and tests for every component (as well as integration tests) and my conclusion: cmake it is.
- dboreham 8y agoDevelopers of yarn must have read this.
- pcwalton 8y agoOne problem with non-recursive make for very large projects is that make can take a long time to parse and interpret the uber-Makefile. Even though this paper provides some advice for reducing the parse time, it isn't enough for really large projects. Android suffered from this a lot in the early days. I always wondered whether the initial Android team had read this paper and got carried away...
- cmm 8y agoit's not the parsing per se that takes time on modern computers, it's opening and reading in all the scattered included makefiles. also what specifically Android build system is doing behind the scenes is, it runs a python script, which in turn runs find (or maybe several, I don't remember), to gather all the makefiles to include. but parsing, once all the text is in memory? peanuts.
- evmar 8y agoAndroid's build system now generates Ninja files, which are semantically very close to non-recursive Makefiles, so it's a real-world example you can examine and measure. Android's build files currently add up to 1.5gb of text(!!!), which even with a fast parser take some time to load (~10-20s). It's discussed further in this thread (in which among other things I suggest that maybe something is going wrong when you have 1.5gb of text): https://groups.google.com/d/topic/ninja-build/htlu9akobq0/discussion https://groups.google.com/d/topic/ninja-build/htlu9akobq0/di... [disclaimer: I am the author of Ninja]
- bjourne 8y agoPeople who defend make (or its evil companion autotools) are suffering from the Blub Paradox. http://wiki.c2.com/?BlubParadox http://wiki.c2.com/?BlubParadox They likely have never used any better build/configuration system so they think make is the best there is. Discussing build systems is like discussing programming languages. If one party has only ever used Java, then they will never get it. Personally, I switched to WAF a loong while ago and have never looked back. Perhaps it is not the best build system there is, but it is leagues ahead of autotools/make.
- tomohawk 8y agoOne thing I love about go is that it builds all the things quickly and in one go. For other languages, once I found rake, I never looked back. It's so powerful, and unlike make, you don't have to drop down to other languages to do things.
- akkartik 8y agoIn fact, slow builds were the #1 pain point Go was designed to address: https://talks.golang.org/2012/splash.article#TOC_4 https://talks.golang.org/2012/splash.article#TOC_4
- zxcvbn4038 8y agoI think these “<whatever I don’t agree with> considered harmful” articles get a bit tideous after a while. For any of them you can just as easily write a counterpoint “<whatever you prefer instead> considered harmful” with just as much passion and merit. Mentally I tend to rewrite these as “<bob or jane> are mad at <goto, recursion, forth, puppies, kittens, etc>” and that is probably closer to the truth. They are opinion pieces that allow people to vent to a crowd. If this comment had a title it could be “Considered Harmful articles considered harmful” or “Bob is mad at considered harmful articles”. Someone else could come along and write “Lack of considered harmful articles considered harmful” with equal merit I’m sure. ;) I’ve made a point the last few years to put at least one goto in all my code just to mess with the junior devs, though in practice the junior devs aren’t familiar with the original material so its more the mid level devs that will explode into green flame or curl into a ball when they find my goto. Senior devs couldn’t care less if they find a goto.
- braythwayt 8y agoFor those who don't get your reference, here is the canonical “Considered Harmful” Essays Considered Harmful: https://meyerweb.com/eric/comment/chech.html https://meyerweb.com/eric/comment/chech.html
- zxcvbn4038 8y agoThat is a really great link, thanks for posting it! Something I had not considered were these occurring outside comp-sci circles. Makes me cringe. “Sit down sir! Your theory of of spatial relativity is so wrong it’s considered harmful! Hurmph! Hurmph!”
- bleair 8y ago30 years on and I've used make, imake, autotools, cmake, ant, gradle, boost.jam (because every C++ library really should have its own individual custom build tool-chain), scons, ninja, and maybe the least bad was a very nice system internal to ILM (though it was purpose written for building C++ & python targets). These days I'm using bazel the most, and while it can be forced into working, it's pretty miserable (and requires support of about 5 people on a dedicated build team). It does not bring software developers joy. A group/language/team decides "that's it, I hate build tool X, we're going to solve this problem", and they go build their thing, but they care about different details and make some things easy, handle some things automatically, and leave other things as "just don't care" with the resulting tool ends being just like all the previous ones. I'd be willing to wager lots of money that in future years there will be many more build systems, and they too will perfectly match their predecessors. https://www.xkcd.com/927/ https://www.xkcd.com/927/
- humanrebar 8y agoBoost seems to be switching to CMake for what it's worth.
- bleair 8y agoInteresting.. I did not know that. My googling shows that there has been an announcement with an intention to adopt cmake (~ 2 years ago) http://boost.2283326.n4.nabble.com/CMake-Announcement-from-Boost-Steering-Committee-tt4696935.html http://boost.2283326.n4.nabble.com/CMake-Announcement-from-B... It appears further discussions are underway, but I don't know what that means in terms of how quickly they will switch. https://groups.google.com/forum/#!topic/boost-steering/5ifzupxKINI https://groups.google.com/forum/#!topic/boost-steering/5ifzu... In terms of bjam vs. cmake... I get why the boost library has needed a custom build tool chain (if you're curious just look at the complexity in headers in trying to work around various template bugs in different compiler versions, or the many many many ways to request naming of the generated libraries). I should have been less snarky in my first post. If boost does migrate to cmake I predict it will be quite a gnarly set of cmake logic.