* install uv and use it to create venv
* fix lint.sh to use all necessary deps
* make the test scripts use uv
* put uv into system path
* more clear setup.sh output
* don't look for uv in venv
* update the workflows to use uv
* lowercase pwndbg in upd message
* fix coverage invocation
* more robust test invocation
* pre-sync docs build
* don't pass venv to find_uv in [gdb/lldb]init
* uv sync before lint for more robustness
* make lldb work out of the box together with gdb
* don't uninstall dependancies when syncing
* modify scripts to use uv inside venv
* update workflows
* fix lint for scripts/
* update doc verifier workflow
* let nix magic check uv.lock
* use the venv as specified from venv in scripts so it works in docker
* add uv to project deps
* fix tests venv location
* revert uv venv lookup changes
* fix kernel tests
* fix nix
* work without venv, refactor code, packagers enjoy
* fix dockerfiles
* no posix; bash is my new best friend
* dont make venv in nix
* cleaned up paths
* Update gdbinit.py
* rebase: update link and uv lock
* Update lldbinit.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update scripts/common.sh
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update gdbinit.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fixup bad rebase (setuptools)
* don't use UV if the .skip-venv file exists
* document the PWNDBG_PLEASE_SKIP_VENV option
* fix nix devshell
* Update lldbinit.py
* extend -> append
---------
Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
When building a customized Docker image containing pwndbg using ubuntu:20.04 as base, the build process does not fail even when setup.sh exits because Ubuntu 20.04 isn't supported anymore.
I think setup.sh should make the Docker image build process fail by emitting non-zero return values.
* Switch to Poetry for dependency management in setup
* Added curl dependency and removed python-pip and python3-pip
---------
Co-authored-by: B1N4RY-P4R45173 <kopakaajay123@gmail.com>
- remove submodules from all files
- bump flake.lock
- add gdb-pt-dump as dependency
- fix building Dockerfile
- fix gdb-pt-dump was broken on portable packages
* Use /bin/sh instead of /bin/bash
* Install the required freebsd packages and remove some bashisms
* Reuse bash
* Attempt to fix the linter
* Fix the linter
* Fix coverage combine toml issue
This commit should fix this issue:
```
Run coverage combine
coverage combine
coverage xml
shell: /usr/bin/bash -e {0}
Can't read 'pyproject.toml' without TOML support. Install with [toml] extra
Error: Process completed with exit code 1.
```
* setup.sh: cleanup the --user flag since we use venv now
Cleans up the --user flag from setup.sh since it is unused after we changed setup.sh to install Python dependencies in a virtual environment
* Remove --user flag from CI workflows
* Fix codecov problem
We need to run the python `coverage` library to collect coverage.
However, gdb was failing to find it.
Recently, pwndbg moved to using venvs. When pwndbg is initialized
it setups the venv "manually", that is, no "source .venv/bin/activate"
is needed. When we run gdb tests, we pass the `gdbinit.py` of pwndbg as a
command to gdb to be executed like this:
`gdb --silent --nx --nh -ex 'py import coverage;coverage.process_startup()' --command PATH_TO_gdbinit.py`
The problem is that *order* matters. This means that *first* coverage
is imported (by `-ex py ...`) and only *then* the init script is executed.
When `coverage` is first imported, it's library search path only looks
in system libraries of python, and not the venv that gdbinit.py would load.
So we would try to import an old version of coverage and fail.
One solution would be to move around the commands, but this would be an
ugly hack IMHO. **Instead**, we should just tell gdb that this is an **init**
command that has to be executed before other commands.
Previously, the order did not matter. All of pwndbg's dependencies were
installed directly as system libraries to python. So the library search path
was the same before and after loading `gdbinit.py`.
---------
Co-authored-by: disconnect3d <dominik.b.czarnota@gmail.com>
Co-authored-by: intrigus <abc123zeus@live.de>
* Change setup.sh to create & use Python virtualenv
The `setup.sh` script now creates a `.venv` directory during execution and installs all dependencies into that directory. Then, `gdbinit.py` will adds the proper `site-packages` directory as the first item of `sys.path`.
Fixes#1634.
Technically Arch Linux ARM is a separate distro from the x86_64 Arch Linux, but it uses pcaman and the same package names. So it installs just fine, just needs to be detected properly.
Now the installation process contains the following steps:
1. Check for any line with source <gdbinit.py> before installation
2. If any, ask the user if they want to proceed
3. After the installation, comment out old source <gdbinit.py> lines if any and add a new source <gdbinit.py> line.
A check for presence of the line set debuginfod enabled on is also added to avoid being appended repeatedly.