[Scons-users] possible bug

Gary Oberbrunner garyo at oberbrunner.com
Mon May 12 18:41:30 EDT 2014


+1.

--
Gary Oberbrunner
(sent from my Android)
On May 12, 2014 6:18 PM, "Dirk Bächle" <tshortik at gmx.de> wrote:


> Hi Tom,

>

> On 12.05.2014 10:48, Tom Tanner (BLOOMBERG/ LONDON) wrote:

>

>> [...]

>>

>>> 4) Amend your consistency check, allowing SUBST_DICT to not exist (every

>>> rule

>>> has its exception! ;) ).

>>>

>> It's not my consistency check.

>>

>> It's calling 'AllowSubstExceptions()' that causes the issue. And either I

>> have to set up subst_dict or I have to clone the environment and switch

>> that off, neither of which seems very nice

>>

> thanks for the additional info; I see your point now.

>

> I think when I have time I'll dig a little further into this because the

>> code certainly looks like it should work, and the caller doesn't set up

>> LINESEPARATOR either so I don't really understand why that doesn't cause a

>> problem.

>>

>

> The LINESEPARATOR gets initialized in the generate() method. So it has a

> value, unless you'd set it back to "None" on purpose.

>

> The problem with the other exception is created by adding "SUBST_DICT" to

> the varlist of the Builder actions:

>

> _common_varlist = ['SUBST_DICT', 'LINESEPARATOR']

>

> _text_varlist = _common_varlist + ['TEXTFILEPREFIX', 'TEXTFILESUFFIX']

> _text_builder = SCons.Builder.Builder(

> action = SCons.Action.Action(_action, _strfunc, varlist =

> _text_varlist),

>

> The varlist is added to the "contents" of the action, while updating

> signature infos with the callstack:

>

> subst [Environment.py:517]

> get_contents [Action.py:444]

> get_contents [Executor.py:437]

> get_binfo [__init__.py:749]

> make_ready [FS.py:2862]

>

> So the "subst" method tries to expand "${SUBST_DICT}", which throws an

> exception obviously.

> As a first fix, I tried to move "SUBST_DICT" to the varlist of the

> Substfile Builder only:

>

>

> _common_varlist = ['LINESEPARATOR']

> _text_varlist = _common_varlist + ['TEXTFILEPREFIX', 'TEXTFILESUFFIX']

> ...

> _subst_varlist = _common_varlist + ['SUBST_DICT', 'SUBSTFILEPREFIX',

> 'TEXTFILESUFFIX']

>

> This makes the exception go away, and "runtest.py test/textfile.py" still

> passes. But this way the SUBST_DICT wouldn't get watched for changes

> anymore when we use Textfile().

>

> All together, fixing textfile.py by setting "SUBST_DICT = None" as default

> looks like the better option to me.

> Comments anyone?

>

> Regards,

>

> Dirk

>

> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/mailman/listinfo/scons-users

>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20140512/a80a87dc/attachment.htm


More information about the Scons-users mailing list