Skip to content
Tcl Source Code View Ticket
Login

View Ticket

tcltk-man2html.tcl: a Tk tree found next to --srcdir breaks the Tcl paths (exit 1, "not table of contents")

Open7dc0420245e1d460c384806fc4a4f644e1e40006Created 45 days agoUpdated 42 days ago
Descriptionwiki2026-10-18 10:31:31
When Tk is not in the directory given with --srcdir (or the default ../..), tools/tcltk-man2html.tcl looks for it in the parent directory too, and takes the first tree whose generic/tk.h has a matching version, even an unrelated one. With Tcl in a/tcl and Tk in tk next to a:
$ tclsh tools/tcltk-man2html.tcl --srcdir=a --htmldir=out
using Tcl source directory a/tcl
using Tk source directory a/../tk
...
scanning section Tcl Commands

wish: KEYWORDS: make-manpage-section: not table of contents.

and it exits with status 1, leaving incomplete output. findversion returns the parent directory as the new common prefix, which is stored in the variable tcltkdir shared with Tcl, so all Tcl paths ($tcltkdir/$tcldir) then point to a nonexistent a/../tcl. The version check only compares [8-9].[0-9], so with 9.0 it also took a 9.1 Tk tree that happened to be there.

Seen with 9.0.5 and 9.1.0; 8.6 does not search the parent directory and stops with "couldn't find Tk".

Proposed fix in branch man2html-tk-beside: when the Tcl help is built too, a Tk tree found outside the Tcl directory is not used. Without a usable Tk the tool builds the Tcl help only and says so, unless --tk was given, which is still an error (this also covers the case of [9babefdccc]).

Referenced by1
  • cc9431b2e3Ticket [b2e3cbdc8f] `make html` fails status still Open with 4 other changes ticket2026-10-20 12:40:54
serhiy.storchaka Ticket [7dc0420245]: 1 change [History diff]2026-10-20 18:11:29
dgp Ticket [7dc0420245]: 5 changes [History diff]2026-10-21 17:53:45
Log in (anonymous is fine) to add a comment.