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
[Feature #20005] Add C API to resolve symbols from other extensions #8991
Conversation
I have no idea how we can test this kind of API. What's the best example? |
I got some idea about |
That sounds right - make two modules in |
I added extensions for tests under |
memcpy(tmp + sizeof(EXTERNAL_PREFIX) - 1, symbol, symlen + 1); | ||
symbol = tmp; | ||
} | ||
if (handle == NULL) { |
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.
The API to pass NULL
as the handle
argument looks dirty - should I add another argument to search the main executable explicitly?
CIs are failing on Windows environments. These show |
And YJIT-ed runs crashed. |
41592c1
to
a82c198
Compare
About the CIs on Windows environments, the LoadError message Follow-up: I got the error message from |
a82c198
to
fb67922
Compare
I thought it was enough to specify |
9b17a50
to
a01335e
Compare
All tests passed! |
b951420
to
feee5d1
Compare
I've updated my commits and pushed again. |
dd162ac
to
367e2d6
Compare
The symbol resolved by dln_symbol will eventually be passed to extensions. The error handling of dln_sym is also separated into dln_sym_func because the new call resolving symbols will not raise LoadError.
367e2d6
to
2a1359e
Compare
…Feature #20005] This is a C API for extensions to resolve and get function symbols of other extensions. Extensions can check the expected symbol is correctly loaded and accessible, and use it if it is available. Otherwise, extensions can raise their own error to guide users to setup their environments correctly and what's missing.
2a1359e
to
17faaad
Compare
Can this get merged into Ruby 3.3? |
This is to add a C API for extensions to resolve symbols
extern
-ed by other extensions.https://bugs.ruby-lang.org/issues/20005