diff --git a/.github/workflows/build_executable.yml b/.github/workflows/build_executable.yml index 7f0bb34f..716130a0 100644 --- a/.github/workflows/build_executable.yml +++ b/.github/workflows/build_executable.yml @@ -1,4 +1,4 @@ -name: Build native gdbgui executables +name: Build native gdbgui executables with pyinstaller and pex on: pull_request: @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest] - python-version: [3.9] + python-version: ["3.10"] include: - os: ubuntu-latest buildname: linux @@ -33,7 +33,7 @@ jobs: python -m pip install nox - name: Compile ${{ matrix.buildname }} gdbgui executable run: | - nox --non-interactive --session build_executable_${{ matrix.buildname }} + nox --non-interactive --session build_executables_${{ matrix.buildname }} - name: Upload ${{ matrix.buildname }} executable # if: github.ref == 'refs/heads/master' uses: actions/upload-artifact@v2 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ba95a89a..5cf9e493 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: [3.9] + python-version: ["3.10"] steps: - uses: actions/checkout@v2 @@ -39,7 +39,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: [3.9] + python-version: ["3.10"] steps: - uses: actions/checkout@v2 @@ -78,7 +78,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: "3.10" - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c887b25..5dcb2db8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # gdbgui release history +## 0.15.1.0 + +- Compatibility with Werkzeug 2.1. Use the eventlet server instead of + the Werkzeug development server. +- Use pinned requirements instead of abstract requirements to ensure reproducability of pip installs + ## 0.15.0.1 This release has no changes to features or usability. The only change is to include a file used by other package maintainers. diff --git a/MANIFEST.in b/MANIFEST.in index c07510d1..d87b9bcf 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,6 @@ include README.md include LICENSE -include requirements.in +include requirements.txt graft gdbgui # these files are built and must be included in distribution @@ -30,7 +30,7 @@ exclude jest.config.js exclude make_executable.py exclude mkdocs.yml exclude package.json -exclude requirements.txt +exclude requirements.in exclude tsconfig.json exclude tslint.json exclude webpack.config.js diff --git a/docs/api.md b/docs/api.md index e7db5b43..bbadbc14 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1,78 +1,86 @@ This is the command line help output of gdbgui. ``` -usage: gdbgui [-h] [-g GDB] [--gdb-args GDB_ARGS] [--rr] [-p PORT] - [--host HOST] [-r] [--auth-file AUTH_FILE] [--user USER] - [--password PASSWORD] [--key KEY] [--cert CERT] - [--remap-sources REMAP_SOURCES] [--project PROJECT] [-v] - [-n] [-b BROWSER] [--debug] [--args ...] - [cmd] +usage: gdbgui [-h] [-g GDB_CMD] [-p PORT] [--host HOST] [-r] + [--auth-file AUTH_FILE] [--user USER] [--password PASSWORD] + [--key KEY] [--cert CERT] [--remap-sources REMAP_SOURCES] + [--project PROJECT] [-v] [-n] [-b BROWSER] [--debug] + [--args ...] + [debug_program] A server that provides a graphical user interface to the gnu debugger (gdb). https://github.com/cs01/gdbgui positional arguments: - cmd The executable file and any arguments to pass to it. - To pass flags to the binary, wrap in quotes, or use - --args instead. Example: gdbgui ./mybinary [other- - gdbgui-args...] Example: gdbgui './mybinary myarg - -flag1 -flag2' [other gdbgui args...] + debug_program The executable file you wish to debug, and any + arguments to pass to it. To pass flags to the + binary, wrap in quotes, or use --args instead. + Example: gdbgui ./mybinary [other-gdbgui-args...] + Example: gdbgui './mybinary myarg -flag1 -flag2' + [other gdbgui args...] (default: None) optional arguments: -h, --help show this help message and exit - --args ... Specify the executable file and any arguments to pass - to it. All arguments are taken literally, so if used, - this must be the last argument passed to gdbgui. - Example: gdbgui [...] --args ./mybinary myarg -flag1 - -flag2 + --args ... Specify the executable file you wish to debug and + any arguments to pass to it. All arguments are taken + literally, so if used, this must be the last + argument. This can also be specified later in the + frontend. passed to gdbgui. Example: gdbgui [...] + --args ./mybinary myarg -flag1 -flag2 (default: []) gdb settings: - -g GDB, --gdb GDB Path to debugger. Default: gdb - --gdb-args GDB_ARGS Arguments passed directly to gdb when gdb is invoked. - For example,--gdb-args="--nx --tty=/dev/ttys002" - --rr Use `rr replay` instead of gdb. Replays last recording - by default. Replay arbitrary recording by passing - recorded directory as an argument. i.e. gdbgui - /recorded/dir --rr. See http://rr-project.org/. + -g GDB_CMD, --gdb-cmd GDB_CMD + gdb binary and arguments to run. If passing + arguments, enclose in quotes. If using rr, it should + be specified here with 'rr replay'. Examples: gdb, + /path/to/gdb, 'gdb --command=FILE -ix', 'rr replay' + (default: gdb) gdbgui network settings: - -p PORT, --port PORT The port on which gdbgui will be hosted. Default: 5000 - --host HOST The host ip address on which gdbgui serve. Default: - 127.0.0.1 + -p PORT, --port PORT The port on which gdbgui will be hosted (default: + 5000) + --host HOST The host ip address on which gdbgui serve (default: + 127.0.0.1) -r, --remote Shortcut to set host to 0.0.0.0 and suppress browser - from opening. This allows remote access to gdbgui and - is useful when running on a remote machine that you - want to view/debug from your local browser, or let - someone else debug your application remotely. + from opening. This allows remote access to gdbgui + and is useful when running on a remote machine that + you want to view/debug from your local browser, or + let someone else debug your application remotely. + (default: False) security settings: --auth-file AUTH_FILE - Require authentication before accessing gdbgui in the - browser. Specify a file that contains the HTTP Basic - auth username and password separate by newline. - --user USER Username when authenticating - --password PASSWORD Password when authenticating + Require authentication before accessing gdbgui in + the browser. Specify a file that contains the HTTP + Basic auth username and password separate by + newline. (default: None) + --user USER Username when authenticating (default: None) + --password PASSWORD Password when authenticating (default: None) --key KEY SSL private key. Generate with:openssl req -newkey - rsa:2048 -nodes -keyout host.key -x509 -days 365 -out - host.cert + rsa:2048 -nodes -keyout host.key -x509 -days 365 + -out host.cert (default: None) --cert CERT SSL certificate. Generate with:openssl req -newkey - rsa:2048 -nodes -keyout host.key -x509 -days 365 -out - host.cert + rsa:2048 -nodes -keyout host.key -x509 -days 365 + -out host.cert (default: None) other settings: --remap-sources REMAP_SOURCES, -m REMAP_SOURCES Replace compile-time source paths to local source paths. Pass valid JSON key/value pairs.i.e. --remap- - sources='{"/buildmachine": "/home/chad"}' - --project PROJECT Set the project directory. When viewing the "folders" - pane, paths are shown relative to this directory. - -v, --version Print version + sources='{"/buildmachine": "/current/machine"}' + (default: None) + --project PROJECT Set the project directory. When viewing the + "folders" pane, paths are shown relative to this + directory. (default: None) + -v, --version Print version (default: False) -n, --no-browser By default, the browser will open with gdbgui. Pass - this flag so the browser does not open. + this flag so the browser does not open. (default: + False) -b BROWSER, --browser BROWSER - Use the given browser executable instead of the system - default. + Use the given browser executable instead of the + system default. (default: None) --debug The debug flag of this Flask application. Pass this flag when debugging gdbgui itself to automatically reload the server when changes are detected + (default: False) ``` diff --git a/gdbgui/VERSION.txt b/gdbgui/VERSION.txt index 41db6aa6..dd35abbb 100644 --- a/gdbgui/VERSION.txt +++ b/gdbgui/VERSION.txt @@ -1 +1 @@ -0.15.0.1 +0.15.1.0 diff --git a/gdbgui/server/server.py b/gdbgui/server/server.py index 14d95402..a638d9fd 100644 --- a/gdbgui/server/server.py +++ b/gdbgui/server/server.py @@ -90,7 +90,6 @@ def run_server( ) print("exit gdbgui by pressing CTRL+C") - os.environ["WERKZEUG_RUN_MAIN"] = "true" try: socketio.run( app, diff --git a/make_executable.py b/make_executable.py index 4d548152..d8a0cdaf 100644 --- a/make_executable.py +++ b/make_executable.py @@ -95,9 +95,8 @@ def main(): spec_path, "--distpath", distpath, - "--key", - "a5s1fe65aw41f54sa64v6b4ds98fhea98rhg4etj4et78ku4yu87mn", - ] + ], + check=True, ) verify(binary_path, __version__) generate_md5(binary_path, distpath / f"{binary_name}.md5") diff --git a/noxfile.py b/noxfile.py index e0803838..4414a8cf 100644 --- a/noxfile.py +++ b/noxfile.py @@ -8,7 +8,7 @@ nox.options.reuse_existing_virtualenvs = True nox.options.sessions = ["tests", "lint", "docs"] -python = ["3.9"] +python = ["3.10"] prettier_command = [ "npx", @@ -22,7 +22,7 @@ doc_dependencies = [".", "mkdocs", "mkdocs-material"] lint_dependencies = [ - "black==20.8b1", + "black==22.3.0", "vulture", "flake8", "mypy==0.782", @@ -129,6 +129,7 @@ def serve(session): @nox.session(reuse_venv=True) def build(session): + """Build python distribution (sdist and wheels)""" session.install(*publish_deps) session.run("rm", "-rf", "dist", "build", external=True) session.run("yarn", external=True) @@ -136,6 +137,7 @@ def build(session): session.run("python", "setup.py", "--quiet", "sdist", "bdist_wheel") session.run("twine", "check", "dist/*") for built_package in glob.glob("dist/*"): + # ensure we can install the built distributions session.run("pip", "install", "--force-reinstall", built_package) @@ -160,49 +162,51 @@ def publish_docs(session): session.run("mkdocs", "gh-deploy") -@nox.session(reuse_venv=True) -def build_executable_current_platform(session): +@nox.session(reuse_venv=True, python="3.10") +def build_executables_current_platform(session): session.run("yarn", "install", external=True) session.run("yarn", "build", external=True) - session.install(".", "PyInstaller>=4.5, <4.6") + session.install(".", "PyInstaller==5.1") session.run("python", "make_executable.py") session.notify("build_pex") @nox.session(reuse_venv=True) -def build_executable_mac(session): +def build_executables_mac(session): if not platform.startswith("darwin"): raise Exception(f"Unexpected platform {platform}") - session.notify("build_executable_current_platform") + session.notify("build_executables_current_platform") @nox.session(reuse_venv=True) -def build_executable_linux(session): +def build_executables_linux(session): if not platform.startswith("linux"): raise Exception(f"Unexpected platform {platform}") - session.notify("build_executable_current_platform") + session.notify("build_executables_current_platform") @nox.session(reuse_venv=True) def build_executable_windows(session): if not platform.startswith("win32"): raise Exception(f"Unexpected platform {platform}") - session.notify("build_executable_current_platform") + session.notify("build_executables_current_platform") -@nox.session(python=python) +@nox.session def build_pex(session): """Builds a pex of gdbgui""" # NOTE: frontend must be built before running this - session.install("pex==2.1.45") + session.install("pex==2.1.93") pex_path = Path("build/executable/gdbgui.pex") session.run( "pex", ".", - "-c", + "--console-script", "gdbgui", - "-o", + "--output-file", str(pex_path), + "--sh-boot", + "--validate-entry-point", external=True, ) checksum = hashlib.md5(pex_path.read_bytes()).hexdigest() diff --git a/requirements.in b/requirements.in index 5f4e1f5d..e2b2c46b 100644 --- a/requirements.in +++ b/requirements.in @@ -1,4 +1,5 @@ Flask-SocketIO>5.1, <5.2 Flask-Compress>1.10, <1.11 pygdbmi>=0.10.0.0, <0.11 -Pygments>=2.2.0, <3.0 \ No newline at end of file +Pygments>=2.2.0, <3.0 +eventlet diff --git a/requirements.txt b/requirements.txt index f899de4a..b5bcbe92 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with python 3.9 +# This file is autogenerated by pip-compile with python 3.10 # To update, run: # # pip-compile requirements.in @@ -10,6 +10,10 @@ brotli==1.0.9 # via flask-compress click==8.0.1 # via flask +dnspython==2.2.1 + # via eventlet +eventlet==0.33.0 + # via -r requirements.in flask==2.0.1 # via # flask-compress @@ -18,6 +22,8 @@ flask-compress==1.10.1 # via -r requirements.in flask-socketio==5.1.1 # via -r requirements.in +greenlet==1.1.2 + # via eventlet itsdangerous==2.0.1 # via flask jinja2==3.0.1 @@ -32,5 +38,7 @@ python-engineio==4.2.1 # via python-socketio python-socketio==5.4.0 # via flask-socketio +six==1.16.0 + # via eventlet werkzeug==2.0.1 # via flask diff --git a/setup.py b/setup.py index 2f168b8a..09c75116 100644 --- a/setup.py +++ b/setup.py @@ -60,7 +60,7 @@ }, zip_safe=False, install_requires=distutils.text_file.TextFile( - filename="./requirements.in" + filename="./requirements.txt" ).readlines(), classifiers=[ "Intended Audience :: Developers",