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

William Deegan bill at baddogconsulting.com
Thu Nov 15 02:09:58 EST 2012


On 11/14/2012 09:18 PM, Dmitry Mikhin wrote:

> 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?


Yes it applies to the whole directory.


>

>> 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.


That's probably better, because it's easier to get the source and the
target confused otherwise.


>

>>> 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.


Small test case would be the best!

>

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

>> understand duplicate,etc..

> I thought I did! And that was the main problem :)

:)


Hope that helps!
=-Bill


More information about the Scons-users mailing list