[Scons-dev] issue with Alias

Tom Tanner (BLOOMBERG/ LONDON) ttanner2 at bloomberg.net
Mon Feb 9 10:02:38 EST 2015


I rearranged my build a bit and an Alias command started to fail in this code:

Environment.py

1888              # No action, but there are sources.  Re-call all the target 
1889              # builders to add the sources to each target. 
1890              result = [] 
1891              for t in tlist: 
1892                  bld = t.get_builder(AliasBuilder) 
1893                  result.extend(bld(self, t, source)) 
1894              return result 

Digging into it, it appears it is caused by calling this:
Node.py
530          def get_builder(self, default_builder=None): 
531          """Return the set builder, or a specified default value""" 
 532          try: 
 533              return self.builder 
 534          except AttributeError: 
 535              return default_builder 

when self.builder is None.

Moreoever, it appears that the Alias code half expectes get_builder to return None, as a little later on it does this:
1909          result = [] 
1910          for t in tlist: 
1911               ... several lines of comment ...
1915              b = t.get_builder() 
1916              if b is None or b is AliasBuilder: 
1917                  b = bld 
1918              else: 
1919                  nkw['action'] = b.action + action 
1920                  b = SCons.Builder.Builder(**nkw) 

I'm not sure whether I should
1) Change alias to test for bld being None and set it to AliasBuilder (plumped for at the moment as a fix is needed for this)
2) change Node.py to return the default builder if its own builder is None

or (3) find out why the builder is being set to None, but it took me long enough to fnd that was what was happening anyway


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist2.pair.net/pipermail/scons-dev/attachments/20150209/a70d8395/attachment.html>


More information about the Scons-dev mailing list