[Scons-users] Debugging SCons files as Python scripts
Bill Deegan
bill at baddogconsulting.com
Sun Sep 14 21:16:39 EDT 2014
Tony,
I'm not sure what your concern is. Stick the pdb.set_trace() right before
where you want to debug be it in a SConstruct or a SConscript.
I've done this many times.
-Bill
On Wed, Sep 10, 2014 at 12:27 PM, Tony Whitley <tony_whitley at hotmail.com>
wrote:
> Thanks, I didn't know about that. It would do what I need although our
> whole build takes a couple of minutes before it gets round to our SCons
> files which makes my test harness more agile. Though maybe I could simply
> make my own "parent" sconscript that calls our files and run that.
>
> --
> Tony
>
> On 9 September 2014 00:11, Bill Deegan <bill at baddogconsulting.com> wrote:
>
>> Add the following to your SConstruct or SConscript you wish to debug:
>>
>> import pdb
>> pdb.set_trace()
>>
>> That should pop you into the debugger where you want.
>>
>> -Bill
>>
>>
>> On Sun, Sep 7, 2014 at 3:29 AM, Dirk Bächle <tshortik at gmx.de> wrote:
>>
>>> Hi Tony,
>>>
>>> On 07.09.2014 12:18, Tony Whitley wrote:
>>>
>>>> I'm working with an SCons design that is sufficiently complex to
>>>> require debugging of the scripts themselves. I have been using print
>>>> commands to debug the scripts which is slow and painful. I have finally
>>>> got round to hacking a Python script that simulates parts of SCons so that
>>>> I can run my SCons files as Python scripts in a Python IDE with all the
>>>> benefits of tracing the flow, watching variables and so on. It doesn't do
>>>> any of the "real" stuff like building files, it's a kind-of meta-SCons that
>>>> just produces the information that the SCons engine will consume when it
>>>> builds files. I wondered how others test their SCons scripts, whether I've
>>>> just re-invented the wheel? It seems to me this is a valuable benefit of
>>>> SCons being based on a widely-used language.
>>>>
>>>> It also allows for writing unit tests. I have just dipped a toe into
>>>> that but it looks promising.
>>>>
>>>>
>>> this sounds very interesting indeed. So far, I debugged my scripts by
>>> stepping through the build with a debugger (Eclipse+pydev)...or by "print"
>>> statements in the more simple cases. I don't know of any similar SConstruct
>>> parser out there, so let's hear more about your solution. ;)
>>>
>>> Is there a repo somewhere? Then I'd take a look...
>>>
>>> Best regards,
>>>
>>> Dirk
>>>
>>> _______________________________________________
>>> Scons-users mailing list
>>> Scons-users at scons.org
>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>
>>
>>
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>
>>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20140914/612510b1/attachment.html>
More information about the Scons-users
mailing list