[Scons-users] Dealing with an odd dependency

Brian Cody brian.j.cody at gmail.com
Fri Dec 5 13:59:25 EST 2014


Hello,

I'm integrating a tool into our build system which behaves a little
differently than most. It constructs libraries, and then wants a path
mapping to those libraries to be placed into a file. This same file has
other information in it and it is required to already exist. So the
activity 'construct library' both depends this file, and has it as a side
effect. This alone is something that SCons complains about as a circular
dependency--it seems that there's a fine line between a target and a side
effect. I might be able to work around this, but it gets a bit trickier
since I might be constructing multiple libraries. The side effect does
guarantee that I won't construct multiple libraries at the same time (which
is good).

Ideally I would like a solution that works this way:
1. The shared file doesn't exist. I have a builder that creates the file in
its initial state
2. A library can now be constructed since the shared file exists. It does
its library thing it does so well, and modifies the shared file.
3. Another library can now be constructed since the shared file exists. It
does its library thing it does so well, and modifies the shared file.
4. We're done. While the two libraries depend on the shared file, they only
care when the builder in step #1 acts.

If I run again with no modifications:
0. Nothing happens

If I change the definition of the initial state of the shared file:
1. The builder re-creates the file in its (new) initial state.
2. A library is now constructed since the shared file was updated due to
the action in step #1. The shared file is updated.
3. A library is now constructed since the shared file was updated due to
the action in step #1. The shared file is updated.
4. We're done.

Do you have any suggestions on how make SCons act in this manner?

Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20141205/893a5f1c/attachment.html>


More information about the Scons-users mailing list