[Scons-users] Mixing VariantDirs with "in-tree" build

Bill Deegan bill at baddogconsulting.com
Mon Jan 28 18:51:33 EST 2019


See below

On Mon, Jan 28, 2019 at 12:33 PM Tobias Herzog <pasdVn3 at gmx.de> wrote:

> Hi scons users,
>
> consider the following demo project:
>
> +-SConsctuct
> +-A
>   +-SConscript
>   +-B
>     +-SConscript
>     +-foo.src
>
>
> With SConstruct:
>         SConscript('A/B/SConscript')
>         SConscript('A/SConscript', variant_dir='build', duplicate=0)
>
> A/SConscript:
>         Command(source='B/foo',
>                 target='bar',
>                 action='cat $SOURCE > $TARGET')
> A/B/SConscript:
>         Command(target='foo',
>                 source='foo.src',
>                 action='cat $SOURCE > $TARGET')
>
>
> No I do:
> > scons -Q --tree=all build/bar
> scons: *** [build/bar] Source `A/B/foo' not found, needed by target
> `build/bar'.
> +-build/bar
>   +-A/B/foo
>   +-/bin/cat
>
> and
> >scons -Q --tree=all A/B/foo
> cat A/B/foo.src > A/B/foo
> +-A/B/foo
>   +-A/B/foo.src
>   +-/bin/cat
>
>
> I know that this is a quite strage project setup, but nevertheless I
> would expect scons to detect the depencies correct. Is this a bug, or
> am I missing something?
>

You're missing something.
By saying:

SConscript('A/SConscript', variant_dir='build', duplicate=0)

This is the same as:
VariantDir('build','A', duplicate=0)
SConscript('build/SConscript')

So when you're asking for B/foo from that SConscript, you're actually
asking for build/B/foo.
If you changed it to "#/A/B/foo" it would work, or "../A/B/foo"



> If I Return/Export the foo-node and use it in the Command in
> A/SConscript it works as intended.
>
>
> Thanks,
> Tobias
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20190128/2709a20e/attachment.html>


More information about the Scons-users mailing list