[Scons-dev] Scons 2.3.2 regression, D tool...

Dirk Bächle tshortik at gmx.de
Sat Aug 9 09:28:04 EDT 2014


Hi Russel,

thanks for the quick reply.

On 09.08.2014 14:02, Russel Winder wrote:
> On Fri, 2014-08-08 at 19:07 +0200, Dirk Bächle wrote:
>> Hi there,
>>
>> we have another user reporting trouble with SCons 2.3.2, in connection
>> to the D tool...so it's time for us to act. I checked the sources, and
>> the user's analysis appears to be partly correct: even when no D tool is
>> present in the current system, the "dmd" tool gets loaded (meaning
>> SCons.Tool.dmd.generate is executed).
> That should not be the case, and wasn't for the tests I made. However I
> only tested on Linux and OSX and this user is using Windows, a platform
> I cannot test on and no-one else bothered to.

Can you do the following test please:

- In the D tools of your local installation, change the names of the 
executables that get detected...such that they can't possibly be found 
in the system (in exists() rename dmd -> foodmd, ...).
- Then create a simple SConstruct:

   env = Environment()
   print env.Dump()

- Run through SCons, and observe that the Environment has D variables (= 
dmd.py Tool got loaded anyway)


This happens, because the line

      d_compiler = FindTool(d_compilers, env) or d_compilers[0]

adds "dmd" to the tool list anyway. In the "default" Tool's generate() 
method, the returned list is simply loaded without checking the 
existence of tools again.


It is okay, and wanted, for as many Tools to get loaded by default...as 
long as their variables don't clash. The "STATIC_AND_SHARED" variable is 
only set by:

- C/C++ compilers (where only the first match gets selected, based on 
the current platform) and
- masm (only under Windows, where it sets the same value as a Windows 
C/C++ compiler -> no clash)

Only the D tools are forcing it back to "0", and this is not compatible 
with the setting that the "msvc" and "mingw" Tool make. This is the main 
culprit, and we either have to remove the explicit setting of 
"STATIC_AND_SHARED" from the D tools (relying on the C/C++ tools to do 
the right thing, or, if they really need the setting under Windows, we 
have to remove the D tools from the "default" toolchain.

So, is "STATIC_AND_SHARED=0" *required* for the D tools to work properly 
under Windows?

Best regards,

Dirk



More information about the Scons-dev mailing list