-
Notifications
You must be signed in to change notification settings - Fork 7
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
add support for c-ares 1.13.0 #80
Conversation
And to add CI tests, it may be better to add a standalone c-ares-src crate which can be used to select old versions of c-ares. |
thanks for this, sorry it's taken me a few days to get to look at it - and then it's taken me a little time to understand properly what you've done, too! I think more needs to be done in ffi.rs, it is going to need to understand the c-ares version too
So at the moment it's possible for people - including potentially this library - to try and use those fields, but if the underlying c-ares version is old then that is accessing unowned memory. Say if you need help re-generating ffi.rs.
I'll also leave some minor comments on the code changes |
#include <ares_version.h> | ||
|
||
#define VERSION2(a, b, c) RUST_VERSION_C_ARES_##a##_##b##_##c | ||
#define VERSION(a, b, c) VERSION2(a, b, c) |
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.
I guess my C must be rusty - if you'll forgive the pun. What's the point of having both VERSION
and VERSION2
?
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.
to take the value of ARES_VERSION_MAJOR these macros
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.
I don't follow.
Why isn't a single macro #define VERSION(a, b, c) RUST_VERSION_C_ARES_##a##_##b##_##c
enough?
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.
This would expand to
RUST_VERSION_C_ARES_ARES_VERSION_MAJOR_ARES_VERSION_MINOR_ARES_VERSION_PATCH,
where the value of ARES_ARES_VERSION_MAJOR is not expanded.
#include <ares_version.h> | ||
|
||
#define VERSION2(a, b, c) RUST_VERSION_C_ARES_##a##_##b##_##c | ||
#define VERSION(a, b, c) VERSION2(a, b, c) |
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.
I don't follow.
Why isn't a single macro #define VERSION(a, b, c) RUST_VERSION_C_ARES_##a##_##b##_##c
enough?
if the That would be tedious, if we can convince ourselves that we don't need to gate any of those then I'd be happier |
yes it's unnecessary to gate away caa things in ffi, but I think maybe it's better to keep this sync with c-ares? |
providing we are happy that we are not allowing any unsafe behaviour - which I think is the case - I prefer the simple approach with fewer In practice, I would be very surprised to learn about anyone using c-ares-sys directly - it may be that only you and I even notice the difference. If anyone does later show up with a reason to go the other way, I can revisit that decision. |
It should be ready now |
thanks - looks good I think. I'll likely leave it a day or three: to give myself a chance to remember anything I've forgotten about, and to play with it a bit more. Maybe cut a release at the weekend. |
OK. I will update dimbleby/c-ares-resolver#28 once the new release available. |
cargo is mysteriously printing a warning containing the text eg https://github.com/dimbleby/rust-c-ares/actions/runs/6792983111/job/18467106231?pr=80#step:8:62 edit: rust-lang/cc-rs#896. Probably not much to be done about that here. |
step3 as described in #74.
The oldest support c-ares version is 1.13.0, which is available in RHEL 8.
I can compile on Debian 10 hosts which have c-ares 1.14.0 with all of the vendored feature flags.