From b549198cba95155f9b636883b2125a45dbf5d478 Mon Sep 17 00:00:00 2001 From: Julian Noble Date: Mon, 27 Jul 2026 02:14:06 +1000 Subject: [PATCH] build outputs: punk::libunknown 0.2.3 into bootsupport and _vfscommon Regenerated by 'make.tcl modules' + 'bootsupport' + 'vfscommonupdate'. punkshell's own boot paths load punk::libunknown from bootsupport, so the pkgIndex namespace fix only reaches a running shell once the snapshot carries it. Two catch-ups ride along, neither authored here: argparsingtest 1.0.0 -> 1.2.0 in _vfscommon (from commit 4bd0ab13 - the previous change-set deliberately held this back while that module was still uncommitted work in progress), and the _vfscommon copy of the templates modpod, which was lagging the copy committed with the G-125 build outputs in de049fba. All three copies (modules/, bootsupport, _vfscommon) now share sha1 9115a3a37992. Assisted-by: harness=claude; primary-model=claude-opus-5[1m]; api-location=anthropic.com --- ...ibunknown-0.2.2.tm => libunknown-0.2.3.tm} | 35 +- ...gtest-1.0.0.tm => argparsingtest-1.2.0.tm} | 779 +++++++++++++++++- ...ibunknown-0.2.2.tm => libunknown-0.2.3.tm} | 35 +- .../modules/punk/mix/templates-0.2.0.tm | Bin 296821 -> 297485 bytes 4 files changed, 794 insertions(+), 55 deletions(-) rename src/bootsupport/modules/punk/{libunknown-0.2.2.tm => libunknown-0.2.3.tm} (98%) rename src/vfs/_vfscommon.vfs/modules/{argparsingtest-1.0.0.tm => argparsingtest-1.2.0.tm} (72%) rename src/vfs/_vfscommon.vfs/modules/punk/{libunknown-0.2.2.tm => libunknown-0.2.3.tm} (98%) diff --git a/src/bootsupport/modules/punk/libunknown-0.2.2.tm b/src/bootsupport/modules/punk/libunknown-0.2.3.tm similarity index 98% rename from src/bootsupport/modules/punk/libunknown-0.2.2.tm rename to src/bootsupport/modules/punk/libunknown-0.2.3.tm index 471c5e0e..22a9599b 100644 --- a/src/bootsupport/modules/punk/libunknown-0.2.2.tm +++ b/src/bootsupport/modules/punk/libunknown-0.2.3.tm @@ -7,7 +7,7 @@ # (C) 2025 # # @@ Meta Begin -# Application punk::libunknown 0.2.2 +# Application punk::libunknown 0.2.3 # Meta platform tcl # Meta license MIT # @@ Meta End @@ -18,6 +18,17 @@ # from src/modules/AGENTS.md "Versioning And Releases" - bumping means # renaming the file AND updating the Meta line above, the manpage_begin line # below and the provide-block version, then appending a line here): +#0.2.3 - source_pkgindex: index scripts run in the GLOBAL namespace again (in a +# local frame, as 0.2.0 made them). 0.2.0 moved the source into a proc of +# THIS namespace, so a pkgIndex.tcl's relative 'namespace eval foo' created +# ::punk::libunknown::foo instead of ::foo - stock tclPkgUnknown lives in :: +# and indexes have always resolved relative names against the global +# namespace. Indexes that define commands at source time for their own +# ifneeded scripts to call therefore failed at require time with 'invalid +# command name'. Found 2026-07-27 on twapi 4.7.2 (its index defines +# twapi::set_scriptdir and its ifneeded script calls it); the pattern is +# common in third-party indexes. Frame isolation is preserved - the body +# runs via apply with :: as its namespace. #0.2.2 - zipfs_tm_UnknownHandler: the builtin-static shortcircuit probe interp no # longer leaks (G-120). The probe child interp was created under the fixed # name ptest and deleted only on the non-error paths; an unversioned @@ -55,7 +66,7 @@ # doctools header # ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ #*** !doctools -#[manpage_begin punkshell_module_punk::libunknown 0 0.2.2] +#[manpage_begin punkshell_module_punk::libunknown 0 0.2.3] #[copyright "2025"] #[titledesc {Module API}] [comment {-- Name section and table of contents description --}] #[moddesc {-}] [comment {-- Description at end of page heading --}] @@ -142,8 +153,9 @@ tcl::namespace::eval ::punk::libunknown { } } - #Execute a pkgIndex.tcl script in this proc's frame (tcl_Pkg_source uplevels - #the actual 'source' into its caller). + #Execute a pkgIndex.tcl script in a local frame whose CURRENT NAMESPACE is :: + #(tcl_Pkg_source uplevels the actual 'source' into its caller - here, the apply + #body's frame). #The pkgIndex.tcl contract is that $dir holds the index file's directory, and #stock tclPkgUnknown additionally exposes the auto_path and env globals (some #indexes, e.g tcllib's, extend auto_path with an unqualified lappend). @@ -152,9 +164,18 @@ tcl::namespace::eval ::punk::libunknown { #via 'namespace eval ::', which clobbered any user global named 'dir' (via the #handler's since-removed 'global dir') and leaked each index's helper #variables (ver, pkg, script, ...) into the global namespace. + #The namespace matters as much as the frame: stock tclPkgUnknown is a proc in + #::, so an index's relative 'namespace eval foo' has always created ::foo. Run + #here in a proc of THIS namespace it would create ::punk::libunknown::foo, and + #an index that defines commands at source time for its own ifneeded scripts to + #call (twapi 4.7.2's twapi::set_scriptdir is one) would then fail at require + #time with 'invalid command name'. apply's namespace argument gives us the + #local frame AND the global resolution context. proc source_pkgindex {dir indexfile} { - global auto_path env - tcl_Pkg_source $indexfile + apply [list {dir indexfile} { + global auto_path env + ::punk::libunknown::tcl_Pkg_source $indexfile + } ::] $dir $indexfile } namespace eval argdoc { @@ -2157,7 +2178,7 @@ namespace eval ::punk::args::register { package provide punk::libunknown [tcl::namespace::eval ::punk::libunknown { variable pkg punk::libunknown variable version - set version 0.2.2 + set version 0.2.3 }] return diff --git a/src/vfs/_vfscommon.vfs/modules/argparsingtest-1.0.0.tm b/src/vfs/_vfscommon.vfs/modules/argparsingtest-1.2.0.tm similarity index 72% rename from src/vfs/_vfscommon.vfs/modules/argparsingtest-1.0.0.tm rename to src/vfs/_vfscommon.vfs/modules/argparsingtest-1.2.0.tm index c6e930fc..6e54f739 100644 --- a/src/vfs/_vfscommon.vfs/modules/argparsingtest-1.0.0.tm +++ b/src/vfs/_vfscommon.vfs/modules/argparsingtest-1.2.0.tm @@ -8,7 +8,7 @@ # (C) Julian Noble 2024 # # @@ Meta Begin -# Application argparsingtest 1.0.0 +# Application argparsingtest 1.2.0 # Meta platform tcl # Meta license MIT # @@ Meta End @@ -18,7 +18,7 @@ # doctools header # ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ #*** !doctools -#[manpage_begin punkshell_module_argparsingtest 0 1.0.0] +#[manpage_begin punkshell_module_argparsingtest 0 1.2.0] #[copyright "2024"] #[titledesc {Module API}] [comment {-- Name section and table of contents description --}] #[moddesc {-}] [comment {-- Description at end of page heading --}] @@ -123,16 +123,25 @@ namespace eval argparsingtest { # title - table section heading used by compare # argvec - default timing argument vector for the style # roster - parser proc name -> marker, where marker is one of: - # always - proc unconditionally defined in argparsingtest::