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

Potential solution to older library versions with missing symbols #87

Open
ghost opened this issue Jul 22, 2018 · 1 comment
Open

Potential solution to older library versions with missing symbols #87

ghost opened this issue Jul 22, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented Jul 22, 2018

When gl_generator's StructGenerator attempts to load a missing function, it doesn't fail like x11-dl currently does. Instead, it replaces the function with a panic wrapper with the same signature. This way a single missing function doesn't prevent the entire library from loading. I propose that we do the same thing in x11-dl. This would make the Xrandr_2_2_0 struct in old_xrandr.rs obsolete, and it would prevent similar situations from happening in the future (whether they're likely to happen or not). In addition, a function can be added to check by name whether a symbol is available. If desired, I may have time to implement this some time in the next week.

Background: x11-dl structures represent the public symbols exported by a shared object (like XOpenDisplay from libX11.so.6 in a struct called Xlib). If the library on the user's machine is missing even one of these symbols, the entire struct completely fails to initialize. IIRC, this happened on debian sid, making x11-dl completely unusable on such systems.

@erlepereira
Copy link
Collaborator

I like this idea, make sense.
Will look into this myself too, have not tried this against a debian sid base yet, still looking around things.

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

No branches or pull requests

1 participant