-
Notifications
You must be signed in to change notification settings - Fork 147
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
Demonstrate how ELF extraction/utilities can be done using SQL #458
Conversation
Introduce the sqlelf to auditwheel. The goal of sqlelf is to make it more easy to declaratively find/get information from an ELF file using SQL * replaced find_symbol_versions * removed dead code * removed unecessary tests
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Changed the code to read rpath/runpath to just return true/false whether they exist which is how the function is being used. Changed the implementation to use sqlelf SQL query instead of pyelftools.
for more information, see https://pre-commit.ci
This looks like a cool project.
While this sounds nice, I think users still need to have some knowledge of ELF to be able to use sqlelf, and anyone contributing to auditwheel's parts dealing with ELF will need to have a good understanding of the format anyway. My main concern with this is that it would require developers to have fairly good SQL knowledge to contribute to the code base. While the equivalent Python code is often more verbose, I expect that anyone who's able to contribute to auditwheel will be able to fairly easily understand it, but this might not be the case with SQL code, which is a new language in this code base. And besides, mixing SQL with Python code means tools like linters, IDEs, etc. won't be able to help catch bugs, offer autocomplete, etc. So all in all, I'm not convinced that replacing pyelftools with sqlelf provides enough benefits to be worth doing. |
I'm working on sqlelf which is a tool that lets you explore ELF files using SQL.
What's really interesting and neat about this tool is that it lets you declaratively write what data you are interested in without knowing the internals of the ELF file format or working with the the necessary ELF parsing library.
The snippets are also very easily runnable outside the codebase which makes validating the tests separately super easy.
Here is a current draft where I have replaced a good number of the functions with their respective SQL equivalent.
I'm interested in feedback or thoughts on the approach.
We can get quite fancy with the SQL to even split the strings of RUNPATH for instance for instance.