[Scons-users] tracing to where a target was defined

Mats Wichmann mats at wichmann.us
Sun Aug 6 14:41:27 EDT 2023


On 8/6/23 02:28, daggs wrote:
> Greetings,
> 
> I have a project that fails with the following error:
> scons: *** [output/target/foo] Source `src/foo/foo' not found, needed by target `output/target/foo'.
> 
> output/target/foo is copied from src/goo/foo and I clearly define src/goo/foo as source of the copy
> I suspect that src/foo/foo is defined elsewhere in the code but I'm unable locate it in code review so I was wondering if
> there is away to print a stack trace when  target is defined?

There's not anything specific to do that out of the box.

For things you suspect might be a problem you can capture the return 
value from the builder, which will be a list of SCons Nodes, which you 
can then examine. But your problem seems to be with a source...

ret = Program(target="foo", source=["foo.c])
for node in ret:
     print(node.name)

There is some issue where a target has the same name as a directory, 
maybe that's true for sources as well?  See:

https://github.com/SCons/scons/issues/4282




More information about the Scons-users mailing list