Tk Source Code

View Ticket
Login
Ticket UUID: 1dfc71ae4a9f54a7fa32f3580271e30a57a3512
Title: configure fails without HarfBuzz although --enable-bidi was not given
Type: Bug Version: 9.1b1
Submitter: serhiy.storchaka Created on: 2026-09-25 14:50:15
Subsystem: 84. Unix Build Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2026-10-05 15:03:06
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2026-10-05 15:03:06
Description:

Bidi support is enabled by default on X11, and if the HarfBuzz development files are not found, configure stops with

configure: error: --enable-bidi requires HarfBuzz development files.

although --enable-bidi was not given. If HarfBuzz is found but too old, configure only warns and disables Bidi ([5f92e6cb84]), so a missing HarfBuzz is treated more strictly than an old one. I encountered this when building Tk on FreeBSD, NetBSD, OpenBSD, DragonFly and openSUSE, where HarfBuzz is not installed by default. The error message also does not mention --disable-bidi.

Without an explicit --enable-bidi, configure could warn and disable Bidi, as it does for an old HarfBuzz, and fail only if --enable-bidi was given.

User Comments: jan.nijtmans added on 2026-10-05 15:03:06:

This looks like the right approach to me.

Thanks for doing this!

Merged to [427bb09f52654fff|trunk]

Since Tk 9.0 doesn't have bidi, there's no backporting to be done.


serhiy.storchaka added on 2026-09-29 11:11:15:

Xft has the same problem as HarfBuzz: Bidi requires Xft, but --disable-xft is overridden by the default Bidi (Xft is forced on again), and if Xft is not found, configure says "falling back to classic fonts" but still selects the Bidi backend, which cannot be built without Xft.

Alternative branch configure-bidi-requires-xft, based on configure-bidi-without-harfbuzz, treats Xft like HarfBuzz: --disable-xft or a missing Xft disables the default Bidi with a notice or warning, and with an explicit --enable-bidi it is an error. This is a larger change (the Xft check had to be moved before the Bidi setup), so it is in a separate branch.


serhiy.storchaka added on 2026-09-25 14:51:30:

Proposed fix in [b83a809314] (branch configure-bidi-without-harfbuzz): without --enable-bidi, a missing, too old or unusable HarfBuzz only disables Bidi with a warning; with --enable-bidi it is an error which mentions --disable-bidi.

This also fixes the too old case: configure disabled Bidi but still defined HAVE_BIDI, so Tk was built with the non-Bidi font code but with TK_DRAW_IN_CONTEXT and TK_LAYOUT_WITH_BASE_CHUNKS.