From 2ecc8fad50486c8da05e96988b8b71ce491e7622 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Tue, 27 Apr 2021 14:27:22 +0200 Subject: [PATCH] tools: Add various fixes for idf.py gdbgui Closes https://github.com/espressif/esp-idf/issues/5968 --- requirements.txt | 3 ++- tools/idf_py_actions/debug_ext.py | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index f972f448f9..8e24162478 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,7 +17,8 @@ gdbgui==0.13.2.0 # Windows is not supported since 0.14.0.0. See https://github.com/cs01/gdbgui/issues/348 pygdbmi<=0.9.0.2 # The pygdbmi required max version 0.9.0.2 since 0.9.0.3 is not compatible with latest gdbgui (>=0.13.2.0) -python-socketio<5; python_version<="2.7" +# A compatible Socket.IO should be used. See https://github.com/miguelgrinberg/python-socketio/issues/578 +python-socketio<5 kconfiglib==13.7.1 diff --git a/tools/idf_py_actions/debug_ext.py b/tools/idf_py_actions/debug_ext.py index 4d882baaee..d9c43cb9e5 100644 --- a/tools/idf_py_actions/debug_ext.py +++ b/tools/idf_py_actions/debug_ext.py @@ -203,8 +203,13 @@ def action_extensions(base_actions, project_path): args += ['--port', gdbgui_port] gdbgui_out_name = os.path.join(local_dir, GDBGUI_OUT_FILE) gdbgui_out = open(gdbgui_out_name, 'a+') + env = os.environ.copy() + # The only known solution for https://github.com/cs01/gdbgui/issues/359 is to set the following environment + # variable. The greenlet package cannot be downgraded for compatibility with other requirements (gdbgui, + # pygdbmi). + env['PURE_PYTHON'] = '1' try: - process = subprocess.Popen(args, stdout=gdbgui_out, stderr=subprocess.STDOUT, bufsize=1) + process = subprocess.Popen(args, stdout=gdbgui_out, stderr=subprocess.STDOUT, bufsize=1, env=env) except Exception as e: print(e) raise FatalError('Error starting gdbgui. Please make sure gdbgui can be started', ctx)