parquery / pylddwrap Goto Github PK
View Code? Open in Web Editor NEWPython 3 wrapper around ldd *nix utility to determine shared libraries of a program
License: MIT License
Python 3 wrapper around ldd *nix utility to determine shared libraries of a program
License: MIT License
The present CI setup doesn't cover linting or coverage etc. We can discuss general topics here until starting PRs for them.
Hi!
Maybe someone can help me out.
ldd x86.out
linux-gate.so.1 (0xf7f8f000)
libc.so.6 => /usr/lib32/libc.so.6 (0xf7c00000)
/lib/ld-linux.so.2 => /usr/lib/ld-linux.so.2 (0xf7f91000)
pylddwrap ./x86.out
raise RuntimeError("Unexpected library path: {}".format(dep_path))
RuntimeError: Unexpected library path: linux-gate.so.1
6.1.7-1-MANJARO #1 SMP PREEMPT_DYNAMIC Wed Jan 18 22:33:03 UTC 2023 x86_64 GNU/Linux
Any hints?
Regards
Acry
Somehow, author refuses to open an issue
I have noticed that with the latest release of 1.1.0, the lddwrap.list_dependencies
fails when using it on a statically linked library:
my_static_lib.so:
statically linked
with the error message:
RuntimeError: Unexpected mem address. Expected to match ^\s*(([^)]))\s$, but got: 'linked'
This makes sense because normally, for a shared library, this is what you would get:
my_share_lib.so:
linux-lib.so.1 (0x00007fff4a9fe000)
linux-lib2.so => path
so statically linked
is being parsed in the way that statically
is considered to be the file and the linked
is considered to be a memory address which of course fails the regex match.
Do you think that it would make more sense to avoid proceeding to the parsing step if ldd
tells us that it's a statically linked library?
For the previous version, 1.0.1, it's happily reporting the following:
from pathlib import Path
import lddwrap
deps = lddwrap.list_dependencies(Path('my_static_lib.so'))
for dep in deps:
print(dep.path)
print(dep.found)
print(dep.soname)
statically
True
None
The statically is definitely not a correct file path, but raising an exception does not feel right either as ldd
doesn't fail itself.
Hi @sheerluck ,
I took insipration from your pull request #5 and implemented the feature in the separate pull request #7. I already merged the changes into the master branch. Could you please see if that works for you and there are any bugs or errors when you run it on your side?
If there are no bugs in a week, I'll bump the minor version.
(If you haven't done so, may I kindly ask you to star the project to give it visibility?)
Hi,
On Ubuntu Bionic Beaver - some libraries that are not found are being interpreted as paths of libraries that are found.
root@buildkitsandbox:/workspace# ldd --version
ldd (Ubuntu GLIBC 2.27-3ubuntu1.6) 2.27
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
root@buildkitsandbox:/workspace#
root@buildkitsandbox:/workspace# uname -a
Linux buildkitsandbox 6.2.0-27-generic #28-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 12 22:39:51 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
root@buildkitsandbox:/workspace# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.6 LTS
Release: 18.04
Codename: bionic
root@buildkitsandbox:/workspace# pylddwrap /build/AQtBasedProject
soname | path | found | mem_address | unused
----------------------+----------------------------------------------------------------------------------------------------+-------+--------------------+-------
None | /build/AQtBasedProject: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by | True | | False
linux-vdso.so.1 | None | True | 0x00007ffdb6f2e000 | False
libhidapi-hidraw.so.0 | /usr/lib/x86_64-linux-gnu/libhidapi-hidraw.so.0 | True | 0x00007ff2067e8000 | False
libQt6Widgets.so.6 | /opt/Qt/6.3.0/gcc_64/lib/libQt6Widgets.so.6 | True | 0x00007ff2060c4000 | False
libQt6Gui.so.6 | /opt/Qt/6.3.0/gcc_64/lib/libQt6Gui.so.6 | True | 0x00007ff205764000 | False
libQt6Core.so.6 | /opt/Qt/6.3.0/gcc_64/lib/libQt6Core.so.6 | True | 0x00007ff205109000 | False
libGLX.so.0 | /usr/lib/x86_64-linux-gnu/libGLX.so.0 | True | 0x00007ff204ed8000 | True
libOpenGL.so.0 | /usr/lib/x86_64-linux-gnu/libOpenGL.so.0 | True | 0x00007ff204caa000 | True
libstdc++.so.6 | /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | True | 0x00007ff20484a000 | False
libgcc_s.so.1 | /lib/x86_64-linux-gnu/libgcc_s.so.1 | True | 0x00007ff204627000 | False
...
Cheers
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.