[Scons-users] Debugging SCons files as Python scripts

Bill Deegan bill at baddogconsulting.com
Mon Sep 8 19:11:07 EDT 2014


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20140908/82d4451b/attachment.html>


More information about the Scons-users mailing list