I’m using windows 2022, where Visual Studio and Windows SDK are in a customized location.
I download the scons 4.0.0 source from github and then build scons. All works fine.
Then I modify some code in scons and would like to verify if scons works fine after that.
I’m doing this by running scons tests by issuing python runtest.py -a
As expected, a lot of test cases fail due to “‘cl’ is not recognized as an internal or external command”, which should be caused by the fact that scons fails to figure out the cl/link/etc. as they are in an abnormal place on my windows.
I go through scons docs and try fixing failed test cases by updating the SConstruct content in test file. For example, for testARAR.py:
Originally it was:
test.write('SConstruct', """
foo = Environment(LIBS = ['foo'], LIBPATH = ['.'])
ar = foo.Dictionary('AR')
bar = Environment(LIBS = ['bar'], LIBPATH = ['.'], AR = r'%(_python_)s wrapper.py ' + ar)
foo.Library(target = 'foo', source = 'foo.c')
bar.Library(target = 'bar', source = 'bar.c')
obj = foo.Object('main', 'main.c')
foo.Program(target = 'f', source = obj)
bar.Program(target = 'b', source = obj)
""" % locals())
I changed that to:
test.write('SConstruct', """
foo = Environment(LIBS = ['foo'], LIBPATH = ['.'] + <my customized lib path>, CPPPATH = <my cusomized include path>, ENV = {'PATH': <my PATH env>})
ar = foo.Dictionary('AR')
bar = Environment(LIBS = ['bar'], LIBPATH = ['.'] + <my customized lib path>, CPPPATH = <my cusomized include path>, AR = r'%(_python_)s wrapper.py ' + ar, ENV = {'PATH' : <my PATH env>})
foo.Library(target = 'foo', source = 'foo.c')
bar.Library(target = 'bar', source = 'bar.c')
obj = foo.Object('main', 'main.c')
foo.Program(target = 'f', source = obj)
bar.Program(target = 'b', source = obj)
""" % locals())`
By doing so, testARAR.py can successfully pass!
However, it is really hard for me to look into every failed test cases, update the Environment function variables in their SConstruct file…
So I wonder if there is any more efficient way for me to go.
Thank you in advance.
wintergrass is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.