[Scons-users] Scons deleting output files it does not know about

Dirk Bächle tshortik at gmx.de
Wed Oct 2 15:06:24 EDT 2013


Hi Pico,

On 02.10.2013 14:40, Pico Geyer wrote:

> Hi all.

>

> I'm trying to use scons for a certain project where we have a version

> of boost in our source tree.

> I've created a simple builder that builds boost into our variant dir

> (by wrapping the standard boost install commands)

> The targets that the boost builder knows about are just a few library

> files and symlinks which we expect to be in the output dir.


it would help if you could show us how the Builder actually looks like.
Did you define a customized Emitter for it?


> [...]

>

> After some digging, I found the --debug=duplicate option that actually

> shows this happening:

> dup: no src for

> <path_to>/variant_dir/boost/build/include/boost/thread.hpp, unlinking

> old variant copy

> After this my builds fail because the required header file has now

> vanished.

> If I understand correctly one ugly solution would be add every header

> file that the boost build creates to my boost builder so that scons

> knows that the include file was an output of my boost builder.

>

> So my question is:

> 1) Why is scons deleting that file when it doesn't know how to

> recreate it?

>


SCons doesn't see where the thread.hpp header comes from, so it tries to
cleanup your variant build dir by removing possible leftovers. This
wouldn't happen in a "normal" source folder...


> 2) Is there a recommended way to protect the files in the output dir

> from being removed by scons?

>


You'll have to correct the dependencies, such that SCons can make the
connection between your built files and their sources. Where from do you
build the boost stuff? Do you use "duplicate=0" or "duplicate=1" for
your variant build?
Is it really necessary to install boost into every variant dir, or
wouldn't it be sufficient to have one single version for all of them in
the source folder and then use "duplicate=0"?


Best regards,

Dirk




More information about the Scons-users mailing list