Artifacts Associated With Ticket bf2652aed
Ticket change [67cc80b2c7] (rid 257177) by anonymous on 2026-09-29 14:21:26:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-plain"
- 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.
- foundin initialized to: "Tcl 9.1b1"
- is_private initialized to: "0"
- login: "anonymous"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "anonymous"
- subsystem initialized to: "07. Variables"
- title initialized to:
Tcl 9.1b1 with zipfs support: incorrect value for tcl_library variable
- type initialized to: "Bug"
Ticket change [555465e140] (rid 257180) by jan.nijtmans on 2026-09-29 21:57:18:
- assignee changed to: "jan.nijtmans"
- 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>
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
Ticket change [e58771955f] (rid 257269) by anonymous on 2026-10-02 14:10:19:
- 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. - login: "anonymous"
- mimetype: "text/plain"
- icomment:
Ticket change [598c600d42] (rid 257273) by jan.nijtmans on 2026-10-02 14:29:21:
- 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.
- login: "jan.nijtmans"
- mimetype: "text/x-markdown"
- icomment:
Ticket change [9c950ed371] (rid 257280) by anonymous on 2026-10-02 15:40:03:
- icomment:
OH yes, that does indeed work, both for the little test problem and the actual code I was trying to build/fix. Thanks.
- login: "anonymous"
- mimetype: "text/plain"
- icomment: