[Python-Dev] addressing distutils inability to track file dependencies

Skip Montanaro skip@pobox.com
Mon, 17 Jun 2002 10:18:58 -0500


    Jeremy> Here's a rough strategy for exploiting this feature in
    Jeremy> distutils.  Does it make sense?  Happily, I can't see any
    Jeremy> possible use of make.

I still don't quite understand what everyone's aversion to make is (yes, I
realize it's not platform-independent, but then neither are C compilers or
linkers and we manage to live with that), but I will let that slide.

Instead, I see a potentially different approach.  Write an scons build file
(typically named SConstruct) and deliver that in the Modules directory.
Most people can safely ignore it.  The relatively few people (mostly on this
list) who care about such things can simply install SCons (it's quite small)
and run it to build the stuff in the Modules directory.

The benefits as I see them are

    * SCons implements portable automatic dependency analysis already

    * Dependencies are based upon file checksums instead of timestamps
      (worthwhile in highly networked development environments)

    * Clearer separation between build/install and edit/compile/test types
      of tasks.

I was able to create a simple SConstruct file over the weekend that builds
many of the extension modules.  I stalled a bit on library/include file
discovery, but hopefully that barrier will be passed soon.

I realize in the short-term there are also several disadvantages to this
idea:

    * There will initially be a lot of overlap between setup.py and SCons.

    * SCons doesn't yet implement a VPATH-like capability so the source and
      build directories can't easily be separated.  One is in the works
      though, planned for initial release in 0.09.  The current version is
      0.07.

Skip