[Scons-users] Nuitka and Scons, questions, potential bugs, no Windows parallel build

Dirk Bächle tshortik at gmx.de
Mon Nov 11 15:17:01 EST 2013


Hi Kay,

On 11.11.2013 11:49, Kay Hayen wrote:

> Hello,

>

> I am the author of a Python compiler (see

> http://nuitka.net/pages/overview.html in case you are interested) that

> is a heavy user of Scons. Basically what i do is to create C++ and

> other files, and then ask Scons to translate and do it for all kinds

> of platforms and compilers. So far it has served me well.

>

> You can see the scons file I am using here:

> http://nuitka.net/gitweb/?p=Nuitka.git;a=blob;f=nuitka/build/SingleExe.scons;h=0707b76bb4c51f6a0c3c528b311c8d4e80acda32;hb=HEAD

>

> Basically, I am doing some strange stuff, and I wanted your input on

> this.

>

> First of all, for Windows, I am attempting to support MinGW and MSVC

> both, which seems to not be allowed in one environment. Therefore I am

> creating an environment with default tools, and then with mingw to see

> if they work. Is that the best way to do it.

each Environment in SCons has only one variable named "CXX", so you
can't have two different C++ compilers in a single Environment. This is
actually a good thing because it would otherwise confuse SCons (and the
user) about which compiler gets selected for the actual build.
If you want to let the user select which compiler should be used, you
could add an option (AddOption) like "--compiler" that can get set to
"msvc|mingw". In your SConstruct you read the value of this option and
then initialize the build environment with the requested Tool. Note,
that you don't have to let SCons search automatically for the Tools that
exist on the current system. You can explicitly tell it which support
should get included:

env = Environment(tools=['as','link','ar','mingw'])

. You might want to take a peek at the SConstruct for MongoDB (or
Mapnik) to get some ideas about how to support different options...
If you plan to create several builds (native + cross-compiling) on one
system, VariantDirs are your friend.


>

> Second, for MSVC, it does outputs that I cannot prevent it seems. I

> would appreciate warnings, but it does some information that I cannot

> disable. Therefore "setupSpawn", where I basically filter the output

> myself.

>

I can't say anything about it, unless you give an example of how exactly
(copy-paste) the output looks like that you're referring to.


> Also there seemed to be problems with arguments that end in a

> backslash, which paths frequently do, and in one case at least, MSVC

> requires it, or else it won't use it as a directory.

>

Again, a concrete example would help to understand your problem much better.


> For Linux and shared library creations, I noticed that the created

> ".so" file is executable. When people do that, it segfaults of course.

> So Nuitka has elsewhere code to remove the "x" bit. That seems like a

> bug of scons, isn't it? I am not familar enough with "ld" and stuff,

> so I can't tell if it's normal, but I doubt.

>

> And the issue that makes me post here, is that I noticed that

> compilation on Windows is not using the available cores. At first I

> was considering it being related to batch mode or not, but it seems

> the same for MinGW and with and without batch mode for MSVC. Searching

> I found older posts, about the same problem.

>


Have you tried "-j 4" instead of the "--jobs 4" in your
SconsInterface.py? Apart from this, there shouldn't be any
restrictions...can you point me to the older posts that you mentioned?

Best regards,

Dirk



More information about the Scons-users mailing list