[Scons-users] Identical file names in VariantDir and source dir

Dmitry Mikhin dmitry.mikhin at gmail.com
Thu Nov 15 00:18:09 EST 2012


Hi William,

Thanks for the prompt reply.


> You can enforce that all files aren't copied via the duplicate=0 argument to

> VariantDir()


Yes, I know about the duplicate and use it when necessary, but this
was not the intent in this case. Correct me if I'm wrong, but
"duplicate" applies to the entire VariantDir directory, you cannot
cherry-pick separate files, right?


> You can have your builder use ${SOURCE.srcpath} instead of $SOURCE (see

> manpage and search for ${SOURCE.srcpath}), which is likely your best choice

> if you don't want to disable duplication.

>

> You could also use the --duplicate command line flag or use SetOption() to

> tell SCons to copy instead of soft or hard linking the files.


For now I'm just renaming everything to be safe (and to find out all
the black spots in the process; 14 tests so far, but none major to my
relief). The srcpath is a good suggestion, I'll see if the builder can
use it.


>> 2. Can SCons warn about this behavior? IMO, the presence of two files

>> with identical names suggests that the same node can be "created" by

>> two methods, and generally SCons would catch it.

>

>

> Good point. Can you file a bug with a sample SConstruct to replicate the

> issue?


I'll file a ticket. It's a bit harder with the example because I'm
using too many custom builders to arrive at the result. Probably will
write a small test case instead of cutting the large project.


> Understandably. That said, when working with VariantDirs it's important to

> understand duplicate,etc..


I thought I did! And that was the main problem :)
Cheers,
Dmitry


More information about the Scons-users mailing list