[Scons-users] scons-local-2.5.1 build and clean shows random failure

Bill Deegan bill at baddogconsulting.com
Wed Jul 26 22:52:30 EDT 2017


I'm not sure why it didn't consistently fail.
I'll try to make a simple testcase and file a bug.

Glad that you've resolved your issue for now.

-Bill

On Wed, Jul 26, 2017 at 6:22 PM, Bill Deegan <bill at baddogconsulting.com>
wrote:

> See comments inline below..
>
>
> On Wed, Jul 26, 2017 at 11:55 AM, Hua Yanghao <huayanghao at gmail.com>
> wrote:
>
>> I see. So the correct use of VariantDir() is to
>> restrict the second parameter, e.g. the src to
>> be something else rather than "."?
>>
>> e.g. VariantDir() can only take the form:
>> VairantDir(build_dir, src_dir) where src_dir cannot
>> be ".".
>>
>> Worth to add a check that VariantDir() cannot take "."
>> as its src directory?
>>
>
> Having . as src is fine as long as the variantdir is not under .
> So:
> VariantDir('../build/linux64','.')
> Would work fine.
>
>
>>
>> Consider my layout of source code is like this:
>> .
>> ├── arch
>> ├── boards
>> ├── common
>> ├── configs
>> ├── doc
>> ├── drivers
>> ├── external
>> ├── include
>> ├── lib
>> ├── Makefile
>> ├── output
>> ├── README.md
>> ├── SConstruct
>> ├── site_scons
>> ├── soc
>> ├── test
>> ├── TODO
>> └── tools
>>
>> And besides "output" all other folders can be a src folder.
>> And I thought I can use VariantDir() pointing to "output/linux64_full"
>> for all SConscript that SConstruct includes.
>>
>
> A more typical scons layout would be
> src/<arch,boards,... all your source dirs>
> output/<all your variants>
> ... rest of not source directories.
> Then VariantDir('output/linux64','src')
> would work fine.
>
>
>
>>
>> On Wed, Jul 26, 2017 at 5:15 PM, Bill Deegan <bill at baddogconsulting.com>
>> wrote:
>> > There is not general issue with VariantDir(), just the way you used it
>> > created a dependency cycle.
>> >
>> >
>> > output/a was created from .
>> > Then next run
>> > output/a/output/a was created from . into output/a
>> > Now output/a/output/a depends on output/a... see the loop?
>> >
>> > On Wed, Jul 26, 2017 at 4:53 AM, Hua Yanghao <huayanghao at gmail.com>
>> wrote:
>> >>
>> >> Bill, it works now!
>> >>
>> >> I overlooked one thing the SConscript variant_dir should point to
>> >> its specific output dir not the global one for all SConscript file.
>> >>
>> >> +        variant_dir = os.path.join(output, folder)
>> >> +        lib, objs, objs_all = ENV.SConscript(true_scons_file,
>> >> variant_dir=variant_dir)
>> >>
>> >> This this change I am able to build successfully. The other changes
>> >> that required is
>> >> for the include path you need to specific the "true include" path not
>> >> the one that is
>> >> going to be copied into the output/linux64_full folder. With this two
>> >> changes everything
>> >> works fine with 100 build clean -j8 not a single time reproduced any
>> >> issue.
>> >>
>> >> Even though I think I still don't fully understood the reason why
>> >> VariantDir() caused
>> >> the issue. should VariantDir() be removed/deprecated or should it be
>> >> changed in a way
>> >> that it has the same behavior of variant_dir parameter to
>> >> env.SConscript()?
>> >>
>> >> Thanks a lot for your help.
>> >>
>> >> On Wed, Jul 26, 2017 at 12:22 PM, Hua Yanghao <huayanghao at gmail.com>
>> >> wrote:
>> >> > I tried first with the SConscript variant_dir parameter but seems it
>> >> > doesn't work:
>> >> >
>> >> > +        lib, objs, objs_all = ENV.SConscript(true_scons_file,
>> >> > variant_dir=output)
>> >> >
>> >> > And the result is:
>> >> > hua at grass:~/git/usw $ configs/linux64_full.py
>> >> > Running : ./tools/scons config=linux64_full.py
>> >> > scons: Reading SConscript files ...
>> >> > output dir: output/linux64_full
>> >> > output dir: output/linux64_full
>> >> >
>> >> > scons: *** 'output/linux64_full' already has a source directory:
>> >> > 'arch/linux64_full'.
>> >> > File "/home/hua/git/usw/site_scons/common.py", line 61, in
>> BuildObjList
>> >> > hua at grass:~/git/usw $
>> >> >
>> >> > I found that if I want the the build to happen in the
>> >> > output/linux64_full folder
>> >> > I have to call SConscript file from e.g.
>> >> > output/linux64_full/src/SConscript instead of
>> >> > the top level true SConscript file (src/SConscript).
>> >> >
>> >> > Did I use it wrong?
>> >> >
>> >> > On Wed, Jul 26, 2017 at 12:39 AM, Bill Deegan
>> >> > <bill at baddogconsulting.com> wrote:
>> >> >> Yes.. You created dependency cycle..
>> >> >> But only after a build.
>> >> >> Thus why it's showing up only on clean...
>> >> >>
>> >> >> Once you build you have output/linux64_build
>> >> >> Then you say map . to output/linux_64build  which ends up with a
>> >> >> virtual
>> >> >> subdirectory via variantdir of output/linux64_build/output/li
>> nux_64...
>> >> >>
>> >> >> see the issue.
>> >> >>
>> >> >> Variantdirs should never have parent/child relationships.
>> >> >>
>> >> >> I'd advice instead of using VariantDir(), use variant_dir in your
>> >> >> SConscript
>> >> >> call to map like this:
>> >> >>
>> >> >> SConscript('src/SConscript',variant_dir='output/linux64_build/src')
>> >> >> etc..
>> >> >>
>> >> >> See if doing that resolves the issue?
>> >> >>
>> >> >> On Tue, Jul 25, 2017 at 1:03 PM, Hua Yanghao <huayanghao at gmail.com>
>> >> >> wrote:
>> >> >>>
>> >> >>> Yes, that's exactly how I used VariantDir. Any problem seen?
>> >> >>>
>> >> >>> On Tue, Jul 25, 2017 at 6:32 PM, Bill Deegan
>> >> >>> <bill at baddogconsulting.com>
>> >> >>> wrote:
>> >> >>> > Can you paste just the usage of VariantDir() from your build?
>> >> >>> >
>> >> >>> > Are you doing
>> >> >>> >
>> >> >>> > VariantDir('output/linux64_full','.') in your SConstruct?
>> >> >>> >
>> >> >>> >
>> >> >>> > On Tue, Jul 25, 2017 at 8:47 AM, Hua Yanghao <
>> huayanghao at gmail.com>
>> >> >>> > wrote:
>> >> >>> >>
>> >> >>> >> I think I am in, can you see my message there? Got no response.
>> >> >>> >>
>> >> >>> >> On Tue, Jul 25, 2017 at 5:45 PM, Bill Deegan
>> >> >>> >> <bill at baddogconsulting.com>
>> >> >>> >> wrote:
>> >> >>> >> > goto:
>> >> >>> >> > http://webchat.freenode.net/
>> >> >>> >> >
>> >> >>> >> > pick any nickname
>> >> >>> >> > channel is "#scons"
>> >> >>> >> >
>> >> >>> >> > On Tue, Jul 25, 2017 at 8:43 AM, Hua Yanghao
>> >> >>> >> > <huayanghao at gmail.com>
>> >> >>> >> > wrote:
>> >> >>> >> >>
>> >> >>> >> >> On Tue, Jul 25, 2017 at 5:42 PM, Bill Deegan
>> >> >>> >> >> <bill at baddogconsulting.com>
>> >> >>> >> >> wrote:
>> >> >>> >> >> > so you see this most often when:
>> >> >>> >> >> >
>> >> >>> >> >> > scons -j <SOME NUMBER> -c ?
>> >> >>> >> >>
>> >> >>> >> >> Exactly, it fails most often with scons -j8 -c, very rare
>> with
>> >> >>> >> >> scons
>> >> >>> >> >> -j8.
>> >> >>> >> >>
>> >> >>> >> >> > Any chance you can hop on the IRC channel?
>> >> >>> >> >> >
>> >> >>> >> >>
>> >> >>> >> >> If you give me an instruction for howto ... I could try,
>> never
>> >> >>> >> >> really
>> >> >>> >> >> used
>> >> >>> >> >> IRC.
>> >> >>> >> >> _______________________________________________
>> >> >>> >> >> Scons-users mailing list
>> >> >>> >> >> Scons-users at scons.org
>> >> >>> >> >> https://pairlist4.pair.net/mailman/listinfo/scons-users
>> >> >>> >> >
>> >> >>> >> >
>> >> >>> >> >
>> >> >>> >> > _______________________________________________
>> >> >>> >> > Scons-users mailing list
>> >> >>> >> > Scons-users at scons.org
>> >> >>> >> > https://pairlist4.pair.net/mailman/listinfo/scons-users
>> >> >>> >> >
>> >> >>> >> _______________________________________________
>> >> >>> >> Scons-users mailing list
>> >> >>> >> Scons-users at scons.org
>> >> >>> >> https://pairlist4.pair.net/mailman/listinfo/scons-users
>> >> >>> >
>> >> >>> >
>> >> >>> >
>> >> >>> > _______________________________________________
>> >> >>> > Scons-users mailing list
>> >> >>> > Scons-users at scons.org
>> >> >>> > https://pairlist4.pair.net/mailman/listinfo/scons-users
>> >> >>> >
>> >> >>> _______________________________________________
>> >> >>> Scons-users mailing list
>> >> >>> Scons-users at scons.org
>> >> >>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>> >> >>
>> >> >>
>> >> >>
>> >> >> _______________________________________________
>> >> >> Scons-users mailing list
>> >> >> Scons-users at scons.org
>> >> >> https://pairlist4.pair.net/mailman/listinfo/scons-users
>> >> >>
>> >> _______________________________________________
>> >> Scons-users mailing list
>> >> Scons-users at scons.org
>> >> https://pairlist4.pair.net/mailman/listinfo/scons-users
>> >
>> >
>> >
>> > _______________________________________________
>> > Scons-users mailing list
>> > Scons-users at scons.org
>> > https://pairlist4.pair.net/mailman/listinfo/scons-users
>> >
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20170726/e9b15fbc/attachment-0001.html>


More information about the Scons-users mailing list