-
Notifications
You must be signed in to change notification settings - Fork 203
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
ext: export only Init_sqlite3_native #371
ext: export only Init_sqlite3_native #371
Conversation
See related proposal for Nokogiri at sparklemotion/nokogiri#2746 |
58441c1
to
ebd3e5c
Compare
ebd3e5c
to
eac9d8a
Compare
This works around new Darwin Ruby 3.2 symbol resolution issues, but also follows best practices around shipping shared libraries. Note that we remove the `-flat_namespace` hack because the latest rake-compiler-docker images have the changes from rake-compiler/rake-compiler-dock#94
eac9d8a
to
c8c1eb3
Compare
What about |
@byroot I don't actually know much about how that symbol gets used, can you point me at docs to learn more? C extensions on Windows have always only exported the target function ( I'm planning to propose something upstream (in Ruby) to formalize or automate exposing minimal symbols, since I think most symbols only get exported on Linux and Darwin by accident (it hasn't been an intentional decision to export them) and this recently caused problems with the RBS gem. I'll make sure to include |
It's a symbol Peter added starting in 3.2.0dev to better handle ABI breaks. It was supposed to be exposed in 3.2.0 final too but somehow it didn't happen: ruby/ruby#5474 If needed I'm sure Peter can tell you more.
Huge 👍 . As you may remember this has caused issues with hiredis etc. I agree C-ext shouldn't expose anything by default. There is very little reason for exposing anything more than the init function. |
This works around new Darwin Ruby 3.2 symbol resolution issues, but also follows best practices around shipping shared libraries.
The result is that the only public (exported) symbol in the extension is
Init_sqlite3_native
, regardless of what platform or version of Ruby you're on.See rake-compiler/rake-compiler-dock#87 for lots of context.