[Bf-committers] Scons roundup

Ton Roosendaal bf-committers@blender.org
Sun, 27 Jun 2004 18:26:48 +0200


My personal opinion on scons (how it is now in Blender, can't judge the  
general case) is that it's doing its work far too perfect, taking about  
every dependency into account, causing incredible long compilation and  
initialisation times.
Blender sources are *far* from well organized yet, with dependencies  
going all over the code. I guess 95% of dependencies even don't really  
matter, and don't need to be evaluated by a make system while working  
on the code.

There's 2 requirements for a make system to work for Blender. One is to  
build a release, a binary that can be reliably handed out for testing  
or actual releasing. The other is assisting a developer while working  
on code. The developer is supposed to *know* the code, and where  
dependencies reside. Having the 'make' system sorting this out then  
only is the rare and exceptional case. In almost all situations you  
just want to have a single C file (or small set of files) compiled  
again, and the full binary linked.
This should be as fast as possible; and think here of a matter of  
seconds, even on a moderate 500 Mhz machine (OSX, as I still use).

What we need is a *default* scons 'developing' setting, where:
- it only checks for changed C files in the current directory (not the  
- where it just compiles these files, creates the lib, and immediately  
links the binary
- this option should recursively include all directories in the tree  
- it shouldn't print the gcc command line, but just a single liner like  
  -- foo.c --
   (this to easier detect warning messages of compiling)
- as option you can invoke the "-g" debug flag for the currently to be  
compiled files

And as a variation:
- where it does as above, but checks for changed include files as well

And as specifically added options:
- recompile the code in 'safe' mode taking all dependencies into account
- printing out full gcc command lines

BTW: Changes in Scons settings shouldn't cause recompiles at all. For  
example; to compile a C file with different flags, or link with  
different libraries, only the touched file(s) should recompile.

It's well possible this already is a scons feature but that doesn't  
work at all here. Including the options as regularly mentioned (fast  
mode, --up, etc).


Ton Roosendaal  Blender Foundation ton@blender.org