[Scons-users] Question about binfo

Tom Tanner trtanner at btinternet.com
Thu Feb 25 17:47:04 EST 2016


On 25/2/16 21:05, Dirk Bächle wrote:
> Hi Tom,
>
> On 25.02.2016 16:55, Tom Tanner (BLOOMBERG/ LONDON) wrote:
>> In the Node/__init__.py, in the clear() method, it says this:
>>
>> # The del_binfo() call here isn't necessary for normal execution,
>> # but is for interactive mode, where we might rebuild the same
>> # target and need to start from scratch.
>> self.del_binfo()
>>
>> This is causing me some interesting problems. I'm trying to stash the 
>> *ENTIRE* command line used to build an object (partly for
>> rerunning commands, partly for getting better details of actual 
>> command line changes rather than the rather brief summary produced
>> currently).
>>
>> Actually calculating the command line seems to be somewhat expensive 
>> (you would not believe the length of one of ours) so I wanted
>> to only calculate it on an as needed basis and then stick it in the 
>> nodes binfo so it gets saved the the .scons.dblite file.
>>
>> But that line above stops this working. And I'm not sure I see the 
>> point of it. If 'interactive' should repeatedly build an object
>> even if nothing has changed, wouldn't it be better to delete the 
>> object instead?
>>
>
> the basic idea behind this is to save time in the "Interactive mode". 
> All SConstructs/SConscripts get read only once, and from then on you 
> assume that the underlying graph of file nodes, and their dependencies 
> among each other and to the created build environments, doesn't change 
> anymore.
> This enables you to work with small code-compile cycles in very large 
> codebases, where you fire up "interactive mode" and then repeatedly 
> build the node (program/lib) you're currently interested in.
> For this to work properly, SCons has to keep the Node, but reset all 
> info about whether the Node is up-to-date or not. This is what is 
> meant by "starting from scratch"...
>
It's a bit late so my brain might not be firing on all 4 cylinders, but 
- why would it want to forget whether or not a node is up to date? It 
sounds like in interactive mode, if you change a1.cc and build liba, 
then change a2.cc and build liba, it'll compile a1 again (I've never 
used interactive mode, so I have no idea if this is how it works, but 
isn't that the effect of this?)

This functionality I'm adding isn't terrifically helpful in interactive 
mode, but in normal build mode, it seems to lead to calculating the 
contents of the binfo twice - at least I think that's what the trace I 
added was implying. Once when you build an object, and a 2nd time when 
something else that is dependant on that object gets evaluated for build 
(I will try and get more details on this when I'm a bit more awake). If 
that's so it's rather a dis-optimisation for a non-interactive build.

A minimum is there a way of telling if you're in interactive mode, so as 
not to execute this bit of code?

Cheers

TT


More information about the Scons-users mailing list