Skip to content

Commit

Permalink
Remove pyenv related code (closes #1078) (#1084)
Browse files Browse the repository at this point in the history
## Description

Removes `pyenv` related functionality from gef.py and documents it.

See discussion at #1078
  • Loading branch information
mattzque committed Apr 15, 2024
1 parent 429a0e5 commit d211658
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
5 changes: 5 additions & 0 deletions docs/deprecated.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ page aims to track those changes.
| `windbg` | Moved | [a933a5a](https://github.com/hugsy/gef-extras/commit/a933a5ac43933742d91f4e299eadf05e3e0670be) | [Link](https://github.com/hugsy/gef-extras/blob/main/scripts/windbg.py) | |
| `is-syscall` | Moved | [3f79fb38](https://github.com/hugsy/gef-extras/commit/3f79fb382aa9052d073698d40237f98982c5d2de) | [Link](https://github.com/hugsy/gef-extras/blob/main/scripts/syscall_args) | |
| `syscall-args` | Moved | [3f79fb38](https://github.com/hugsy/gef-extras/commit/3f79fb382aa9052d073698d40237f98982c5d2de) | [Link](https://github.com/hugsy/gef-extras/blob/main/scripts/syscall_args) | |

## Removed support for pyenv

Support for [pyenv](https://github.com/pyenv/pyenv) has been removed after `2024.05`, for more
information see [#1078](https://github.com/hugsy/gef/issues/1078) and [#1062](https://github.com/hugsy/gef/issues/1062).
10 changes: 0 additions & 10 deletions gef.py
Original file line number Diff line number Diff line change
Expand Up @@ -11479,16 +11479,6 @@ def target_remote_posthook():
f"(with Python {'.'.join(map(str, PYTHON_MIN_VERSION))} or higher).")
exit(1)

try:
pyenv = which("pyenv")
pyenv_root = gef_pystring(subprocess.check_output([pyenv, "root"]).strip())
pyenv_version = gef_pystring(subprocess.check_output([pyenv, "version-name"]).strip())
site_packages_dir = pathlib.Path(pyenv_root) / f"versions/{pyenv_version}/lib/python{pathlib.Path(pyenv_version).stem}/site-packages"
assert site_packages_dir.is_dir()
site.addsitedir(str(site_packages_dir.absolute()))
except FileNotFoundError:
pass

# When using a Python virtual environment, GDB still loads the system-installed Python
# so GEF doesn't load site-packages dir from environment
# In order to fix it, from the shell with venv activated we run the python binary,
Expand Down

0 comments on commit d211658

Please sign in to comment.