CHANGED_TARGETS has no properties
This issue was originally created at: 2010-01-11 15:52:39.
This issue was reported by: coppro.
coppro said at 2010-01-11 15:52:39
The CHANGED_TARGETS variable (and I assume CHANGED_SOURCES, UNCHANGED_SOURCES, and UNCHANGED_TARGETS, though I don't have time to check) does not have any of the properties such as suffix or abspath that TARGETS does. The documentation implies that they do, and there is no real reason for them not to.
gregnoel said at 2010-02-03 14:55:48
Bug party triage.
Flagging as doc issue for now, and assigning so I take a look.
I don't think the docs imply this. They're just lists (well, they're TSList, which is a subclass of UserList), and don't provide any unusual attributes. Individual nodes in the lists, if they happen to be nodes, should have these.
@bdbaddog - invalid / close?
TSList has the note:
we subclass
collections.UserListpurely so that theis_Sequence()function will identify an object of this class as a list during variable expansion. We're not really using anycollections.UserListmethods in practice
I'd say this is a bug.
You'll have to explain... the various *TARGETS and *SOURCES variables are just lists, why should they have attributes that only make sense in the context of an individual node (i.e. member of list)? The manpage doesn't seem to say otherwise, despite what the bugreport claims.
self.lvars = {
'CHANGED_SOURCES' : TSList(self._get_changed_sources),
'CHANGED_TARGETS' : TSList(self._get_changed_targets),
'SOURCE' : TSObject(self._get_source),
'SOURCES' : TSList(self._get_sources),
'TARGET' : TSObject(self._get_target),
'TARGETS' : TSList(self._get_targets),
'UNCHANGED_SOURCES' : TSList(self._get_unchanged_sources),
'UNCHANGED_TARGETS' : TSList(self._get_unchanged_targets),
}
From subst:
# away soon anyway. We just let these expand to $TARGETS
# because that's "good enough" for the use of ToolSurrogates
# (see test/ToolSurrogate.py) to generate documentation.
dict['CHANGED_SOURCES'] = '$SOURCES'
dict['UNCHANGED_SOURCES'] = '$SOURCES'```
subst is overwriting those..
lovely
commnet lines 293,294, 319,320, and then it seems to work.
okay, I see there's a TargetsAndSources class which defers but eventually does produce a NodeList - the Util one, which does return the requested attribute from each member. So I guess that was designed to work as the OP expected.
Never pursued this to its conclusion... so the "lines 293,294,319,320" refers to Subst, namely:
dict['CHANGED_TARGETS'] = '$TARGETS'
dict['UNCHANGED_TARGETS'] = '$TARGETS'
#...and...
dict['CHANGED_SOURCES'] = '$SOURCES'
dict['UNCHANGED_SOURCES'] = '$SOURCES'
If so, the comment in there suggests this setting is needed for something (i.e. commenting out the lines may not be right), what do we do about that?
# This is a total cheat, but hopefully this dictionary goes
# away soon anyway. We just let these expand to $TARGETS
# because that's "good enough" for the use of ToolSurrogates
# (see test/ToolSurrogate.py) to generate documentation.
The comment is wrong I believe. and predates setting those values elsewhere... if I remember correctly.