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

Fix conflict when both hiredis-rb and redis-client are loaded #17

Merged
merged 1 commit into from
Apr 28, 2022

Conversation

casperisfine
Copy link
Collaborator

Fix: #16

Using $libs instead of $LDFLAGS wasn't enough, because the symbols were still exported. So I went farther and took inspiration from what grpc does to only export the required symbols: https://github.com/grpc/grpc/blob/1cd6e69347cbf62a012477fe184ee6fa8f25d32c/src/ruby/ext/grpc/extconf.rb#L87-L89

cc @flavorjones

@flavorjones
Copy link
Contributor

Just writing down what I'm learning from this ... Looking at the symbol table in ./lib/redis_client/hiredis_connection.so, on master:

 128   │ 0000000000006720 T hiredis_connection_free
 129   │ 0000000000007fe0 T hiredis_connection_mark
 130   │ 0000000000007f90 T hiredis_connection_mark_task

on this PR branch:

 129   │ 0000000000003fa0 t hiredis_connection_free
 130   │ 0000000000005860 t hiredis_connection_mark
 131   │ 0000000000005810 t hiredis_connection_mark_task

the lower-case "t" confirms these symbols aren't exported. Thank you for showing me this technique!

@casperisfine casperisfine merged commit 353c105 into master Apr 28, 2022
@casperisfine
Copy link
Collaborator Author

Thanks @flavorjones ❤️

@casperisfine casperisfine deleted the extensions-conflict branch May 5, 2022 09:04
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

Successfully merging this pull request may close these issues.

Bug: hiredis driver conflict with the hiredis gem
3 participants