<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 21, 2016 at 9:06 PM, Chad Versace <span dir="ltr"><<a href="mailto:chad.versace@intel.com" target="_blank">chad.versace@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon 20 Jun 2016, Chad Versace wrote:<br>
> On Sun 17 Apr 2016, Emil Velikov wrote:<br>
> > On 17 April 2016 at 01:41, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
> > > On Sat, Apr 16, 2016 at 4:12 PM, Emil Velikov <<a href="mailto:emil.l.velikov@gmail.com">emil.l.velikov@gmail.com</a>><br>
> > > wrote:<br>
> > >><br>
> > >> On 16 April 2016 at 22:06, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
><br>
</span><div><div class="h5">> > >> >> >> In either case, I think checking wayland-client-protocol.h into the<br>
> > >> >> >> repo is<br>
> > >> >> >> a must.<br>
> > >> >> ><br>
> > >> >> > I'm convinced.<br>
> > >> >> Unfortunately I'm not ;'-(<br>
> > >> ><br>
> > >> ><br>
> > >> > Are you now?<br>
> > >> ><br>
> > >> Not quite I'm afraid.<br>
> > >><br>
> > >> As a queue, I'm doing to (slightly) beat the SDL drum.<br>
> > >> SDL caters for everyone's needs and has a much wider exposure than<br>
> > >> waffle. I'm suggesting the exact same approach like the one they opted<br>
> > >> for ;-)<br>
> > ><br>
> > ><br>
> > > I doubt its the "exact" same or they'd be having build breaks too.<br>
> > They do actually [1]. The person who fixed it is familiar wayland<br>
> > developer [2] yet he choose the same approach as me ;-)<br>
> ><br>
> > > If you<br>
> > > want to provide a sort of glue layer to an application, your suggestion of<br>
> > > "optional" entrypoints is probably exactly what you want.<br>
> > Indeed. Thank you.<br>
> ><br>
> > >  However, waffle<br>
> > > itself needs to call something and it either needs to be smart enough to<br>
> > > call the right thing depending on the libwayland version it just dlopened or<br>
> > > it needs to just always call old ones.<br>
> > ><br>
> > The cases of waffle being "dumb" (not being smart enough) are so<br>
> > infrequent, that it beats the added overhead that importing the header<br>
> > will bring.<br>
> ><br>
> > Thanks for the discussion. Hopefully you're seeing things from my POV ;-)<br>
> > Emil<br>
> ><br>
> > [1] <a href="https://github.com/spurious/SDL-mirror/tree/master/src/video/wayland/SDL_wayland{dyn.{c,h},sym.h}" rel="noreferrer" target="_blank">https://github.com/spurious/SDL-mirror/tree/master/src/video/wayland/SDL_wayland{dyn.{c,h},sym.h}</a><br>
> > [2] <a href="https://github.com/spurious/SDL-mirror/commit/737415012588a2636794292129a2d39f2a28fe3c" rel="noreferrer" target="_blank">https://github.com/spurious/SDL-mirror/commit/737415012588a2636794292129a2d39f2a28fe3c</a><br>
><br>
> Both Jason's and Emil's approaches seem valid to me. And my preference<br>
> flip-flops every few minutes as I read the thread.<br>
><br>
> In April, I was strongly convinced of Jason's position. Now I'm leaning<br>
> slightly toward's Emil's.<br>
><br>
> I want to look more closely at SDL's approach (Emil, thanks for the<br>
> links), and then make a final decision. But it's late in the day for me<br>
> and my brain is done. Exhausted brains can't be trusted, so the decision<br>
> will have to wait until morning.<br>
<br>
</div></div>Everyone, thanks for the lengthy discussion. The winner is... Michel's<br>
patch v2, which is basically Emil's and SDL's position.<br>
<br>
I decided against importing any Wayland headers, because the Wayland<br>
headers actually contain a lot of inline function *definitions*. When<br>
upstream Wayland applies bugfixes and improvements to those functions,<br>
by not using imported headers Waffle automatically receives the bugfixes<br>
and improvements simply by being rebuilt; this seems to be the intent of<br>
the Wayland authors for client projects. If Waffle were to use imported<br>
headers then, to receive the same improvements, someone (likely me)<br>
would need to diligently keep the imported headers up-to-date.<br>
<br>
As a bonus, Michel's patch is considerably smaller and requires less<br>
maintenance than an import-some-headers patch.<br>
<br>
And Michel's patch provides correct behavior, at least in my opinion:<br>
<br>
    - If a user or distro builds libwaffle against wayland < 1.10, then<br>
      that same libwaffle will continue to work with wayland >= 1.10.<br>
<br>
    - If a user or distro builds libwaffle against wayland == 1.10, then<br>
      the libwaffle will correctly emit an informative error message and<br>
      fail if it dlopens a libwayland-client < 1.10, thanks to the 'goto<br>
      error' in src/waffle/wayland/waylan_wrapper.c:RETRIEVE_WL_CLIENT_SYMBOL.<br>
      Specifically, the libwaffle will not crash or do undefined<br>
      behavior; it gracefully emits an error and fails responsibly.<br></blockquote><div><br></div><div>This makes me a bit sad.  One of the problems that Michael's patch does *not* solve is that, thanks to a Wayland header update (yay improvements!) the waffle build broke.  All that's been accomplished on that front is that the problem is papered over (we added the new entrypoing) and the next time a Wayland header update comes along that uses another new entrypoint, waffle will break again.  Maybe this is considered acceptable; that's not really my call.<br><br></div><div>--Jason <br></div></div><br></div></div>