4 ms·
This is clever but truly content based change detection in make would seriously fix a bunch of issues. I'm sort of surprised it hasn't been done already.
by zaphar 4y ago
This is clever but truly content based change detection in make would seriously fix a bunch of issues. I'm sort of surprised it hasn't been done already.
- andreareina 4y agoProbably because it would fundamentally change how make works (i.e. without a database).
- masklinn 4y agoMake only works “without a database” in a pretty loose sense, it relies on the file system to store the (very unreliable) data it relies on. It could use xattr to store its content tags.
- suprjami 4y agoAssuming the filesystem supports xattr is an even bigger minefield.
- zaphar 4y agoWe use all kinds of tools that require a database that is effectively hidden from us. (e.g. git). I don't think this is a significant blocker or problem.
- mananaysiempre 4y agoDoesn’t mean you can’t maintain the database with Make :) Prototype: .FORCE: .PRECIOUS: .sha256/sum/% .sha256/tmp/%: % .sha256/tmp .FORCE sha256sum < $< > $@ .sha256/sum/%: .sha256/tmp/% .sha256/sum cmp $< $@ >/dev/null 2>&1 || mv $< $@ .sha256/tmp .sha256/sum: mkdir -p $@ .SUFFIXES: %.o: .sha256/sum/%.c $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $*.c I expect you could get rid of most of the non-POSIX features by using more complex recipes, probably exiling them into separate shell scripts. (The main limitation is that V7/POSIX/BSD-style suffix rules don’t let you specify a rule for producing ANYTHING.foo from ANYTHING, whereas V8/GNU-style pattern rules do.)
- pull_my_finger 4y agoYou might enjoy Tup[1] if you've not checked it out before. [1]: https://gittup.org/tup/ https://gittup.org/tup/
- zaphar 4y agoI've seen it but: 1. I find the syntax pretty offputting. 2. Make is found everywhere so a drop in replacement is a useful feature.