Re:fabricate: The better "make". Finds dependencies automati...
by benhoyt on Monday July 27, 2009 @05:55AM
(#725635)
We've been using memoize to build stuff for a while now, but we needed something that worked under Windows too. So here's our "fabricate" build tool. It's BSD licensed -- enjoy!
[ Parent
| on HN ]
Re:fabricate: The better "make". Finds dependencies automati...
by kragen on Monday July 27, 2009 @10:16AM
(#725850)
Does it scan your entire filesystem for atimes so as not to miss the .h files over in /usr/include, and if not, how does it know which directories need scanning?
Re:fabricate: The better "make". Finds dependencies automati...
by benhoyt on Monday July 27, 2009 @04:02PM
(#726566)
No, it defaults to recursively scanning the current directory, but you can easily override this if you want, eg:
setup(dirs=['.', '../lib'])
Re:fabricate: The better "make". Finds dependencies automati...
by kragen on Monday July 27, 2009 @08:56PM
(#727168)
Is there a way to override it to just use strace?
Re:fabricate: The better "make". Finds dependencies automati...
by benhoyt on Monday July 27, 2009 @11:53PM
(#727386)
Sure is. This will do it:
setup(runner='strace_runner')
Re:fabricate: The better "make". Finds dependencies automati...
by kragen on Wednesday July 29, 2009 @12:40AM
(#729459)
Neat! Thanks!
Re:fabricate: The better "make". Finds dependencies automati...
by loup-vaillant on Monday July 27, 2009 @08:15AM
(#725721)
I don't get it. Does it intercept file accesses to determine the dependencies? Looks like magic.
Re:fabricate: The better "make". Finds dependencies automati...
by silentbicycle on Monday July 27, 2009 @08:20AM
(#725727)
Yes, via access times and strace: "When this build stage ran, it checked these files, so remember them as dependencies." Not magic at all, and should automatically work for languages that haven't even been invented yet.
Re:fabricate: The better "make". Finds dependencies automati...
by joe_bleau on Monday July 27, 2009 @01:56PM
(#726309)
Can it tell (using access times under windows) that the files were modified by that stage of the build command, and not by another unrelated process?
How does it know which drives and directories to scan for recently modified files? Scanning all of them would take a while.
Re:fabricate: The better "make". Finds dependencies automati...
by modeless on Monday July 27, 2009 @07:35PM
(#727024)
It is possible to do strace-like stuff on Windows too as evidenced by Process Monitor. http://technet.microsoft.com/en-us/sysinternals/bb896645.asp...
If scanning atimes is too slow or unreliable, perhaps fabricate could be updated to use procmon?
Re:fabricate: The better "make". Finds dependencies automati...
by benhoyt on Monday July 27, 2009 @11:56PM
(#727388)
Here's a version of strace for Windows: http://www.intellectualheaven.com/default.asp?BH=projects...
I've hacked it to print the actual file names on CreateFile() calls, but it's failing because it doesn't recurse and trace sub-processes. It should be theoretically possible by hooking CreateProcess(), but it's probably hard.
Re:fabricate: The better "make". Finds dependencies automati...
by silentbicycle on Monday July 27, 2009 @02:07PM
(#726337)
It uses strace, a Linux-specific file change notification hook. It's not available on BSD or (IIRC) OS X, though ktrace is, so it could conceivably be ported. (The page says something vague about cygwin having a comparable hook to strace. I haven't developed for cygwin, though.)
It looks like it checks for files modified specifically by its subprocesses.