[Xorp-users] BUG: 1.7 build system has builddir feature but creates files in source tree, build with read-only source tree fails

Bruce Simpson bms at incunabulum.net
Wed Sep 30 02:10:08 PDT 2009


XORP at sipxx.com wrote:
> Thank you. This works fine on a read-only file system.
> For the rest of the problem on a r/w-able file system, I have tried to 
> find out how to disable the storage of the python import module 
> compilations into the source tree, but haven't found the answer. Since 
> python obviously doesn't *need* to have the compiled files, it seems the 
> import function ought to have some flag to turn it off.

Python will not create the .pyc files if it can't. I agree that creating 
files under the source tree does violate principle of least astonishment 
(POLA) where folk are hosting the source e.g. on an NFS file system.

This seems to be an ongoing issue within the Python community:
    http://bugs.python.org/issue602345  (this is in trunk, but hasn't 
been backported)
    http://www.python.org/dev/peps/pep-0304/ (a withdrawn PEP)

I'm mostly using Python 2.6 these days. There is also 'importlib', that 
only just got backported to 2.7.

If it's a real issue for you, then it would make sense to take it up 
with the Python guys. I can see how it would bite embedded systems with 
a flash filesystem.

>  Since there 
> isn't a 'clean' target either, this is still a very unclean situation.
>   

To clean a SCons build, use 'scons -c'. I had hoped to add syntactic 
sugar to provide folk with a 'scons clean' target, however, I haven't 
been able to find free time to do that yet.

It shouldn't be too difficult for someone familiar with Python (and 
willing to get familiar with SCons) to add, and there are other projects 
using SCons which this can be cribbed from (e.g. Mapnik).

> In general, I think, compiling outside the source tree should actually 
> start from the builddir, not the source directory. Instead of having to 
> specify the build directory on the command line, one should specify the 
> source directory while having the builddir as current directory. This is 
> much more convenient when, for example, one wants to capture/redirect 
> the console output of the process to a file in the build directory, and 
> it is the traditional method.
>   

In the Automake world, yes, folk usually run configure with a relative 
path to do this, from a build directory which has just been created.
A patch to implement some of this behaviour in the SCons world would be 
interesting.

cheers,
BMS



More information about the Xorp-users mailing list