[getdns-users] [PATCH] remove GETDNS_COMPILATION_COMMENT
Hollenbeck, Scott
shollenbeck at verisign.com
Wed Jul 8 18:32:40 UTC 2015
> -----Original Message-----
> From: Daniel Kahn Gillmor [mailto:dkg at fifthhorseman.net]
> Sent: Wednesday, July 08, 2015 2:14 PM
> To: Hollenbeck, Scott; libgetdns users list
> Subject: Re: [getdns-users] [PATCH] remove GETDNS_COMPILATION_COMMENT
>
> Hi Scott--
>
> Thanks for the quick response! I'm not sure of the answer to your
> questions, but i want to better understand why you want this info, and
> how it's useful. Maybe i'm missing a use case, in which case i'd
> happily withdraw my suggestion here.
>
> On Wed 2015-07-08 13:58:56 -0400, Hollenbeck, Scott wrote:
> > I'm currently using GETDNS_COMPILATION_COMMENT in the PHP language
> > bindings to display the getdns library version used to build the PHP
> > extension.
>
> How do you expect users (PHP developers, presumably) to actually use
> this? If the PHP binding uses shared libraries (links against
> libgetdnsapi.so.1 or whatever), what guarantees do your users have
> about
> what code they're actually running against?
>
> > If GETDNS_COMPILATION_COMMENT goes away is there another way of
> > retrieving the getdns library version information at compilation
> time?
>
> Why does library version information (other than the
> traditionally-tracked SONAME/ABI versioning scheme, which should be
> handled automatically during compilation based on -L) matter at compile
> time?
>
> getting library version information at runtime seems like it could be
> useful (e.g. we could introduce a const char* getdns_version_string()),
> but GETDNS_COMPILATION_COMMENT isn't useful for that in the first
> place,
> since it's a build-time and not a runtime setting.
Here's my use case:
PHP extensions can publish information that is made available to clients who call the phpinfo() function. It's typically used to publish version numbers, information about dependencies, and the like. Here's what my PHP extension currently publishes:
"getdns
GetDNS Support => enabled
Extension Version => 0.7.2
getdns Library Version => getdns 0.2.0 configured on 2015-05-21T12:51:51Z for the January 2015 version of the API
Author => Scott Hollenbeck <shollenbeck at verisign.com>"
I currently get the "getdns Library Version" information using GETDNS_COMPILATION_COMMENT because it's compiled into my code and available when PHP loads the extension. There are no function calls that might break at run time if the getdns library isn't available. I need a value that is 100% guaranteed to be available when PHP loads the extension even if the getdns library is unavailable.
Scott
More information about the Users
mailing list