4 ms·
> Using make in a CI system doesn't really work, because of the way it handles conditional building based on mtime. Any CI I've seen starts from a fresh repo c
by majewsky 9y ago
> Using make in a CI system doesn't really work, because of the way it handles conditional building based on mtime.
Any CI I've seen starts from a fresh repo checkout and rebuilds everything every time, so it's not an issue with practice.
OTOH, probably all my projects were small enough for it to not hurt when the CI builds everything from scratch every time. I might look at this from another angle if the things I worked on were mega-LOC C++ programs, and not kilo-LOC Go programs.
- regularfry 9y agoCircleCI (at least) caches build dependencies for speed, but it does it based on specific directories, not timestamps. As a result, it's not as fast as it could be because unless you munge your build to fit, it doesn't cache intermediate build products of your own code.
- adrianN 9y agoMost languages don't build as quickly as go. Having to wait tens of minutes for a clean build is not unusual.
- majewsky 9y agoThat brings back not-so-fond memories of trying to compile Servo on my notebook. :) By the way, I just noticed that compilation times are another argument for microservices.
- ejholmes 9y agoThat works, until your build system is sufficiently large or time consuming or not C/C++ like make was originally built for. For example, at my company we have a build system for building all of our Amazon Machine Images (AMIs). It doesn't make sense to re-build images unless they're dependencies have changed, but mtime just doesn't make any sense for a build system like this. Trying to coerce make into doing what we wanted was like pulling teeth.
- wruza 9y agoWhy didn't you just take make sources and fix them for <whatever> instead of mtime() check, making it a command line option or environment variable? Or simply .MTIME target, which would return int-like string of rank, defaulting to mtime() if not declared.
- marcosdumay 9y agoI guess it's because of his point #3. Honestly, if I were to modify make for some custom behavior, I would look for another tool¹ or create yet another builder tool. Because although I already know most of the syntax, point #2 is an incredibly big problem, the GP missed point #4 in that make does not manage external dependencies², and the syntax is not bad only for learning, but for using too. 1 - Almost everybody seems to agree with me on this. The only problem is that we have all migrated to language constrained tools. This is a problem worth fixing. 2 - Wether it is installing them or simply testing if they are there, make can't do any. Hello autotools, with it syntax set to extreme cumbersomeness.
- oso2k 9y agoI don't know if you really understand Make. Even the original article misses point about what Make is really about in recommending `.PHONY` targets. Make is about "making files." Or to be a little more semantically specific, Make is about "processes that transform files to make new files based upon their dependencies". It really doesn't matter that your file is a C source file, or some unpreprocessed CSS, or a template, or an AMI. To your AMI example, if you specify a dependency (or dependency chain, DAG) as a time-stamped (or set of) file, you can get make to rebuild the AME for you along with any other supporting or intermediate files. IMO, the suckless guys are masters at writing deceptively complex but highly readable & concise Makefiles. Here's plan9 workalike utility library [0], a util-linux/busybox package of binaries [1], a window manager [2], a terminal emulator [3], and webkit2 based web browser [4]. I highly recommend you study them if you're looking to up your Make game. [0] http://git.suckless.org/9base/tree/Makefile http://git.suckless.org/9base/tree/Makefile [1] http://git.suckless.org/sbase/tree/Makefile http://git.suckless.org/sbase/tree/Makefile [2] http://git.suckless.org/dwm/tree/Makefile http://git.suckless.org/dwm/tree/Makefile [3] http://git.suckless.org/st/tree/Makefile http://git.suckless.org/st/tree/Makefile [4] http://git.suckless.org/surf/tree/Makefile http://git.suckless.org/surf/tree/Makefile
- majewsky 9y ago> so it's not an issue with practice. I meant "in practice", of course...