There are a number of scripts that do some things the hard way.  Here's
one example:

in bridging/SConscript:
SConscript(os.path.join(env.get('SRC_DIR'), 'extlibs', 'rapidjson',
'SConscript'))

I was in support of this kind of change a while back when asked to
review a few gerrit changes, so I'll take a share of the blame.

os.path.join is a good way for python to join path components together
in a portable way.

fetching SRC_DIR is correct for getting the top of the tree.

but neither are needed in this context: the path is not for generic
usage, rather it's a path given to scons, which does the right thing for
the host OS in question without the extra complexity.  And there's scons
shorthand for top of the tree: a leading # sign is equivalent to a
reference to the directory where the SConstruct file lives (namely, top
of tree).

So the scons-appropriate way to express the above is:

SConscript('#extlibs/rapidjson/SConscript')

Many of the other scripts use this form, and consistency would be easier
for new developers to understand, among other benefits.

Anyone object if I push a changeset aligning the SConscript calls?

Reply via email to