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

Russel Winder russel at winder.org.uk
Wed Jan 23 04:42:35 EST 2013


On Tue, 2013-01-22 at 12:17 -0800, M Busche wrote:

> I'm trying to use SCONS for the first time to handle builds, test, doc

> generation and packaging for a little personal C++ project. I've made

> significant progress, but am having some difficulty with packaging.

> I've written some stuff to first copy my source into a generated

> distribution directory (and replacing __VERSION__ strings found in

> each file with the software version). This works just fine. My

> problem is that I don't want this software packaging process to start

> until all tests have been completed. But because I'm only packaging

> up source code, there's nothing to stop SCONS from deciding to start

> the packing process prior to running tests (or doing anything else at

> all for that matter). So how do I easily get SCONS to see the

> successful completion of my test cases as a dependency of every file

> copy operation and directory creation operation that I use to build up

> the distribution directory?


One route might be top use Depends to connect a product of the
completion of the test sequence to the package, then the package cannot
complete without all the tests having run successfully.


> Now all of my tests are run in a separate directory aptly named

> "test", and successful completion of a suite of test cases does create

> an SCONS target file in that directory structure. So, I presume if I

> explicitly declared the root directory node "test" as a dependency of

> all the copy / Mkdir operations I use to build up my distribution

> directory, that that would guarantee all the test suites finish prior

> to any packaging. (I have not tried this, but it seems like it should

> work.) But this seems cumbersome and awkward. Am I missing

> something? And what if I then wanted to declare some other build

> activity as another prerequisite to software packaging? I'd then have

> to promulgate the corresponding build targets as additional

> dependencies of all those copies and Mkdirs that are at the root of

> the packaging process???


Ideal for the use of Depends since there is a clear result product of
the test that the packaging can depend on.

For the other questions, we are now getting into the territory where
generalities might make things worse. It would help to know more detail
of the project structure and the SConstruct and SConscript files.


> Seems like what I want is some abstract node X (that doesn't

> correspond to any actual file or directory) declared as a dependency

> of each copy / Mkdir operation. Then I can declare other things (like

> test cases) to be dependencies of X. Is there such a thing in SCONS?


Yes, but I am confident there is an easier way.


> Anyway, I'm a noob working in isolation, and I'm quite likely missing

> something to make everything much simpler. (I feel like I'm doing

> more work than I should have to to get my dependencies just right.)


Your feeling implies that there is likely to be a better way; whenever
anything feels like too much work, it probably is, and it is time to
find a better way. To take this further though we need to move from
generalities to specifics, hence the request for more details of the
project. Do you have it on BitBucket, GitHub,…


--
Russel.
=============================================================================
Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder at ekiga.net
41 Buckmaster Road m: +44 7770 465 077 xmpp: russel at winder.org.uk
London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : <http://four.pairlist.net/pipermail/scons-users/attachments/20130123/9e1cc73e/attachment.pgp>


More information about the Scons-users mailing list