[Scons-users] Substfile / Textfile builders

Mats Wichmann mats at wichmann.us
Wed Oct 10 14:12:03 EDT 2018


This topic is from https://github.com/SCons/scons/issues/3147

Bill suggested it ought to move here for a while, I'm following up to
try to move it forward, since the issue has sat for a few months now.

substfile and textfile have to be imported explicity (tools=[...])

The issue filer suggests they should be part of default.

The default comes from the list GlobalDefaultBuilders in
Scripts/__init__.py.  The docs aren't really clear on whether a given
builder is part of the default or needs to be listed. The manpage entry
contains a substfile example which hints it's not default, though it
does not say anything explicitly:

  env = Environment(tools = ['default', 'textfile'])

  env['prefix'] = '/usr/bin'
  script_dict = {'@prefix@': '/bin', '@exec_prefix@': '$prefix'}
  env.Substfile('script.in', SUBST_DICT = script_dict)
  ...

The textfile example, on the other hand, does not show the creation of
the environment, just dives right in:

  # builds/writes foo.txt
  env.Textfile(target = 'foo.txt', source = ['Goethe', 42, 'Schiller'])
  ...

So I guess there are three questions here:

(a) should substfile and testfile be part of the default?
(b) is there any guideline for default/not-default within scons?
(c) can we come up with wording for the manpage to indicate whether a
builder is default or needs to be specified? or is that too fragile
since it has to be kept up to date manually at the moment?



More information about the Scons-users mailing list