Tk Source Code

View Ticket
Login
Ticket UUID: b900dc755201139b5a7cecada73405c7681b7c03
Title: Compilation using installed TCL fails if TCL source is not accessible
Type: Bug Version: 8.6.18, 9.0.5, 9.1.0
Submitter: anonymous Created on: 2025-10-29 13:29:10
Subsystem: 84. Unix Build Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2026-10-07 11:20:03
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2026-10-07 11:20:03
Description:

We are installing TCL and TK on a HPC cluster using Lmod environtment modules. Usually different software might get installed by different admin accounts.

This now happend to be the case where person A installed TCL and person B tried to install TK on top:

$ ./configure --with-tcl=$EBROOTTCL/lib

However the installed tclConfig.sh contains multiple references to the original build environment in TCL_BUILD_* variables and TCL_SRC_DIR pointing to the original source location. In this case inside a folder only accessible to person A.

The Tk configure process uses TCL_SRC_DIR and adds various -I flags based on that which causes the build to fail as the compiler can't access that path.

I can't find any hint that the TCL sources are required for building against an installed TCL. The option description is:

--with-tcl=DIR		Specifies the directory containing the Tcl
			binaries and Tcl's platform-dependent
			configuration information.

Strangely enough compilation succeeds when the folder does not exist or is empty. Probably because the include folder of the Tcl installation is found and used by the compiler which contains the required headers.

Why is TCL_SRC_DIR used? Shouldn't that be at least documented?
Wouldn't $TCL_PREFIX/include suffice as the used include path?

User Comments: jan.nijtmans added on 2026-10-07 11:20:03:

The [d80a5f1b14ca4b01|MinGW part] is merged now too.

Thanks!

Closing


serhiy.storchaka added on 2026-10-05 07:39:14:

The Unix part was merged into main in [2e03afb4d0] and 9.0 in [c0549801a3]. The MinGW part in win-tcl-installed-headers is not merged yet.


serhiy.storchaka added on 2026-10-05 07:35:25:

Backported to 8.6 in [6b825fa561].


serhiy.storchaka added on 2026-10-02 19:34:40:

TCL_SRC_DIR is used because Tk normally builds against the Tcl source tree, and it never used TCL_INCLUDE_SPEC. Tk needs only the public Tcl headers.

Proposed fixes in branches unix-tcl-installed-headers and win-tcl-installed-headers (MinGW): configure uses the installed Tcl headers if the Tcl source tree is not readable. The MSVC build (makefile.vc) still requires the Tcl sources.