[PATCH wayland v2] Remove protocol/wayland.dtd

Pekka Paalanen ppaalanen at gmail.com
Mon Nov 9 03:41:06 PST 2015


On Mon, 9 Nov 2015 11:16:09 +0000
Auke Booij <auke at tulcod.com> wrote:

> On 9 November 2015 at 10:54, Peter Hutterer <peter.hutterer at who-t.net> wrote:
> > On 9/11/2015 20:39 , Auke Booij wrote:
> >>
> >> On 6 November 2015 at 11:26, Pekka Paalanen <ppaalanen at gmail.com> wrote:

> >>> Would it be bad if wayland-scanner embedded the DTD and in addition we
> >>> installed the DTD as a file too? So scanner used only its internal
> >>> copy. I'd probably try that if someone wants the DTD as a separate file
> >>> for their own use. In that case the trick would be handy.
> >>>
> >>>
> >>> Thanks,
> >>> pq
> >>
> >>
> >> That sounds like the scanner will become confusing to use ("wait, so
> >> where DOES it get the DTD from, if not this file?"), unless you'd
> >> actually read the source code. Or this should be very clearly
> >> documented.
> >
> >
> > commenting in the code - sure. but communicating this to the user isn't
> > needed IMO, it's not really different to the normal scanner behaviour of
> > failing when there's something it doesn't expect (though unfortunately right
> > now the scanner also ignores things where IMO it should just fail).
> >
> > Cheers,
> >   Peter
> 
> I'm not sure we're talking about the same issue here. What I'm
> imagining is a user/developer trying to get into the internals of
> wayland dev, encountering the protocols, and then seeing a DTD file
> next to them. He* thinks "ah, surely that's used for verification, and
> it's where I can start implementing my dirty hack". He modifies the
> DTD , but the scanner doesn't behave differently. He removes the DTD,
> but the scanner still passes the DTD check. Then he thinks "wait, so
> where DOES it get the DTD from, if not this file?", at which point he
> opens up the source code and learns that the DTD exists in two places.
> 
> Documenting this clearly will save every future person who wants to
> get involved in protocol development 1 hour of figuring things out
> when they don't work. That, or not installing the DTD in two places
> (so either install as a file or embedded in the executable, but not
> both).
> 
>  * or she

If someone starts hacking like that, I'd expect them to start hacking
in the wayland repository, as they will need to hack on scanner.c also.
When they change the DTD in the source tree, the modification will
automatically be in the newly built scanner.

Editing an installed DTD either cannot achieve anything because you
need to edit scanner.c anyway to implement your new things, or then you
are not using wayland-scanner to begin with.

I believe comments are enough. I suppose the DTD error message from
wayland-scanner could refer to built-in DTD, that would be a small
change and make it obvious. Just add one word in the warning message.


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20151109/dc6a83bb/attachment-0001.sig>


More information about the wayland-devel mailing list