Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 30d44e5a129f494f3b2aff6359d704ca4c38e2295ce7cd5f17f87c18219b4e65
Ticket: 7dc0420245e1d460c384806fc4a4f644e1e40006
tcltk-man2html.tcl: a Tk tree found next to --srcdir breaks the Tcl paths (exit 1, "not table of contents")
User & Date: dgp on 2026-10-21 17:53:45
Changes

  1. assignee changed to: "dkf"
  2. closer changed to: "nobody"
  3. comment changed to:
    When Tk is not in the directory given with <tt>--srcdir</tt> (or the default <tt>../..</tt>), 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 <tt>a/tcl</tt> and Tk in <tt>tk</tt> next to <tt>a</tt>:
    
    <verbatim>
    $ 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.
    </verbatim>
    
    and it exits with status 1, leaving incomplete output. <tt>findversion</tt> returns the parent directory as the new common prefix, which is stored in the variable <tt>tcltkdir</tt> shared with Tcl, so all Tcl paths (<tt>$tcltkdir/$tcldir</tt>) then point to a nonexistent <tt>a/../tcl</tt>. The version check only compares <tt><nowiki>[8-9].[0-9]</nowiki></tt>, 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 [/timeline?r=man2html-tk-beside|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 <tt>--tk</tt> was given, which is still an error (this also covers the case of [9babefdccc]).
    
  4. login: "dgp"
  5. mimetype: "text/plain"