[Scons-dev] SystemPlatform (Was: SCons tools refactoring progress)

Jason Kenny dragon512 at live.com
Thu Oct 22 16:41:00 EDT 2015


This object at the moment provides an os-arch value. 

You need to look at some other code as well.

This is the API for adding new arch or os types. 
https://bitbucket.org/sconsparts/parts/src/eff0e3f4a87aca234c17cce806c7d882ed02a260/parts/api/platforms.py?at=master&fileviewer=file-view-default 
 
This code has the map for all known os and arch types. You should notice that stuff like “i386” is mapped to x86. 
https://bitbucket.org/sconsparts/parts/src/eff0e3f4a87aca234c17cce806c7d882ed02a260/parts/glb.py?at=master&fileviewer=file-view-default 

On feature of the object as is allow us to map the data as an object or separate items. So 

env[“TARGET_ARCH”]==”x86”
env[“TARGET_PLATFORM”]==”any-x86”
env[“TARGET_PLATFORM”]==”x86”

you can also say this … but seem like work to me
env[“TARGET_PLATFORM”].ARCH==”x86”
env[“TARGET_PLATFORM”]==SystemPlatform(os=”any”,arch=”x86”)


are all the same result. Some cases a person can argue that a given case is more clear than the other. In that way I just providing a solution. Beyond that this allows for some compatibility if we decided to add some more information to this object, such as CPU type (  ie this is a i7 or i5) without breaking existing code.

OSBit() is documented… it should be the os bitness of the current OS ( ie the HOST). 
ChipArchitecture() is the host chip architecture

I added them to be used because it might be useful. However it main purpose is to set the default value of the SystemPlatform object to that of the host.

I don’t have anything for a direct JSON mapping, so I don’t know what would happen there. But that is easily to fix.

Given the idea of breaking Parts up in to separate projects so it would be easier to use in SCons, I would agree this is one of the components that I would want to do this with. 

Jason

Sent from Mail for Windows 10



From: anatoly techtonik
Sent: Thursday, October 22, 2015 11:36 AM
To: SCons developer list
Subject: [Scons-dev] SystemPlatform (Was: SCons tools refactoring progress)


On Wed, Oct 21, 2015 at 5:33 PM, Jason Kenny <dragon512 at live.com> wrote:
My point here is that I think Scons would be a more robost system if for example we add some form of the Parts  SystemPlatform object to Scons as this become a common and standard way to express an important concept in a build system, no matter if your tool chain is platform independent for the target output or not.

http://parts.stage.tigris.org/source/browse/parts/trunk/parts/parts/platform_info.py?revision=150&view=markup

What are usage stories for that? I see the immediate one to provide "bitness" info as:
1. Python process bitness
2. OS bitness
3. CPU bitness

What will be the serialization of PlatformInfo to JSON? Looks like it is serialized into string now and that string has some pretty limited values. What is the full list, by the way - is it possible to dump it?


I'd wrap it an upload as a separate project to PyPI, because this bitness stuff is a pretty common need even for building Python extensions.
-- 
anatoly t.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist2.pair.net/pipermail/scons-dev/attachments/20151022/122b4c7a/attachment.html>


More information about the Scons-dev mailing list