[Scons-users] Provide default Import to SConscript

Jonathon Reinhart jonathon.reinhart at gmail.com
Fri Feb 16 19:18:43 EST 2018


Hua,

If you are importing lots of variables into SConscripts, then you're using
SCons wrong. Most of your variables should probably be construction
variables (in the environment).

I've written many, many SConscripts and I've never used more than 3 or 4
Import() statements in a single SConscript. Before you critique a
long-established framework, you might want to consider if you're using it
inappropriately.

Jonathon



On Fri, Feb 16, 2018 at 6:02 PM, Hua Yanghao <huayanghao at gmail.com> wrote:

> Will do. It is really not good if a particular framework force user to
> create repeated code. In comparison kbuild can easily create a one line
> make file for a module.
>
> I am using localized scons anyway if not accepted will just use it on my
> own.
>
> On Fri, Feb 16, 2018 at 22:46 Bill Deegan <bill at baddogconsulting.com>
> wrote:
>
>> Feel free to make a pull request, though I can't promise that it will be
>> accepted.
>>
>> Is it really that much of an inconvenience?
>> -Bill
>>
>>
>> On Fri, Feb 16, 2018 at 3:20 PM, Hua Yanghao <huayanghao at gmail.com>
>> wrote:
>>
>>> Hi Bill,
>>> Do you think if it is useful to add a new keyword for
>>> env.SConscript(default_imports=[xyz,abc,...])?
>>> For return I think I can abuse some global variables. This can really
>>> make the SConscript clean/minimal.
>>>
>>> Best Regards,
>>> Yanghao
>>>
>>> On Fri, Feb 16, 2018 at 9:09 PM, Bill Deegan <bill at baddogconsulting.com>
>>> wrote:
>>> > No, there is no way without hacking the core code.
>>> >
>>> > It is the way it is by design.
>>> >
>>> > -Bill
>>> > SCons Project Co-Manager
>>> >
>>> > On Fri, Feb 16, 2018 at 2:28 PM, Hua Yanghao <huayanghao at gmail.com>
>>> wrote:
>>> >>
>>> >> Does anyone know in scons there are ways to implicitly make a object
>>> >> (e.g. xyz) available for SConscript without explicity Import(xyz)?
>>> >>
>>> >> Just want to eliminate the annoying repeated Import(xyz) in every
>>> >> single SConscript.
>>> >>
>>> >> And what about implicit Return()? e.g. xyz() returns a list of object,
>>> >> then in every SConscript if the top level SConstruct want to collect
>>> >> the complete list of object returned from every single SConscript.
>>> >>
>>> >> For example:
>>> >> SConscript-1:
>>> >> Import("xyz")
>>> >>
>>> >> ret = xyz(...)
>>> >>
>>> >> Return("ret")
>>> >>
>>> >> Would ideally become:
>>> >> SConscript-2:
>>> >> xyz(...)
>>> >>
>>> >> Thanks,
>>> >> Yanghao
>>> >> _______________________________________________
>>> >> 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/20180216/c615ee47/attachment.html>


More information about the Scons-users mailing list