Bug 184711 - [GTK][WPE] Build failure due to presence of Avahi's <dns_sd.h> header
Summary: [GTK][WPE] Build failure due to presence of Avahi's <dns_sd.h> header
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adrian Perez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-04-17 15:15 PDT by Adrian Perez
Modified: 2018-04-17 16:42 PDT (History)
5 users (show)

See Also:


Attachments
Patch (1.35 KB, patch)
2018-04-17 15:34 PDT, Adrian Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Perez 2018-04-17 15:15:05 PDT
The build failure is:

   […]/NetworkMDNSRegister.cpp:106:53: error: use of undeclared identifier 'dispatch_get_main_queue'
           error = DNSServiceSetDispatchQueue(service, dispatch_get_main_queue());
                                                       ^

Indeed, on GNU/Linux systems we do not have libdispatch! After a
bit of investigation, I have found the following snippet inside
“Source/WebKit/webrtc/NetworkProcess/NetworkMDNSRegister.h”:

  #if defined __has_include && __has_include(<dns_sd.h>)
  #define ENABLE_MDNS 1
  #else
  #define ENABLE_MDNS 0
  #endif

It turns our that in systems with Avahi installed, it may optionally
supply a <dns_sd.h> header which provides a certain degree of compatibility
with Apple's libdns_sd but it is lacks functionality needed by WebKit
(see https://github.com/lathiat/avahi/tree/master/avahi-compat-libdns_sd).

We should detect when Avahi's version is installed, and if that is the
case set ENABLE_MDNS to 0.
Comment 1 youenn fablet 2018-04-17 15:18:10 PDT
Oh I see, maybe the short term fix would be to add a PLATFORM(COCOA) check?
Comment 2 Adrian Perez 2018-04-17 15:29:53 PDT
(In reply to youenn fablet from comment #1)
> Oh I see, maybe the short term fix would be to add a PLATFORM(COCOA) check?

Yes, exactly my plan. Later on down the line we may want to
implement MDNS support using Avahi's full API instead of its
libdns_sd compatibility API.
Comment 3 Adrian Perez 2018-04-17 15:34:35 PDT
Created attachment 338154 [details]
Patch
Comment 4 Adrian Perez 2018-04-17 15:42:23 PDT
Filed bug #184713 to track implementing the functionality
using Avahi, this one is only for the build failure fix.
Comment 5 WebKit Commit Bot 2018-04-17 16:41:14 PDT
Comment on attachment 338154 [details]
Patch

Clearing flags on attachment: 338154

Committed r230739: <https://trac.webkit.org/changeset/230739>
Comment 6 WebKit Commit Bot 2018-04-17 16:41:16 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2018-04-17 16:42:25 PDT
<rdar://problem/39509941>