-
-
Notifications
You must be signed in to change notification settings - Fork 338
Running SCons from your git sandbox
python path-to-your-sandbox/scripts/scons.pyIf you run this setup, then whenever the virtualenv is activated, the command scons will just work to run your development version.
$ python -m venv devenv
$ source devenv/bin/activate
$ cd path-to-your-sandbox
$ pip install --editable .Put these lines in a shell script and run the script. If you want to run it regularly, make the script executable and put it in your private bin directory.
#!/usr/bin/env bash
SCONS_LIB_DIR=/path_to_scons/SCons
export SCONS_LIB_DIR
exec python /path_to_scons/SCons/scons.py "$@"You can also run from a checked-out SCons source dir using bootstrap.py, which takes the same args as SCons. That should always use the SCons engine from where bootstrap.py is found.
python /path_to_scons_src/bootstrap.py .If you run the commands by hand, don't include the "exec" in the final line.
scons --debug=pdb <args...>
b SCons/Tool/msvc.py:158 # to stop at that file:line, looks for file in sys.path e.g. your SCONS_LIB_DIRLaurent Marchelli:
I use Eclipse PyDev visual debugger rather than pdb, it works to dig into scons and for debugging my SConscript even on my bitbucket fork PyDev environment : SCONS_LIB_DIR=C:\dev\scons\scons-morpheus\src\engine).
For debugging test scripts (launched by runtest.py), this solution has to get extended somewhat:
Because runtest.py launches another process to execute the test, the pydev debugger is not enough, the pydev remote debugger must be used.
Solution in 5 steps:
- Into your debug configuration's environment variables, add the
PYTHONPATHto thepydevd.pyscript. (Pydev Remote debugger) - Add following line at the top of your test script (e.g.
msvsTests.py) *import pydevd; pydevd.settrace() - Launch PyDev Debug Server.
- Launch the debugger on
runtest.py, the remote debugger will handle the break into your test script. - Enjoy
;-)