[Scons-users] Issue with Windows escaping commands / lib for Makefile porting

RW garlicbready at googlemail.com
Sat Sep 21 12:05:54 EDT 2019


Hi,
I've recently been working on a library for use with porting Makefile build
systems across to scons.
https://github.com/Hecatron/py-makefile-dbparse
It's not finished yet but the general gist is it uses make to extract
information from Makefiles so that with a complex project you don't have to
port all the Makefiles across at one time. Instead you can extract info
from the make database then read it into something python based like scons
with the idea being to move one Makefile across at a time while still being
able to test / build everything.

Anyway one thing that I noticed recently and I'm not sure if it's something
specific to my machine is that there seems to be issues with running scons
under windows. In that the way it's escaping commands
What seems to be happening is that the outer command and the inner file
parameter are both being surrounded by double quotes leading to

cl
/FoD:\SourceCode\GitRepos.Hecatron\py-makefile-dbparse\examples\example2\build\hellomake.obj
/c hellomake.c /nologo /Iinclude
'\"cl
/FoD:\SourceCode\GitRepos.Hecatron\py-makefile-dbparse\examples\example2\build\hellomake.obj
/c \"hellomake.c\" /nologo /Iinclude\"' is not recognized as an internal or
external command,

One workaround is to override the escape function

def win_escape(x):
    if x[-1] == '\\':
        x = x + '\\'
    return x

env['ESCAPE'] = win_escape

I've tried this on scons 3.1.1 and 3.0.3 with similar results which seems
kind of weird since I don't remember this happening before the last time I
looked at scons but that might have been an eariler version of 3.0
maybe it's a dependency, or just the fact I'm using python 3.7.3
One example here (the virtenv directory contains scripts for setting up a
virtual python environment)
https://github.com/Hecatron/py-makefile-dbparse/blob/master/examples/example2/src/sconstruct.py

Many Thanks
Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20190921/78633106/attachment.html>


More information about the Scons-users mailing list