New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
python3Packages.pwntools: Allow to use any debugger #95870
Conversation
Questions regarding the sanity of my packaging:
|
Here is a mean to test the PR quickly in a shell (note that cat <<__EOF__ > script.py
import sys
from pwn import *
binary = sys.argv[1]
io = gdb.debug([binary])
io.interactive()
__EOF__
python script.py $(which cat) A different debugger is used whether you started your shell with:
|
I'm getting errors when I run your Error from inside tmux:
|
@kristoff3r, thanks for your feedback! The way I described the Here is a more accurate test process:
As for the error you encountered, I could not reproduce it... |
Thanks for the updated testing description, I've tested it and it works, so LGTM. The error was probably because I used a non-pure shell on a Debian machine at work, I'm too used to not having python installed globally anymore. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
diff LGTM
output LGTM
however, these seem to be a series of applications. Should we do:
# all-packages.nix
pwntools = with python3Packages; toPythonApplication pwntools;
?
it would also prevent the propagation of python packages into an environment |
@jonringer, I am not too sure about what you are asking by "should"... It seems to "work" already (applications available in the shell); Although, I never used
If you mean "should we make it cleaner", I am afraid I don't have enough knowledge of
|
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
the but this should allow users to do |
However, your IRC question is very different:
|
some code examples:
whereas, just referencing the package only makes a reference to pandas, however, the propagated-build-inputs is used to construct the PYTHONPATH when needed
|
@jonringer Thanks for the detailed explanation, and the links! I had already added the line you proposed to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
shows usage
https://github.com/NixOS/nixpkgs/pull/95870
3 packages built:
pwntools python27Packages.pwntools python37Packages.pwntools
Motivation for this change
pwntools
allow to specify any debuggers by putting apwntools-gdb
in thePATH
.See https://github.com/Gallopsled/pwntools/blob/eb60b5d6b617d41652ab5525b7033f97e6e4c5ac/pwnlib/gdb.py#L496 .
This PR allows to declaratively specify a debugger to use with
pwntools
, and hooks everything as necessary; Defaults togdb
.And, I kinda had to give
gdb
apname
for convenience.Things done
sandbox
innix.conf
on non-NixOS linux)Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)Ensured that relevant documentation is up to dateSigned-off-by: Pamplemousse xav.maso@gmail.com