From 4f0353c207a84eef20142adeeb2431401eb7acbe Mon Sep 17 00:00:00 2001 From: Moritz Sanft <58110325+msanft@users.noreply.github.com> Date: Sun, 9 Feb 2025 12:10:07 +0100 Subject: [PATCH] {python3Packages.}pwndbg: remove pwndbg has very specific versioning requirements for its dependencies, such as `unicorn`. Due to the amount and complexity of the packages, it's not feasible to maintain pinned versions just for `pwndbg`, as they'd come with a massive overhead of patches and build changes that'd need to be overridden here. As `pwndbg` already provides a downstream flake with all that versioning, users should rather consume it from there. --- pkgs/by-name/pw/pwndbg/package.nix | 77 ------------------- .../python-modules/pwndbg/default.nix | 64 --------------- .../python-modules/pwntools/default.nix | 2 +- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/python-aliases.nix | 1 + pkgs/top-level/python-packages.nix | 2 - 6 files changed, 3 insertions(+), 144 deletions(-) delete mode 100644 pkgs/by-name/pw/pwndbg/package.nix delete mode 100644 pkgs/development/python-modules/pwndbg/default.nix diff --git a/pkgs/by-name/pw/pwndbg/package.nix b/pkgs/by-name/pw/pwndbg/package.nix deleted file mode 100644 index a87f63d00451..000000000000 --- a/pkgs/by-name/pw/pwndbg/package.nix +++ /dev/null @@ -1,77 +0,0 @@ -{ - lib, - stdenv, - python3, - makeWrapper, - gdb, -}: - -let - pwndbg-py = python3.pkgs.pwndbg; - - pythonPath = python3.pkgs.makePythonPath [ pwndbg-py ]; - - binPath = lib.makeBinPath ( - [ - python3.pkgs.pwntools # ref: https://github.com/pwndbg/pwndbg/blob/2022.12.19/pwndbg/wrappers/checksec.py#L8 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - python3.pkgs.ropper # ref: https://github.com/pwndbg/pwndbg/blob/2022.12.19/pwndbg/commands/ropper.py#L30 - python3.pkgs.ropgadget # ref: https://github.com/pwndbg/pwndbg/blob/2022.12.19/pwndbg/commands/rop.py#L32 - ] - ); -in -stdenv.mkDerivation { - pname = "pwndbg"; - version = lib.getVersion pwndbg-py; - format = "other"; - - inherit (pwndbg-py) src; - - nativeBuildInputs = [ makeWrapper ]; - - installPhase = '' - runHook preInstall - - mkdir -p $out/share/pwndbg - cp gdbinit.py $out/share/pwndbg/gdbinit.py - chmod +x $out/share/pwndbg/gdbinit.py - # First line is a import from future, so we need to append our imports after that - sed '2 i import sys, os - 3 i [sys.path.append(p) for p in "${pythonPath}".split(":")] - 4 i os.environ["PATH"] += ":${binPath}"' -i $out/share/pwndbg/gdbinit.py - - # Don't require an in-package venv - touch $out/share/pwndbg/.skip-venv - - makeWrapper ${gdb}/bin/gdb $out/bin/pwndbg \ - --add-flags "-q -x $out/share/pwndbg/gdbinit.py" - - runHook postInstall - ''; - - doInstallCheck = true; - installCheckPhase = '' - runHook preInstallCheck - - # Check if pwndbg is installed correctly - HOME=$TMPDIR LC_CTYPE=C.UTF-8 $out/bin/pwndbg -ex exit - - runHook postInstallCheck - ''; - - meta = with lib; { - description = "Exploit Development and Reverse Engineering with GDB Made Easy"; - mainProgram = "pwndbg"; - homepage = "https://github.com/pwndbg/pwndbg"; - license = licenses.mit; - platforms = platforms.all; - maintainers = with maintainers; [ - mic92 - patryk4815 - msanft - ]; - # not supported on aarch64-darwin see: https://inbox.sourceware.org/gdb/3185c3b8-8a91-4beb-a5d5-9db6afb93713@Spark/ - broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64; - }; -} diff --git a/pkgs/development/python-modules/pwndbg/default.nix b/pkgs/development/python-modules/pwndbg/default.nix deleted file mode 100644 index f71117d7497a..000000000000 --- a/pkgs/development/python-modules/pwndbg/default.nix +++ /dev/null @@ -1,64 +0,0 @@ -{ - lib, - buildPythonPackage, - fetchFromGitHub, - capstone, - future, - ipython, - psutil, - pwntools, - pycparser, - pyelftools, - pygments, - requests, - rpyc, - sortedcontainers, - tabulate, - typing-extensions, - unicorn, - gdb-pt-dump, - poetry-core, -}: -buildPythonPackage rec { - pname = "pwndbg"; - version = "2024.08.29"; - pyproject = true; - - src = fetchFromGitHub { - owner = "pwndbg"; - repo = "pwndbg"; - rev = version; - hash = "sha256-mpkUEP0GBwOfbbpogupmDvCo8dkbSGy1YtH8T55rX9g="; - }; - - nativeBuildInputs = [ - poetry-core - ]; - pythonRelaxDeps = true; - - propagatedBuildInputs = [ - capstone - future - ipython - psutil - pwntools - pycparser - pyelftools - pygments - requests - rpyc - sortedcontainers - tabulate - typing-extensions - unicorn - gdb-pt-dump - ]; - - meta = { - description = "Exploit Development and Reverse Engineering with GDB Made Easy"; - homepage = "https://pwndbg.re"; - changelog = "https://github.com/pwndbg/pwndbg/releases/tag/${version}"; - license = lib.licenses.mit; - maintainers = with lib.maintainers; [ msanft ]; - }; -} diff --git a/pkgs/development/python-modules/pwntools/default.nix b/pkgs/development/python-modules/pwntools/default.nix index 1ab82189326f..4e6a06900892 100644 --- a/pkgs/development/python-modules/pwntools/default.nix +++ b/pkgs/development/python-modules/pwntools/default.nix @@ -43,7 +43,7 @@ buildPythonPackage rec { postPatch = '' # Upstream hardcoded the check for the command `gdb-multiarch`; - # Forcefully use the provided debugger, as `gdb` (hence `pwndbg`) is built with multiarch in `nixpkgs`. + # Forcefully use the provided debugger as `gdb`. sed -i 's/gdb-multiarch/${debuggerName}/' pwnlib/gdb.py ''; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index c60b89cd4649..7aeeafa91701 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1164,6 +1164,7 @@ mapAliases { protonvpn-gui_legacy = throw "protonvpn-gui_legacy source code was removed from upstream. Use protonvpn-gui instead."; # Added 2024-10-12 proxmark3-rrg = proxmark3; # Added 2023-07-25 psensor = throw "'psensor' has been removed due to lack of maintenance upstream. Consider using 'mission-center', 'resources' or 'monitorets' instead"; # Added 2024-09-14 + pwndbg = throw "'pwndbg' has been removed due to dependency version incompatibilities that are infeasible to maintain in nixpkgs. Use the downstream flake that pwndbg provides instead: https://github.com/pwndbg/pwndbg"; # Added 2025-02-09 pyo3-pack = maturin; pypi2nix = throw "pypi2nix has been removed due to being unmaintained"; pypolicyd-spf = spf-engine; # Added 2022-10-09 diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix index 434e1b6f3cd9..77e2a0cd0e15 100644 --- a/pkgs/top-level/python-aliases.nix +++ b/pkgs/top-level/python-aliases.nix @@ -467,6 +467,7 @@ mapAliases ({ pur = throw "pur has been renamed to pkgs.pur"; # added 2021-11-08 pushbullet = pushbullet-py; # Added 2022-10-15 Pweave = pweave; # added 2023-02-19 + pwndbg = throw "'pwndbg' has been removed due to dependency version incompatibilities that are infeasible to maintain in nixpkgs. Use the downstream flake that pwndbg provides instead: https://github.com/pwndbg/pwndbg"; # Added 2025-02-09 pxml = throw "pxml was removed, because it was disabled on all python version since 3.8 and last updated in 2020."; # added 2024-05-13 py3to2 = throw "py3to2 is unmaintained and source is no longer available"; # added 2024-10-23 py-radix = throw "py-radix has been removed, since it abandoned"; # added 2023-07-07 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 81197ab34f04..cb54ee7887dc 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11369,8 +11369,6 @@ self: super: with self; { pwlf = callPackage ../development/python-modules/pwlf { }; - pwndbg = callPackage ../development/python-modules/pwndbg { }; - pwntools = callPackage ../development/python-modules/pwntools { debugger = pkgs.gdb; };