[Omake] Re: Building in subdirectories and variant builds revisited

Jason Hickey jyh at cs.caltech.edu
Mon Jun 18 12:36:47 PDT 2007


On Jun 18, 2007, at 11:54 AM, Aleksey Nogin wrote:

> On 08.06.2007 05:55, David Kågedal wrote:
>> I'll go one step further and say that even separate source and build
>> directories wasn't part of the original design spec.

In defense, the problem is that variant builds are hard in general.

The problem is to come up with a *general* method for variant  
builds.  Not one that works just for gcc, or cl, or OCaml, or any  
specific thing.  It needs to work in general, and on all platforms.

The problem is that some ill-behaved programs are hard to specify.   
Here are some example behaviors of ill-behaved programs.

    - The target and source file must be in the same directory (like  
"cc -c" without a -o option),

    - Programs where the sources can't be specified in the rule.   
ocamldep is an example.

    - Programs where the set of targets is not known ahead of time.   
For example, texinfo generates a bunch of files xxx-1.info,  
xxx-2.info, ... but you can't predict how many files it will generate.

In all these cases, the build rules are necessarily imprecise; they  
miss some dependencies, or some targets, or they might have  
unintended side-effects.

IMO, the real solution is to use a virtual filesystem that provides  
the illusion that the variant build is a real one.  Added benefits  
are that  a virtual filesystem would know what files are accessed by  
a rule, so it could tell you which rules are imprecise.  One plan  
I've often thought about is using Fuse to implement the virtual FS.   
It wouldn't work on Win32, but it would still be useful to Unix folks.

The vmount is a partial step in the the VFS direction.

Of course, for some well-behaved programs, like GCC etc. it is  
possible to implement some other specific clean way of performing  
variant builds (like how it is done is SCons).  It might not be  
general, but would probably be a lot better than vmount.  This needs  
manpower:)

Jason

--
Jason Hickey                  http://www.cs.caltech.edu/~jyh
Caltech Computer Science      Tel: 626-395-6568 FAX: 626-792-4257





More information about the Omake mailing list