[Scons-users] Dependency cycles from C++ standard library headers

Mats Wichmann mats at wichmann.us
Thu Sep 14 18:17:31 EDT 2023


On 9/14/23 11:44, Bill Deegan wrote:
> I'd vote for changing the program name.
> Simpler and unless you're really stuck on having files matching c++ 
> header file names, no reason not to change?

...

>         For example, if map.cc contains:
> 
>            #include <map>
>            int main(int, char **) { }
> 
>         and SConstruct contains:
> 
>            Program('map', ['map.cc'])
> 
>         scons fails with:
> 
>            scons: *** Found dependency cycle(s):
>              map -> map.o -> map
> 
>         Same thing for programs called "random", "string", "vector", etc.

Meanwhile, I'd argue this is a bug.

The standard headers certainly aren't in the build directory, so why 
(disregarding actual implementation details which make it so) should 
this be flagged as a dependency cycle?

At the very least, we should find someplace to document this as it's 
clearly a "surprise". There are like 200 of these from 
libstdc++-devel... are all of those ineligible for use as target names 
if the header happens to be included?






More information about the Scons-users mailing list