I have a SCons script that I need to debug. Somewhere down inside of everything that is happening, I have a problem and I need to find out where it is going bad.
I'd like to debug the SCons script, but I'm not sure how to get it set up. I have both PyCharm and Komodo IDEs, but I couldn't figure out how to make those work.
I've tried this:
scons --debug=pdb <args...>
but that just gets me inside of SCons; I need to be inside of the scripts that I've created that SCons runs.
Can someone show me how to set up PyCharm or Komodo to debug a SCons script? If that isn't possible, I'm open to other debugging options.
In your SConstruct:
import pdb
pdb.set_trace()
And you'll drop into the debugger inside your SConstruct (or SConscript if that's what you're trying to debug).
With PyCharm you can use remote debugging.
Find the remote debugger package in your PyCharm installation:
Install the egg using easy_install. It should be found in your Python deployment. On Windows look into the Scripts folder.
Follow the Remote Debugging HowTo.
Run the Python code you would like to debug in any way you want, it will connect to PyCharm's debug server and stop in the script.
Screenshot of debugging Godot's SConstruct file:
Scons was executed from a Visual Studio command line in order to receive the right environment variables for the build (not from PyCharm).
UPDATE: A simpler solution is to add a run configuration directly for scons.py itself. You can issue a SET command in an Visual Studio command prompt, copy all environment variables printed and paste into the Environment setting of the run configuration inside PyCharm. With that configuration you can debug the whole scons based build, including your SConstruct file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With