Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 4fa6946ec66a9994c78aee9a98e9a20804c374e87502c762af9f5da1c3a59d5a
Ticket: 6fbabfe1661c22e7990bb917e9fa49cc16e016ea
Tkinter: Cannot find a usable init.tcl with recent core-9-0-branch
User & Date: apnadkarni on 2025-11-17 06:13:00
Changes

  1. closedate changed to: "2460996.75903088"
  2. closer changed to: "apnadkarni"
  3. icomment:
    Don,
    
    I feel your pain. Maybe more because I've been trying to fix this ping-pong of broken behavior for a few months now. 
    
    The fundamental problem is that the search for Tcl library (and encodings) is suffering from the "noble" aim of attempting to fix up errors in configuration or installs by searching up and down the directory hierarchy. As a consequence, when Tcl is not not run in a location corresponding to where it is configured and does not define TCL_LIBRARY either (as is the case for the unixInit-3.2 test), there is a chance it will pick up the wrong directory corresponding to some other version of Tcl.
    
    This is what you are seeing.
    
    Regarding your question about why an --enable-zipfs build should be looking anywhere but zipfs, I would agree with you. In fact, I would go further and ask why, even on --disable-zipfs builds, should it look anywhere than the directory set by the configure script or explicitly set by user via TCL_LIBRARY. 
    
    The problem in enforcing this is that
    
    - on some macOS versions and architectures, there is no indication at compile time that zipfs does not work. So ZIPFS_BUILD may be defined but does not actually work at runtime. This was the root of the original macos tkinter ticket. Fixing this needs somone familiar with all the macOS variants to error out on appropriate versions of macOS to not define ZIPFS_BUILD.
    
    - further compounding the problem is that Tcl generously permits applications to initialize using one of several functions - Tcl_Init, Tcl_CreateInterp, Tcl_InitSubSystems, TclZipfs_AppHook and even Tcl_SetPanicProc. What this leads to is multiple recursive calls to initialize various subsystems and different order of initialization. This is another (misguided and half-baked imo) attempt by Tcl at flexibility. Some applications, like tkinter, and likely Ruby and Perl equivalents do not even call TclZipfs_AppHook at all and expect the default Tcl zipfs-enabled build to work.
    
    TIP 732 is my attempt to fix this but is going to need testing effort from developers on the affected platforms (I do not have access to macos and have only a rudimentary knowledge of Linux/Unix installation conventions).
    
  4. login: "apnadkarni"
  5. mimetype: "text/x-markdown"