Re: harfbuzz 2f72162: Fix crash in the Cairo build

classic Classic list List threaded Threaded
36 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: harfbuzz 2f72162: Fix crash in the Cairo build

Robert Pluim
Eli Zaretskii <[hidden email]> writes:

>> From: Robert Pluim <[hidden email]>
>> Cc: [hidden email]
>> Date: Fri, 08 Feb 2019 12:46:32 +0100
>>
>> >> ./configure                # This builds xfont.o ftfont.o xftfont.o ftxfont.o
>> >
>> > I wonder why we build both xftfont.o and ftxfont.o, when we only use
>> > one of them, if my reading of the code is correct.
>> >
>>
>> I did suggest removing ftxfont.o, but you said we had to deprecate it
>> first. Itʼs easy enough to not build in the HAVE_XFT config.
>
> That's orthogonal.  Regardless of whether we want to drop ftxfont.c, I
> don't understand why build with both xftfont.c and ftxfont.c.  They
> seem to be mutually exclusive, from the end-user POV.
>

Removing ftxfont.c from the HAVE_XFT build is the same as dropping it:

configure.ac:

    ## We used to allow building with FreeType and without Xft.
    ## However, the ftx font backend driver is not in good shape.
    if test "$HAVE_XFT" != "yes"; then
       dnl For the "Does Emacs use" message at the end.
       HAVE_XFT=no
       HAVE_FREETYPE=no
    else
   
  elif test "$HAVE_XFT" = "yes"; then
    FONT_OBJ="$FONT_OBJ ftfont.o xftfont.o ftxfont.o"
  elif test "$HAVE_FREETYPE" = "yes"; then
    FONT_OBJ="$FONT_OBJ ftfont.o ftxfont.o"
  fi

I donʼt mind either way: as you rightly point out, nobody can possibly
be using it :-)

>> >> I can cherry-pick this to the harfbuzz branch if you want.
>> >
>> > Thanks, please do.
>>
>> Will do.
>
> TIA

Done as 015a6e1df2

Robert

Reply | Threaded
Open this post in threaded view
|

Re: harfbuzz 2f72162: Fix crash in the Cairo build

Eli Zaretskii
> From: Robert Pluim <[hidden email]>
> Cc: [hidden email]
> Date: Fri, 08 Feb 2019 15:38:52 +0100
>
> > That's orthogonal.  Regardless of whether we want to drop ftxfont.c, I
> > don't understand why build with both xftfont.c and ftxfont.c.  They
> > seem to be mutually exclusive, from the end-user POV.
>
> Removing ftxfont.c from the HAVE_XFT build is the same as dropping it:
>
> configure.ac:
>
>     ## We used to allow building with FreeType and without Xft.
>     ## However, the ftx font backend driver is not in good shape.
>     if test "$HAVE_XFT" != "yes"; then
>        dnl For the "Does Emacs use" message at the end.
>        HAVE_XFT=no
>        HAVE_FREETYPE=no
>     else
>    
>   elif test "$HAVE_XFT" = "yes"; then
>     FONT_OBJ="$FONT_OBJ ftfont.o xftfont.o ftxfont.o"
>   elif test "$HAVE_FREETYPE" = "yes"; then
>     FONT_OBJ="$FONT_OBJ ftfont.o ftxfont.o"
>   fi
>
> I donʼt mind either way: as you rightly point out, nobody can possibly
> be using it :-)

The above is strange, since the code which uses font backends clearly
meant something else:

  #ifdef USE_CAIRO
    register_font_driver (&ftcrfont_driver, f);
  #else
  #ifdef HAVE_FREETYPE
  #ifdef HAVE_XFT
    register_font_driver (&xftfont_driver, f);
  #else /* not HAVE_XFT */
    register_font_driver (&ftxfont_driver, f);
  #endif /* not HAVE_XFT */
  #endif /* HAVE_FREETYPE */
    register_font_driver (&xfont_driver, f);
  #endif /* not USE_CAIRO */

Here, xftfont and ftxfont are clearly 2 more-or-less equivalent
alternatives, and bot rely on Freetype.  So I don't understand why not
having XFT is taken by configure.ac to mean there's no Freetype,
either.  Sounds like a mistake, or did I miss something?

> >> >> I can cherry-pick this to the harfbuzz branch if you want.
> >> >
> >> > Thanks, please do.
> >>
> >> Will do.
> >
> > TIA
>
> Done as 015a6e1df2

Thanks.

Reply | Threaded
Open this post in threaded view
|

Re: harfbuzz 2f72162: Fix crash in the Cairo build

Robert Pluim
Eli Zaretskii <[hidden email]> writes:

> The above is strange, since the code which uses font backends clearly
> meant something else:
>
>   #ifdef USE_CAIRO
>     register_font_driver (&ftcrfont_driver, f);
>   #else
>   #ifdef HAVE_FREETYPE
>   #ifdef HAVE_XFT
>     register_font_driver (&xftfont_driver, f);
>   #else /* not HAVE_XFT */
>     register_font_driver (&ftxfont_driver, f);
>   #endif /* not HAVE_XFT */
>   #endif /* HAVE_FREETYPE */
>     register_font_driver (&xfont_driver, f);
>   #endif /* not USE_CAIRO */
>
> Here, xftfont and ftxfont are clearly 2 more-or-less equivalent
> alternatives, and bot rely on Freetype.  So I don't understand why not
> having XFT is taken by configure.ac to mean there's no Freetype,
> either.  Sounds like a mistake, or did I miss something?
>

Interesting. Glenn made that change in
46dcfee46cb241a0f8e34da679ca8b42e8ee8d46 , but thatʼs quite a while
ago.

Like I said, we can change stuff around here, but I think the easiest
thing to do is just get rid of it.

Robert

Reply | Threaded
Open this post in threaded view
|

Re: harfbuzz 2f72162: Fix crash in the Cairo build

Eli Zaretskii
> From: Robert Pluim <[hidden email]>
> Cc: [hidden email]
> Date: Fri, 08 Feb 2019 17:41:02 +0100
>
> >   #ifdef HAVE_FREETYPE
> >   #ifdef HAVE_XFT
> >     register_font_driver (&xftfont_driver, f);
> >   #else /* not HAVE_XFT */
> >     register_font_driver (&ftxfont_driver, f);
> >   #endif /* not HAVE_XFT */
> >   #endif /* HAVE_FREETYPE */
> >     register_font_driver (&xfont_driver, f);
> >   #endif /* not USE_CAIRO */
> >
> > Here, xftfont and ftxfont are clearly 2 more-or-less equivalent
> > alternatives, and bot rely on Freetype.  So I don't understand why not
> > having XFT is taken by configure.ac to mean there's no Freetype,
> > either.  Sounds like a mistake, or did I miss something?
>
> Interesting. Glenn made that change in
> 46dcfee46cb241a0f8e34da679ca8b42e8ee8d46 , but thatʼs quite a while
> ago.
>
> Like I said, we can change stuff around here, but I think the easiest
> thing to do is just get rid of it.

Is XFT sufficiently widespread these days that we can rely on it being
available on most systems?  If so, I guess it's okay to drop
ftxfont.c.

Reply | Threaded
Open this post in threaded view
|

Re: harfbuzz 2f72162: Fix crash in the Cairo build

Glenn Morris-3
Eli Zaretskii wrote:

> Is XFT sufficiently widespread these days that we can rely on it being
> available on most systems?  If so, I guess it's okay to drop
> ftxfont.c.

Every GNU/Linux distribution provides Xft. Emacs's configure
requirements in terms of version numbers are trivially satisfied even on
the likely oldest supported distribution, RHEL6.

In recent years, there are a few (<= 5) bug reports each year from
builds that are identifiably X11 without XFT. Last year there were two.
Both were Gentoo builds passing --without-xft. One (30203) is an open
report about how the non-XFT build is worse than the XFT build.

Reply | Threaded
Open this post in threaded view
|

Re: harfbuzz 2f72162: Fix crash in the Cairo build

Eli Zaretskii
> From: Glenn Morris <[hidden email]>
> Date: Sat, 09 Feb 2019 14:20:13 -0500
> Cc: Robert Pluim <[hidden email]>, [hidden email]
>
> Eli Zaretskii wrote:
>
> > Is XFT sufficiently widespread these days that we can rely on it being
> > available on most systems?  If so, I guess it's okay to drop
> > ftxfont.c.
>
> Every GNU/Linux distribution provides Xft.

Thanks.  What about non-GNU Posix hosts that run X?  Do we have any
information about the situation there?

Reply | Threaded
Open this post in threaded view
|

Re: harfbuzz 2f72162: Fix crash in the Cairo build

Stefan Monnier
>> Every GNU/Linux distribution provides Xft.
> Thanks.  What about non-GNU Posix hosts that run X?

AFAIK the issue isn't GNU-vs-other but old-X vs new-X.  Xft is basically
part of what is expected of a recent enough X11 installation.  We could
drop ftx support from `master`s `configure` and see if anyone notices.


        Stefan


Reply | Threaded
Open this post in threaded view
|

Re: harfbuzz 2f72162: Fix crash in the Cairo build

Eli Zaretskii
In reply to this post by Glenn Morris-3
> From: Glenn Morris <[hidden email]>
> Cc: Robert Pluim <[hidden email]>,  [hidden email]
> Date: Sat, 09 Feb 2019 14:20:13 -0500
>
> In recent years, there are a few (<= 5) bug reports each year from
> builds that are identifiably X11 without XFT. Last year there were two.
> Both were Gentoo builds passing --without-xft. One (30203) is an open
> report about how the non-XFT build is worse than the XFT build.

Btw, as long as we are talking about this: could you please tell why
configure.ac disables HAVE_FREETYPE when the build is without XFT?
AFAIU, ftxfont needs Freetype, so if we disabvle the latter, ftxfont
cannot be a replacement for XFT.

Reply | Threaded
Open this post in threaded view
|

Re: harfbuzz 2f72162: Fix crash in the Cairo build

Eli Zaretskii
In reply to this post by Stefan Monnier
> From: Stefan Monnier <[hidden email]>
> Date: Sun, 10 Feb 2019 09:47:38 -0500
>
> >> Every GNU/Linux distribution provides Xft.
> > Thanks.  What about non-GNU Posix hosts that run X?
>
> AFAIK the issue isn't GNU-vs-other but old-X vs new-X.  Xft is basically
> part of what is expected of a recent enough X11 installation.  We could
> drop ftx support from `master`s `configure` and see if anyone notices.

We need to disable it by default first.  Then, if no one complains, we
could remove it after some time.

Reply | Threaded
Open this post in threaded view
|

Re: harfbuzz 2f72162: Fix crash in the Cairo build

Stefan Monnier
>> >> Every GNU/Linux distribution provides Xft.
>> > Thanks.  What about non-GNU Posix hosts that run X?
>> AFAIK the issue isn't GNU-vs-other but old-X vs new-X.  Xft is basically
>> part of what is expected of a recent enough X11 installation.  We could
>> drop ftx support from `master`s `configure` and see if anyone notices.
> We need to disable it by default first.

If we do it with a trivial change that we can easily revert before we
start pretesting Emacs-27, I see no reason why we'd first need to change
the default.


        Stefan

Reply | Threaded
Open this post in threaded view
|

Re: harfbuzz 2f72162: Fix crash in the Cairo build

Glenn Morris-3
In reply to this post by Eli Zaretskii
Eli Zaretskii wrote:

> What about non-GNU Posix hosts that run X?

BSDs?
The data suggest very low Emacs usage there, eg
https://debbugs.gnu.org/stats/emacs.html

Anyway, I'm sure they all have Xft too. Eg
https://svnweb.freebsd.org/ports/head/x11-fonts/libXft/
ftp://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/x11/libXft/README.html
https://man.openbsd.org/Xft.3

Reply | Threaded
Open this post in threaded view
|

Re: harfbuzz 2f72162: Fix crash in the Cairo build

Glenn Morris-3
In reply to this post by Eli Zaretskii
Eli Zaretskii wrote:

> Btw, as long as we are talking about this: could you please tell why
> configure.ac disables HAVE_FREETYPE when the build is without XFT?
> AFAIU, ftxfont needs Freetype, so if we disabvle the latter, ftxfont
> cannot be a replacement for XFT.

I don't think it's my doing. See af17b98 and 7bbec45 (from 2009).
"We used to allow building with FreeType and without Xft.
However, the ftx font backend driver is not in good shape."
I don't imagine it has improved in the past decade.

Ref also
http://lists.gnu.org/r/emacs-devel/2009-04/msg00514.html

where pretty much the same discussion seems to have been going on.


Reply | Threaded
Open this post in threaded view
|

Re: harfbuzz 2f72162: Fix crash in the Cairo build

Eli Zaretskii
In reply to this post by Stefan Monnier
> From: Stefan Monnier <[hidden email]>
> Cc: [hidden email]
> Date: Sun, 10 Feb 2019 13:18:25 -0500
>
> >> >> Every GNU/Linux distribution provides Xft.
> >> > Thanks.  What about non-GNU Posix hosts that run X?
> >> AFAIK the issue isn't GNU-vs-other but old-X vs new-X.  Xft is basically
> >> part of what is expected of a recent enough X11 installation.  We could
> >> drop ftx support from `master`s `configure` and see if anyone notices.
> > We need to disable it by default first.
>
> If we do it with a trivial change that we can easily revert before we
> start pretesting Emacs-27, I see no reason why we'd first need to change
> the default.

Experience shows that the complaints come in too late, and the hope
that we can easily revert such a change is frequently thwarted.

Reply | Threaded
Open this post in threaded view
|

Re: harfbuzz 2f72162: Fix crash in the Cairo build

Stefan Monnier
> Experience shows that the complaints come in too late, and the hope
> that we can easily revert such a change is frequently thwarted.

AFAIK it's been "impossible" to compile Emacs with ftx backend but
without the xft library since 2009.

So, maybe I should rather argue that it's high time we scrap the
code altogether since it's been useless and unused for 10 years now.


        Stefan


Reply | Threaded
Open this post in threaded view
|

Re: harfbuzz 2f72162: Fix crash in the Cairo build

Robert Pluim
Stefan Monnier <[hidden email]> writes:

>> Experience shows that the complaints come in too late, and the hope
>> that we can easily revert such a change is frequently thwarted.
>
> AFAIK it's been "impossible" to compile Emacs with ftx backend but
> without the xft library since 2009.
>
> So, maybe I should rather argue that it's high time we scrap the
> code altogether since it's been useless and unused for 10 years now.

+1

Reply | Threaded
Open this post in threaded view
|

Re: harfbuzz 2f72162: Fix crash in the Cairo build

Eli Zaretskii
In reply to this post by Glenn Morris-3
> From: Glenn Morris <[hidden email]>
> Cc: [hidden email],  [hidden email]
> Date: Sun, 10 Feb 2019 13:36:39 -0500
>
> Eli Zaretskii wrote:
>
> > Btw, as long as we are talking about this: could you please tell why
> > configure.ac disables HAVE_FREETYPE when the build is without XFT?
> > AFAIU, ftxfont needs Freetype, so if we disabvle the latter, ftxfont
> > cannot be a replacement for XFT.
>
> I don't think it's my doing. See af17b98 and 7bbec45 (from 2009).
> "We used to allow building with FreeType and without Xft.
> However, the ftx font backend driver is not in good shape."
> I don't imagine it has improved in the past decade.
>
> Ref also
> http://lists.gnu.org/r/emacs-devel/2009-04/msg00514.html
>
> where pretty much the same discussion seems to have been going on.

Ah, okay.  So you are saying that we've already effectively deprecated
and disabled ftxfont 10 years ago?  In that case, we could indeed
retire it in Emacs 27.

Thanks.

12