[Scons-users] Provide default Import to SConscript

Jason Kenny dragon512 at live.com
Fri Feb 23 13:45:36 EST 2018


I don't need to add it at the moment ( the import works as is). I think it would be a good extension to have. Parts, for example, will be adding coloring, and change the way tools load. Some people may not want to have these items added, plus I could break something that did work ( such as they define there own --target switch). Having the ability let user control if the Scontruct is using an extension I think will be critical for having a strong user environment. I can add a function in Parts to control loading parts. however, I think it would be good to have such a design in core SCons.

Jason
________________________________
From: Bill Deegan <bill at baddogconsulting.com>
Sent: Friday, February 23, 2018 11:48 AM
To: Jason Kenny
Cc: SCons users mailing list
Subject: Re: [Scons-users] Provide default Import to SConscript

Re multiple site_dirs..
Go look at http://scons.org/doc/production/HTML/scons-man.html<https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fscons.org%2Fdoc%2Fproduction%2FHTML%2Fscons-man.html&data=02%7C01%7C%7Cf09f4aa1049d46f390f108d57ae5a50e%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636550049083752823&sdata=uymx9lFCPAzFfWg3Zhv9YxM0BYzNXbUnFlwck9nLO5Q%3D&reserved=0> seach for --site-dir.

For posix systems (excluding win, macos, solaris.. see manpage for those) here's the defaults:

/usr/share/scons/site_scons
$HOME/.scons/site_scons
./site_scons

I think this falls under current email subject.

Do you currently need to add UsePartsExtention() in each SConscript? Or can you call it once?

-Bill

On Fri, Feb 23, 2018 at 12:41 PM, Jason Kenny <dragon512 at live.com<mailto:dragon512 at live.com>> wrote:
to clarify I get stuff in via:

SConstruct:
from part import *
...

I know I could have a file in the site_init in the same directory as the SConstruct and run and that will run. No one wants to set this up manually
I forget if we allow more than one location for the site_init. I was hoping more for a place when Parts is installed it can place a file. If that could happen I would like to add a UsePartsExtension() function to control if Parts is used as part of the build or not

Maybe this should be a different talk about allowing users to install and register an extension to SCons

Jason
________________________________
From: Bill Deegan <bill at baddogconsulting.com<mailto:bill at baddogconsulting.com>>
Sent: Friday, February 23, 2018 10:42 AM
To: Jason Kenny
Cc: SCons users mailing list

Subject: Re: [Scons-users] Provide default Import to SConscript

You asked for example to #1.
So you could put in your SConstruct, SConscript before whatever is referenced, or in your site_init

For Parts:
import Parts
import SCons.Script
SCons.Script.Parts=Parts

should work?

On Fri, Feb 23, 2018 at 11:06 AM, Jason Kenny <dragon512 at live.com<mailto:dragon512 at live.com>> wrote:
This is a little terse 😊

How does this file get loaded... is this case 2)? Add it to the site_init?

I am asking as it would be nice if Parts could add a file someplace that would be loaded when SCons starts up, instead of importing Parts directly in the SConstruct.

Jason


________________________________
From: Scons-users <scons-users-bounces at scons.org<mailto:scons-users-bounces at scons.org>> on behalf of Bill Deegan <bill at baddogconsulting.com<mailto:bill at baddogconsulting.com>>
Sent: Friday, February 23, 2018 9:31 AM

To: SCons users mailing list
Subject: Re: [Scons-users] Provide default Import to SConscript

import SCons.Script

def something(...)

SCons.SCript.Something = something



On Fri, Feb 23, 2018 at 10:12 AM, Jason Kenny <dragon512 at live.com<mailto:dragon512 at live.com>> wrote:
I know of Case 2)

Do you have an example of case 1)?

Jason
________________________________
From: Scons-users <scons-users-bounces at scons.org<mailto:scons-users-bounces at scons.org>> on behalf of Gary Oberbrunner <garyo at oberbrunner.com<mailto:garyo at oberbrunner.com>>
Sent: Friday, February 23, 2018 8:42 AM

To: SCons users mailing list
Subject: Re: [Scons-users] Provide default Import to SConscript

In case folks don't know this, here are two ways to get symbols into the namespace that SConscripts start with:
1. Add them to SCons.Script  (which is automatically imported into all SConscripts)
2. Put them in site_init/site_scons.py

The site init file logic (in src/engine/SCons/Script/Main.py) prepends site_scons to sys.path, imports site_init.py into the SCons.Script namespace, as well as prepending site_scons/site_tools to the default tool path.

Also note that in any Python file you can do 'import SCons.Script' and use standard SCons functions like File, Dir, Program, etc.

On Wed, Feb 21, 2018 at 4:47 PM, Jason Kenny <dragon512 at live.com<mailto:dragon512 at live.com>> wrote:
No problem,

If you have any question.. want updated links to it etc.. just let me know. Also as Bill said.. feel free to "steal" any code in Parts to help you with your improvement to SCons.

Best of luck!
Jason
________________________________
From: Scons-users <scons-users-bounces at scons.org<mailto:scons-users-bounces at scons.org>> on behalf of Hua Yanghao <huayanghao at gmail.com<mailto:huayanghao at gmail.com>>
Sent: Wednesday, February 21, 2018 3:29 PM

To: SCons users mailing list
Subject: Re: [Scons-users] Provide default Import to SConscript

Hi Jason,
Indeed it was not Parts, sorry it is my bad.

I will give parts a close look.

Best Regards,
Yanghao

On Wed, Feb 21, 2018 at 9:53 PM, Jason Kenny <dragon512 at live.com<mailto:dragon512 at live.com>> wrote:
> If the namespace object in parts helps you with the import export fixes you
> would like to make. Please feel free you use it/tweak it make this happen
>
> Jason
> ________________________________
> From: Scons-users <scons-users-bounces at scons.org<mailto:scons-users-bounces at scons.org>> on behalf of Bill Deegan
> <bill at baddogconsulting.com<mailto:bill at baddogconsulting.com>>
> Sent: Wednesday, February 21, 2018 2:35 PM
> To: SCons users mailing list
> Subject: Re: [Scons-users] Provide default Import to SConscript
>
> Yangao,
>
> Please keep us up to date with your efforts.
> Take a look at our developer guide, any such would need docs and tests to be
> considered for inclusion to SCons, and any major changes would have to have
> support of the community.
>
> I don't have any time or energy to contribute, I'm working on some core
> SCons logic that requires all the time I have available.
>
> -Bill
> SCons Project Co-Manager
>
>
> On Wed, Feb 21, 2018 at 3:22 PM, Bill Deegan <bill at baddogconsulting.com<mailto:bill at baddogconsulting.com>>
> wrote:
>
>
>
> On Wed, Feb 21, 2018 at 2:59 PM, Hua Yanghao <huayanghao at gmail.com<mailto:huayanghao at gmail.com>> wrote:
>
> Hi Bill,
>
>> SCons is meant to be a python based make replacement.
>
> This is actually very much not true.
>
>
> From the scons.or website:
> "SCons is an Open Source software construction tool—that is, a
> next-generation build tool. Think of SCons as an improved, cross-platform
> substitute for the classic Make utility with integrated functionality
> similar to autoconf/automake and compiler caches such as ccache. In short,
> SCons is an easier, more reliable and faster way to build software."
>
>
> Make is really just dispatching
> commands/keeping track of dependencies and timestamps ... it does not
> provide any Scons Tools libraries etc. In my view somehow scons is
> stuck in the middle of "Make" and a comprehensive build framework like
> "Kbuild", more accurate, yet more difficult compared to pure Make for
> small things, and yet again more difficult compared to full-fledged
> build system due to the lack of a common build framework.
>
>
>
>
> How much time are you willing to commit to development and ongoing support
> of your changes?
>
>
>
>> What your suggesting is probably more along the lines of Parts? (Jason)
>> (Which is build on top of SCons).
>
> I think I saw parts project quite some time ago on company intranet
> ... , but wasn't really what I wanted. I want a single super repo for
> everything a project requires, as compared to be able to build
> independent small things and then stitch them together. Kbuild is
> really what I wanted, kbuild would be perfect if it is build on top of
> python instead of those eye-hurting shell script ... so  I setup and
> build a extremely similar (even better in many ways such as
> inter-configuration dependencies) thing in python/scons (only took a
> few days for the very first working version).
>
>> So if I understand properly, you want to add an alternative version of
>> SConscript where the files would be presented and entirely different set
>> of
>> globals to work with?
>
> Yes, exactly. to bring SConscript from stone-age to industrial-age,
> and yet still allow you to use chisel if you insist ... :)
>
>
> That's nice. Good luck with your efforts.
>
>
>
>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org<mailto:Scons-users at scons.org>
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpairlist4.pair.net%2Fmailman%2Flistinfo%2Fscons-users&data=02%7C01%7C%7C71f860a3b33a46f15a2508d579723b02%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636548453874536512&sdata=ukUWX%2Be4Pb9DrdaLM48LQkZp%2FbU5YkQCwKOUeXeOtvs%3D&reserved=0
>
_______________________________________________
Scons-users mailing list
Scons-users at scons.org<mailto:Scons-users at scons.org>
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpairlist4.pair.net%2Fmailman%2Flistinfo%2Fscons-users&data=02%7C01%7C%7C71f860a3b33a46f15a2508d579723b02%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636548453874536512&sdata=ukUWX%2Be4Pb9DrdaLM48LQkZp%2FbU5YkQCwKOUeXeOtvs%3D&reserved=0

_______________________________________________
Scons-users mailing list
Scons-users at scons.org<mailto:Scons-users at scons.org>
https://pairlist4.pair.net/mailman/listinfo/scons-users<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpairlist4.pair.net%2Fmailman%2Flistinfo%2Fscons-users&data=02%7C01%7C%7C50b78035f9534ba785ea08d57acbb4ad%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636549937679663269&sdata=9%2Fm7jsbf1xgXjLgNQI3mueFHxJy6IUhHNloIHoZj8vI%3D&reserved=0>




--
Gary

_______________________________________________
Scons-users mailing list
Scons-users at scons.org<mailto:Scons-users at scons.org>
https://pairlist4.pair.net/mailman/listinfo/scons-users<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpairlist4.pair.net%2Fmailman%2Flistinfo%2Fscons-users&data=02%7C01%7C%7C8d95978350a0445b925c08d57ad281b9%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636549966888805701&sdata=RO%2FWM3orKI8jNhnCbdT%2BNT9wx0GoCgqsvjosAPm8g44%3D&reserved=0>




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20180223/3890c0aa/attachment-0001.html>


More information about the Scons-users mailing list