http/pkgIndex.tcl is missing some autoload entries
Open923bf7ac55191fd8c5f8c0c9fb22ebe2f1095e99Created 8 days agoUpdated 8 days ago
Descriptionplain2026-11-24 23:10:55
Some http commands will be unavailable when requiring the http package indirectly in a static Tcl build because the auto_load command list in pkgIndex.tcl appears to out-of-date.
A workaround is to manually trigger the auto-loading via a command that is listed, e.g. 'auto_load ::http::config'.
Here is an example of triggering the problem via an indirect require of http via another package in a static Tcl build:
### Files
# test.tcl
set scriptDir [file dirname [info script]]
puts "Old auto_path: $auto_path"
set auto_path [linsert $auto_path 0 [file join $scriptDir "testlib"]]
puts "New auto_path: $auto_path"
package require testpackage
# testlib/testpackage.tcl
puts "HTTP VERSION: [package require http]"
puts "HTTP COMMANDS: [info commands ::http::*]"
puts [::http::quoteString " "]
puts "End of script"
package provide testpackage 1.0.0
# testlib/pkgIndex.tcl
package ifneeded testpackage 1.0.0 [list source [file join $dir testpackage.tcl]]
### Script output
$ /usr/pkg/tcl/9.0/bin/tclsh test.tcl
Old auto_path: //zipfs:/lib/tcl/tcl_library //zipfs:/lib/tcl /usr/pkg/tcl/9.0/lib
New auto_path: ./testlib //zipfs:/lib/tcl/tcl_library //zipfs:/lib/tcl /usr/pkg/tcl/9.0/lib
HTTP VERSION: 2.10.2
HTTP COMMANDS:
invalid command name "::http::quoteString"
while executing
"::http::quoteString " ""
(file "./testlib/testpackage.tcl" line 3)
invoked from within
"source ./testlib/testpackage.tcl"
("package ifneeded testpackage 1.0.0" script)
invoked from within
"package require testpackage"
(file "test.tcl" line 5)
Log in (anonymous is fine) to add a comment.