-
Notifications
You must be signed in to change notification settings - Fork 428
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
Address "WARNING :: Failed to get_static_lib_exports(*.a)" #4221
base: main
Are you sure you want to change the base?
Conversation
@@ -701,7 +701,7 @@ def _parse_ar_hdr(content, index): | |||
# syms_b = get_symbols(obj, defined=True, undefined=False) | |||
# print(syms_b) | |||
else: | |||
obj = lief.ELF.parse(raw=content[obj_start:obj_end]) | |||
obj = lief.ELF.parse(raw=list(content[obj_start:obj_end])) |
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.
lief.parse
accepts raw: bytes
or raw: List[int]
, but lief.*.parse
only accepts raw: List[int]
.
0d712d0
to
ee24322
Compare
if len(binary.exported_functions): | ||
syms = binary.exported_functions | ||
imported_function_names = {s.name for s in binary.imported_functions} |
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.
I don't really know if this is the correct thing to do. Just made sense given the names of lief.Binary
's members.
@@ -890,8 +890,10 @@ def get_symbols(file, defined=True, undefined=True, notexported=False, arch='nat | |||
except: | |||
pass | |||
res = [] | |||
imported_function_names = set() | |||
if len(binary.exported_functions): |
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.
NB: Due to lack of deeper knowledge of LIEF, I have no idea what the implications are in prioritizing binary.exported_functions
over binary.symbols
over binary.static_symbols
. So, IDK if it makes sense to use a (maybe?) smaller set of symbols from .exported_functions
rather than just .symbols
.
ee24322
to
0d91589
Compare
0d91589
to
a964af9
Compare
@isuruf, @xhochy, apart from Ray, you are the ones that I know of who had a look at LIEF or related code. Could one of you take a look at this? |
I sadly don't have any expertise either that would go beyond running this code and seeing whether it passes. So I cannot add something on top of what other conda-build reviewers would do here. |
Hi there, thank you for your contribution! This pull request has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs. If you would like this pull request to remain open please:
NOTE: If this pull request was closed prematurely, please leave a comment. Thanks! |
Hi there, thank you for your contribution! This pull request has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs. If you would like this pull request to remain open please:
NOTE: If this pull request was closed prematurely, please leave a comment. Thanks! |
lief.Function from the Python API does not seem to expose flags directly. Maybe lief.Binary.imported_functions can act as a counterpart to lief.Binary.exported_functions then?
Signed-off-by: Marcel Bargull <marcel.bargull@udo.edu>
a964af9
to
e828b60
Compare
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
Currently,
conda-build
prints outWARNING :: Failed to get_static_lib_exports(*.a)
whenever static libraries are using in the builds.This is because of a mismatched type of
lief.*.parse(raw=...)
(explicitly needsList[int]
rather thanbytes
).When the parameter type is fixed, it fails because
lief.Binary.exported_functions
gives an iterable oflief.Function
objects (or just names, i.e.,str
s, in older versions) which do not have.exported
/.imported
members.I can't say with any confidence, I know what I'm doing here because I did not dig in too deep of LIEF, the surrounding code and everything. Silver lining: If the changed code now raises another exception, the behavior would be identical because the previous one always failed (and the exception is caught and replaced the the mentioned warning). The unknown for me is just in case no exception is raised, IDK what difference a non-empty list of returned "imported by not exported" symbols affects.