Issue with Windows escaping commands / lib for Makefile porting

RW via Scons-users <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <CAMMCZ5OV2aaLX3jXzROAFZuMc5_Qd4SEmiZy1WCLUi4hXVR=yQ@mail.gmail.com>
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

_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.