-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add an option to ignore missing shared libraries #79
Comments
Hi @pavel-kirienko, thanks for opening this issue! Unfortunately, I think you're going to have to dig a bit deeper before I can consider this change. To be honest, I'm not sure when your proposed change would ever be the correct behavior. That change could lead to necessary libraries getting missed, and an application that crashes at runtime. AFAIK StaticX can't be overly aggressive in discovering "obscure" library dependencies. It simply runs The patch you've shown covers your use-case, but doesn't really help to understand why you're running into missing libraries. What would be really helpful for me is a minimal reproducible test case; some python code and a set of build steps that I could run to reproduce your problem, to fully understand the issue and ensure the right changes are made. If you'd like to dig into the issue, you could use Let me know if I can help track this down. |
Jonathon, thank you for the suggestions. I will have to push back on this for a few months since I am currently engaging other matters, but I will be back to you once I'm back to work on this particular application. |
Pavel, no problem. I'm going to close this issue for now, because I don't currently see a valid use-case for this proposal. However, if you can provide some more details and make a stronger case, please re-open this issue and I would be happy to reconsider. Thanks again! |
I am building a Python GUI application based on PyQt5. The application is packaged into a native binary with PyInstaller, which generally works well, except that the resulting application ends up being dependent on a particular version of libGL which is not always available, which results in serious portability issues. Additionally, the native binary is unusable with systems that use older GLIBC, but this is a well-known property of PyInstaller so there is nothing to complain about.
Shared libraries are generally a pain to deal with, so I decided to try StaticX to build a fully static executable. Upon running it against my binary generated by PyInstaller, I encountered several failures where StaticX would find some obscure binary shipped with PyQt5 and then complain that it refers to a shared library which cannot be found. For example,
libmysqlclient.so.18
,libQt53DQuickRenderer.so.5
, and several dozen others. This behavior is not helpful because none of the missing libraries are actually needed for my application to run.Hence, in my case it would help greatly if I could just tell StaticX to skip missing shared libraries. I made a minimal PoC by ignoring the ldd output lines that contain
not found
in them, and verified that it works and the final executable is usable:I am not sure what is the best way to integrate this feature into upstream. I have several ideas:
get_shobj_deps()
function to take an additional argument specifying the missing library handling policy: either throw or ignore. This seems rather messy because a lot of other code will be affected as well.The text was updated successfully, but these errors were encountered: