Skip to content
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

Remove Nix #11

Merged
merged 4 commits into from
Sep 22, 2023
Merged

Remove Nix #11

merged 4 commits into from
Sep 22, 2023

Conversation

fzakaria
Copy link
Owner

Feedback from @rogerbinns and others was to go "vanilla" python project.

Therefore remove Nix, Poetry and go back to published versions of dependencies such as apsw and lief

Feedback from Roger and others was to go "vanilla" python project.
Therefore remove Nix, Poetry and go back to published versions of
dependencies such as apsw and lief
* updated readme to reflect removal of Nix
* added new API sql.py to execute sqlelf directly
* added some new tests for the new API
* reworked the cli.py to invoke the new API
Copy link
Contributor

@markrwilliams markrwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please move the pip install -e .[dev] part of the readme above the makefile stuff per the comment.

everything else is optional!

❯ python3 -m venv venv
❯ source venv/bin/activate
❯ pip install .
❯ sqlelf /usr/bin/python3 -- \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: it'd be nice to change this to either /usr/bin/env python3 or $VIRTUAL_ENV/bin/python3 because user's python3 might be anywhere on the file system

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you talking about the sqlelf invocation or the -m venv one?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, the sqlelf invocation because the first command line argument is the absolute path of a python executable

README.md Outdated Show resolved Hide resolved
sqlelf/cli.py Outdated Show resolved Hide resolved

# If none of the inputs are valid files, simply return
if len(filenames) == 0:
sys.exit("No valid ELF files were provided")

binaries: list[Binary] = [Binary(filename) for filename in filenames]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this related to removing nix?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I downgraded LIEF as part of the nix removal and it changed the API a bit.

sqlelf/sql.py Outdated Show resolved Hide resolved
sqlelf/sql.py Outdated Show resolved Hide resolved
for section in binary.sections:
yield {
"path": binary_path,
"path": binary_name,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: why binary_name instead of path? is it just the base name, not a full path? that's odd given dictionary's key remains path

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was called name on the object model even though its the path.
It's just an annoying thing about LIEF

@fzakaria fzakaria merged commit c251cf9 into main Sep 22, 2023
2 checks passed
@fzakaria fzakaria deleted the remove-nix branch September 22, 2023 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants