[Scons-users] finding out which env causes this error: Two different environments were specified for target

daggs daggs at gmx.com
Fri Mar 25 11:23:12 EDT 2022


Greetings Mats,

> Sent: Friday, March 25, 2022 at 6:03 PM
> From: "Mats Wichmann" <mats at wichmann.us>
> To: "SCons users mailing list" <scons-users at scons.org>, "daggs" <daggs at gmx.com>
> Subject: Re: [Scons-users] finding out which env causes this error: Two different environments were specified for target
>
> On 3/25/22 08:52, daggs wrote:
> > Greetings,
> >
> > is there any way to know which two envs are responsible to the error mentioned on the subject?
>
> At the moment there's no helpful option or other debug aid which spits
> that out (and there should be).
>
> Usually it's a mistake in variant dir usage that causes it, which
> probably won't surprise you since based on earlier email that's what you
> were working on.
>
> Look for places where you might be forcing a path. If the variant dirs
> get to operate naturally you'll have, say, build/a/foo and build/b/foo -
> different paths for foo target, so those will be considered different
> targets and not trigger the error; if you do something clever with paths
> they may end up resolving to the same thing and then scons throws up its
> hands and gives up.
>

I do something like this:
for folder in [ a, b, c ]:
    for modes in [ y. z ]:
        export('mode')
        sconscript("src/" + folder + "/SConscript", variant_dir = "out/" + folder + "." + mode, duplicate = 0. export('env'))

the issue occurs when I define InstallAs in folder b
if I remove it and add prints to the targets, I see them all ok.



More information about the Scons-users mailing list