WIP: Handle resolv.h regardless of glibc version #7

Closed
sjbronner wants to merge 4 commits from feature-detect-resolv-h into master
sjbronner commented 2022-03-09 09:13:28 +13:00 (Migrated from github.com)

Changes in the interface of resolv.so have historically made it hard to use this crate. I propose a change that simplifies this significantly.

First, the binding to resolv.so has to be generated on the target system. Then we need an adaptor that provides a consistent interface to that binding. That is the only part that has to be pre-prepared for each breaking change in glibc versions (as is the case in glibc 2.34). Lastly, we should use the official interface provided by resolv.h, which is enabled by the aforementioned adaptor.

These changes have made it significantly easier for me to compile this crate against multiple machines. My hope is that it may be useful to others, as well. That is why I am submitting this pull requests. I welcome all constructive criticism and suggestions for improvement.

Changes in the interface of resolv.so have historically made it hard to use this crate. I propose a change that simplifies this significantly. First, the binding to resolv.so has to be generated on the target system. Then we need an adaptor that provides a consistent interface to that binding. That is the only part that has to be pre-prepared for each breaking change in glibc versions (as is the case in glibc 2.34). Lastly, we should use the official interface provided by resolv.h, which is enabled by the aforementioned adaptor. These changes have made it significantly easier for me to compile this crate against multiple machines. My hope is that it may be useful to others, as well. That is why I am submitting this pull requests. I welcome all constructive criticism and suggestions for improvement.
mikedilger commented 2022-03-09 09:58:49 +13:00 (Migrated from github.com)

Brilliant.

Brilliant.
sjbronner commented 2022-03-09 10:35:54 +13:00 (Migrated from github.com)

Thanks!

I had some issues with the diff against master because I originally based my branch off of branch glibc234. So I made a new branch based off of master and turned that into pull request #8 .

Thanks! I had some issues with the diff against master because I originally based my branch off of branch glibc234. So I made a new branch based off of master and turned that into pull request #8 .

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mikedilger/resolv-rs!7
No description provided.