Tk Source Code

View Ticket
Login
Ticket UUID: 25757f142eb31f1ad64f45fa756c54d0dfee580a
Title: Tk not found in threads in 8.7 single file build binaries
Type: Bug Version: 8.7a6
Submitter: anonymous Created on: 2021-12-22 17:56:25
Subsystem: 85. Win Build Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2026-10-20 17:28:18
Resolution: None Closed By: nobody
    Closed on:
Description:
Cannot do a "package require Tk" w/o an error in the 8.7 single file build binaries from a thread (not a problem from the main thread however).

These are the builds from https://github.com/tcltk/tk/actions?query=workflow%3A%22Build+Binaries%22
User Comments: serhiy.storchaka added on 2026-10-20 17:28:18:

Still reproducible on Windows with the current main (9.1), in wish91.exe built with win/makefile.vc and not installed, with Thread 3.0.7:

package require Thread
set t [thread::create]
thread::send $t {package require tk}     ;# can't find package tk
thread::send $t {load .../tcl9tk91.dll Tk} ;# works

Tk itself works in the new thread; it finds its library in the zip archive of tcl9tk91.dll (//zipfs:/lib/tk/tk_library). But the new interpreter cannot find the package: wish initializes Tk in the main interpreter without package ifneeded tk, the auto_path of the new interpreter does not contain the Tk directories, and the zip archive of Tk contains only tk_library, not a pkgIndex.tcl. With an installed Tk (lib/tk9.1/pkgIndex.tcl on auto_path), package require tk works in a thread, as I checked on Linux.

Possible fixes: add pkgIndex.tcl to the zip archive of Tk and //zipfs:/lib to the default auto_path, or let wish register Tk with Tcl_StaticLibrary(NULL, "Tk", ...) and define package ifneeded tk for all interpreters.


fvogel added on 2021-12-23 21:37:36:

Oh I see, sorry. The builds are artifacts that can be accessed here for instance: https://github.com/tcltk/tk/actions/runs/1614667578


fvogel added on 2021-12-23 21:35:21:
Are you really downloading nightly builds fron continuous integration at Github? How do you do that?