ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

Fabricate: the better "make". Finds dependencies automatically for any language

<< < (3/4) > >>

ewemoa:
Thanks for posting about this.

I've started migrating a couple of small projects from custom windows/msdos batch scripts to using fabricate.  (Perhaps I should give SCons a try at some point, but I'm all for starting out with simpler (meant in a good way here!) options first.)

I'm not sure if I'm making good use of it, but for FWIW, I'm finding it much easier to use Python (compared to using batch scripts) to manage building exes, preparing an archive file for distribution, running tests, etc.

For reference, the kinds of things this has helped in gluing together include:

  ahk2exe.exe
  7z.exe
  jsl.exe
  mkdir
  copy
  rmdir

I thought I'd mention some things I found useful:

  using shell() w/ shell=True seemed to make certain things function better
  using shell() w/ silent=False was nice as it allowed getting output from tests
  use '*list' in calls to shell() to handle command lines of the form:

    this.exe file1.js ... fileN.js

  where list is:

    ['file1.js', ..., 'fileN.js']

  the call to shell() would look like:

    shell('this.exe', *list)

  which IIUC is similar to:

    shell('this.exe', 'file1.js', ..., 'fileN.js')

Nice to have source to discover these things (especially when my doc-reading skills don't succeed) :)

Anyway, thanks again!

berwyn:
Yep, there are no docs as thorough as the source ;)!

You're right that the shell command is handy, and probably warrants better documentation.  You can, of course, get docs on it without browsing the source with python's help command: help(shell).  But now that I look at it again, that tail doc sure is obscure.  It could do with improvement.

If you want to write up a suggested doc for me on shell(), I could see about getting it put onto the fabricate website.

CWuestefeld:
fabricate[/b] is a build tool that finds dependencies automatically for any language
-berwyn (July 27, 2009, 05:24 AM)
--- End quote ---

How does that work? It seems rather magical to me.

ewemoa:
How does that work? It seems rather magical to me.
-CWuestefeld (March 12, 2010, 12:06 PM)
--- End quote ---

Some excerpted text:

fabricate lets you simply type run('command', 'arg1', 'arg2'), and it will run the command and figure out its dependencies (and outputs) automatically. Next time it'll only actually execute the command if those dependencies have changed (or the outputs have been modified or don't exist).

It finds dependencies by one of two methods:

    * strace: fabricate first tries to use the Linux strace command to log system calls to open() and determines what files were read and modified that way. This is the original method used by Bill McCloskey's memoize.
    * File access times (atimes): Some systems (Windows) don't have strace, and in that case fabricate looks at the atimes of files before and after the command was run, and from those can figure out which files each command accesses. It also uses file modification times (mtimes) to determine the command's output files. It's fast and simple, and it works on NTFS, FAT32 (thanks to some tricks), as well as Linux file systems that have atimes enabled.

--- End quote ---

I found the above text at the HowItWorks page.  There is further text there including a warning for use on Windows systems :)

f0dder:
...atime is disabled by default on Win7, and power users tend to disable it on previous systems. It's a mostly useless feature that slows things down without bringing much benefit. Using strace or atime to figure out dependencies sounds pretty flaky to me at any rate.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version