[Scons-users] Odd --tree output with out-of-source build

Hartmut.Brandt at dlr.de Hartmut.Brandt at dlr.de
Fri Mar 18 06:36:57 EDT 2022


Hi,

I have a strange dependency problem with running at -j24 and try to debug this. Now I discovered an odd behaviour. I have simple setup:

./SConstruct
./sub1
./sub1/foo.cc
./sub1/bar.cc
./sub1/foo.h
./sub1/SConscript

bar.cc and foo.h are empty. foo.cc is

#include "foo.h"
int
main(){}

SConstruct:

env = Environment()

SConscript('sub1/SConscript',
        variant_dir='build',
        duplicate=False)

SConscript:

env = Environment()
p = env.Program('foo', ['foo.cc', 'bar.cc'])

Now when I run scons -tree=status I get:

[E b      ]+-.
[E     C  ]  +-SConstruct
[E b      ]  +-build
[ R    C  ]  | +-sub1/SConscript
[ R    C  ]  | +-sub1/bar.cc
[E B   C  ]  | +-build/bar.o
[ R    C  ]  | | +-sub1/bar.cc
[E     C  ]  | | +-/bin/g++
[E B   C  ]  | +-build/foo
[E B   C  ]  | | +-build/foo.o
[ R    C  ]  | | | +-sub1/foo.cc
[E     C  ]  | | | +-sub1/foo.h
[E     C  ]  | | | +-/bin/g++
[E B   C  ]  | | +-build/bar.o
[ R    C  ]  | | | +-sub1/bar.cc
[E     C  ]  | | | +-/bin/g++
[E     C  ]  | | +-/bin/g++
[ R    C  ]  | +-sub1/foo.cc
[E B   C  ]  | +-build/foo.o
[ R    C  ]  |   +-sub1/foo.cc
[E     C  ]  |   +-sub1/foo.h
[E     C  ]  |   +-/bin/g++
[E b   C  ]  +-sub1
[E     C  ]    +-sub1/SConscript
[E     C  ]    +-sub1/bar.cc
[E     C  ]    +-sub1/foo.cc
[E     C  ]    +-sub1/foo.h

When I change the variant_dir to something outside the tree (/home/user/build/play):

[E b   C  ]+-.
[E     C  ]  +-SConstruct
[E b   C  ]  +-sub1
[E     C  ]    +-sub1/SConscript
[E     C  ]    +-sub1/bar.cc
[E     C  ]    +-sub1/foo.cc
scons: done building targets.

which looks odd. Are out-of-tree builds not supported? Could not find such a hint in the documentation, but I could easily miss it.

Thanks,
harti
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20220318/a090b0da/attachment.htm>


More information about the Scons-users mailing list