[Scons-users] How to treat a directory of stuff as a single node

M Busche spammymatt94 at yahoo.com
Sun Jan 27 09:11:56 EST 2013


Gary,

Thanks for understanding my query!  I thought I'd report on how things came out.

*** LINE 1: ***

You said, "The first line is a little complex from an implementation perspective but I think it should work":

        Depends(Dir("dist"), "test")

It didn't work.

I have five different test programs that have to be built and run in that test directory.  Before I added the above Depends line, my source-code packaging was running first (before any tests were run.)  After I added the above line, four of the five tests got built and executed; then the packaging ran; and finally my fifth test program was built and run.  So the Depends line got me closer to my desired build order, but seemed to miss some dependencies.  That's really weird.  Suspiciously, my fifth test program used different build rules than the other four, so it is conceivable (but I think unlikely) that this is somehow my fault and not the fault of scons.  I have also not yet taken the time to introduce a failed test-case in one of the first 4 test programs to see if that will indeed inhibit the packaging step.

For now, to work around the problem (be it scons' problem or mine), I instead build up an explicit target list in my genDistribution function (that invokes all the SubstInFile and Mkdir commands to build up the distribution directory) and return that list to the caller.  Then I declared the "test" directory as a dependency of this long list of target files and directories that sit under "dist".  This worked just dandy (and was actually only a few lines of code.)

Still, it would be far better if the simple Depends line above worked as you think it should.  After I finish cleaning up other ugliness in my still noobish-looking build scripts, I'll revisit this and try to construct a simple example that exhibits the problem.  We can then discuss it further if you are interested and/or I can submit a bug report.

*** LINE 2: ***

You said, "The second line for sure is OK." 
 
        Depends("dist.tgz", Dir("dist"))

Not only was it OK, but it seems to be completely unnecessary.  Because the directory "dist" is itself the source for my Tar ball builder, scons recognizes (as you might expect/hope) that successful completion of all of the build targets within directory "dist" is a precondition
for starting the tar operation.  Wonderful.

Thanks again for your help,
Matt Busche



________________________________
From: Gary Oberbrunner <garyo at oberbrunner.com>
To: M Busche <spammymatt94 at yahoo.com>; SCons users mailing list <scons-users at scons.org>
Sent: Wednesday, January 23, 2013 10:56 AM
Subject: Re: [Scons-users] How to treat a directory of stuff as a single node







On Wed, Jan 23, 2013 at 11:43 AM, M Busche <spammymatt94 at yahoo.com> wrote:



>Depends(Dir("dist"), "test")   #  where I specifically let scons know that "dist" is a directory since it doesn't initially even exist.

>Depends("dist.tgz", Dir("dist"))

>

>I.e., what I WANT this to mean to scons is that (LINE 1) EVERY node under directory "dist" depends upon EVERY node under directory "test"; and that (LINE 2) node "dist.tgz" depends on EVERY node under directory "dist".  


That's how it's supposed to work.  The first line is a little complex from an implementation perspective but I think it should work.  The second line for sure is OK.
--
Gary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20130127/4554795b/attachment.html>


More information about the Scons-users mailing list