Re: finding out which env causes this error: Two different environments were specified for target
daggs <[email protected]>
| Newsgroups | gmane.comp.programming.tools.scons.user |
|---|---|
| Message-ID | <trinity-b5b2aba4-9fe7-416a-8405-dcc564bbe4c4-1648221792711@3c-app-mailcom-bs07> |
Greetings Mats, > Sent: Friday, March 25, 2022 at 6:03 PM > From: "Mats Wichmann" <[email protected]> > To: "SCons users mailing list" <[email protected]>, "daggs" <[email protected]> > 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.