Skip to content
Tcl Source Code History Of Ticket bf2652aedf
Login

History Of Ticket bf2652aedf

Artifacts Associated With Ticket bf2652aedf

  1. Ticket change [67cc80b2c7] (rid 257177) by anonymous on 2026-09-29 14:21:26:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-plain"
    4. comment initialized to:
      Today, I compiled the Unix version of Tcl/Tk 9.1b1 with zipfs support (the default). When I tried an old script, it failed on this line:
      
      source [info library]/init.tcl
      
      After some digging, I found that 'info library' was returning an incorrect value. Compare Tcl 9.0 to Tcl 9.1b1, both compiled with zipfs support on the same machine.
      
      % ~/tcltk9.1/bin/wish9.1 
      % echo [info library]
      /Users/rmtrines/tcltk9.1/lib/tcl9
      %
      % ~/tcltk9/bin/wish9.0 
      % echo [info library]
      //zipfs:/lib/tcl/tcl_library
      %
      
      The problem with that: when Tcl 9.1 is compiled and installed with zipfs support, the directory tcltk9.1/lib/tcl9 does not contain the file init.tcl, needed by my script.
      
      When I run this sequence of commands in wish9.1:
      % set tcl_library //zipfs:/lib/tcl/tcl_library
      //zipfs:/lib/tcl/tcl_library
      % info library
      //zipfs:/lib/tcl/tcl_library
      % source [info library]/init.tcl
      % 
      
      Hey, it works fine, no errors. So it's purely the value of tcl_library that is causing the problem.
      
    5. foundin initialized to: "Tcl 9.1b1"
    6. is_private initialized to: "0"
    7. login: "anonymous"
    8. priority initialized to: "5 Medium"
    9. resolution initialized to: "None"
    10. severity initialized to: "Minor"
    11. status initialized to: "Open"
    12. submitter initialized to: "anonymous"
    13. subsystem initialized to: "07. Variables"
    14. title initialized to:
      Tcl 9.1b1 with zipfs support: incorrect value for tcl_library variable
      
    15. type initialized to: "Bug"
  2. Ticket change [555465e140] (rid 257180) by jan.nijtmans on 2026-09-29 21:57:18:

    1. assignee changed to: "jan.nijtmans"
    2. icomment:
      I cannot reproduce this with Tcl/Tk 9.1.0 final:
      <pre>
      $ wish9.1
      % info library 
      //zipfs:/lib/tcl/tcl_library
      % set tcl_library
      //zipfs:/lib/tcl/tcl_library
      % set tk_library
      //zipfs:/lib/tk/tk_library
      </pre>
      
    3. login: "jan.nijtmans"
    4. mimetype: "text/x-fossil-wiki"
  3. Ticket change [e58771955f] (rid 257269) by anonymous on 2026-10-02 14:10:19:

    1. icomment:
      Let me add more info.
      
      Here is a little C program that creates a Tcl interpreter and tries to run a little script.
      
      #include <stdio.h>
      #include <tcl.h>
      
      int main() {
      
        char TclCommand[2048];
        int retval;
      
        printf("C start\n");
        Tcl_Interp *interp = Tcl_CreateInterp();
        Tcl_Init(interp);
        sprintf(TclCommand,"source setupscript.tcl\n");
        retval = Tcl_Eval(interp,TclCommand);
        if (retval !=TCL_OK) {
          printf("Error %d: %s\n", retval, 
      	   Tcl_GetStringResult(interp));
        }
        Tcl_DeleteInterp(interp);
        printf("C end\n");
        return 0;
      }
      
      Here is the little script needed by the program:
      
      puts "Tcl start"
      puts -nonewline "Tcl version: "
      puts [info tclversion]
      puts [info library]
      puts "Tcl end"
      
      Here is how I compiled it:
      
      #!/bin/sh
      
      export TCLDIR=${HOME}/tcltk9.1
      
      gcc-16 -o tcl_init_test -I${TCLDIR}/include tcl_init_test.c -L${TCLDIR}/lib -ltcl9.1
      
      This is the output I get for Tcl 9.1:
      
      % ./tcl_init_test
      C start
      Tcl start
      Tcl version: 
      9.1
      Error 1: no library has been specified for Tcl
      C end
      
      To compare: this is the output I get for Tcl 9.0, in the same environment:
      
      % ./tcl_init_test
      C start
      Tcl start
      Tcl version: 9.0
      //zipfs:/lib/tcl/tcl_library
      Tcl end
      C end
      
      Note that both Tcl versions have been configured in the same way:
      
      #!/bin/sh
      
      export CC=gcc-16
      
      ./configure --prefix=${HOME}/tcltk9.1
      
      Hope this helps.
      
    2. login: "anonymous"
    3. mimetype: "text/plain"
  4. Ticket change [598c600d42] (rid 257273) by jan.nijtmans on 2026-10-02 14:29:21:

    1. icomment:
      The release notes for Tcl 9.1 mention:
      
      - [Custom applications must call Tcl\_FindExecutable or TclZipfs\_AppHook to initialize Tcl](https://core.tcl-lang.org/tips/doc/trunk/tip/732.md) *Potential incompatibility*
      
      So, can you add a call to `TclZipfs_AppHook(&argc, &argv);` before doing the `Tcl_CreateInterp()` call?  This will mount the zipfile packed with the Tcl shared library. That should help to find the `init.tcl` file.
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-markdown"
  5. Ticket change [9c950ed371] (rid 257280) by anonymous on 2026-10-02 15:40:03:

    1. icomment:
      OH yes, that does indeed work, both for the little test problem and the actual code I was trying to build/fix.
      
      Thanks.
      
    2. login: "anonymous"
    3. mimetype: "text/plain"