You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

11 KiB

G-098 suite_tcl90 full punkshell dependency set: Tk+tklib, tcllib with critcl accelerators, and testsuite gating

Status: active Scope: src/buildsuites/suite_tcl90/ (recipe extensions, driver steps, testsuite gate), src/buildsuites/_build/ (tk/tklib/tcllib/critcl sources and outputs), bin/tools/ (pinned zig as consumed), src/tests/ (punkshell suites exercised against the suite-built runtime) Goal: suite_tcl90 builds/installs the remaining runtime pieces punkshell testing depends on - Tk (fossil core.tcl-lang.org/tk) loadable by the suite's Tcl 9.0 windows runtime together with a matching tklib (fossil core.tcl-lang.org/tklib; pure-tcl, installed via its own installer.tcl where that does more than a straight copy), and tcllib (fossil core.tcl-lang.org/tcllib) installed via its documented mechanism (installer.tcl / sak.tcl checked for installation behaviour that is not just a straight copy) WITH its critcl-built C accelerators (tcllibc; critcl from github.com/andreas-kupries/critcl driving zig cc as the compiler, bootstrapped by the suite-built tclsh - no MS toolchain) - and the suite's test surface becomes a gate: suite.tcl test parses the all.tcl totals rather than trusting the exit code and fails on failures absent from a recorded expected-failure baseline. Acceptance: from the pinned zig and fetched sources the suite produces a Tk the suite tclsh loads (package require Tk with a create/destroy-window verification recorded in this file) and a matching tklib whose packages resolve from the install (a representative tklib package require recorded); a tcllib install performed via its own installer machinery (installer.tcl/sak.tcl behaviour checked and recorded - module selection, pkgIndex/tm generation, critcl module handling) whose accelerators load (package require tcllibc) with a punkcheck-relevant hashing comparison showing the accelerated path engaged versus pure-tcl; critcl is version-pinned and driven with zig cc; suite.tcl test gates on parsed totals against a recorded expected-failure baseline and the current 72 core-test failures are dispositioned (fixed or baselined with reasons); punkshell's runtests can run against the suite-built runtime with Tk-dependent suites no longer skipped for lack of Tk.

Context

Follow-on from G-096 (tracked zig buildsuite; zig 0.16.0 pin adopted 2026-07-20), per user direction 2026-07-20:

  • Tk must be built to run ALL punkshell tests (Tk-dependent suites currently skip).
  • A matching tklib may be required for Tk to function properly - believed pure-tcl, so a fossil pull plus possibly its installer.tcl "depending on whether it does anything special" (user wording).
  • tcllib is mostly pure-tcl but its critcl-built accelerators make a huge performance difference - without tcllibc, punkcheck hash checking is very slow. tcllib has an installer.tcl and sak.tcl which should be checked for installation behaviour that is not just a straight copy.
  • critcl (github.com/andreas-kupries/critcl) may be required for the accelerators; it needs a tclsh (the suite-built shell) and a C compiler (zig cc - keeps the no-MS-toolchain policy; the mechanism is zig-version-agnostic).
  • Testsuite state at goal creation: full Tcl core suite on the suite-built shell runs 66350 tests, 72 FAILED (triage pending; native-runtime baseline on this machine is exec-14.3 only), and all.tcl's exit code does not reflect failures - hence the totals-parsing gate requirement.

Notes

  • Related goals: G-096 (the buildsuite this extends; its remaining items - piperepl rebase/matrix and punk-getzig per-version fetch - stay with G-096), G-005 (zig build infrastructure direction), G-060 (qemu cross-platform matrix - eventual multi-platform consumer), G-021/G-020 (agent visual verification - a working Tk underpins those).
  • The 72-failure triage is tracked HERE (gate clause), not in G-096, to avoid double tracking.

Progress

2026-07-20 increment 1: activated; hermetic clone store; Tk builds and smokes

  • Activated by the user. Clone-store design (two user course-checks): fossil clone dbs are CACHES, not build output - they now live in the punkshell-owned machine-level store ~/.punkshell/fossils (user preference: ~/... on all platforms for cross-platform doc simplicity, a deliberate exception to windows convention), independent of the personal ~/.fossils AND outside deletable _build-class dirs (git clean -fdx safe). Missing clones seed READ-ONLY by file copy from -seedfossils (default ~/.fossils; the seed is never written - the copy is pulled current), else network-clone. Override: -repofolder / PUNK_FOSSIL_STORE, the latter registered in punk::config's known env vars ('help env' surfacing; punk::config pending-0.2.0 entry). -refresh now pulls store clones before updating checkouts; clean wipes the stage only. Verified: full seed->open->build->smoke PASS from an empty store (6 clones seeded, ~1.2GB), then store migrated to ~/.punkshell/fossils and re-verified (checkouts re-opened from the new store, PASS, zero re-seeds).
  • Sources wired: tk (core-9-0-branch -> stage/tk9; clone was stale at 2023/8.7a6 and pulled current - TK 9.0.2), tklib (trunk, current), tcllib (trunk, current).
  • Tk recipe (build_tk/build_tk.zig, 0.16 API): tcl9tk90.dll from stock sources - object inventory from tk/win/makefile.vc TKOBJS+TTK_OBJS (generic/unix-shared/win/ ttk splits corrected against the tree; xlib emulation sources x{colors,draw,gc, image,util}.c were absent from the name-pattern extraction and restored; tkStubLib/ttkStubLib excluded as stub-archive objects), tkMain compiled ansi+UNICODE with the forced -U ansi guard (G-096 finding), CFG_* pkgconfig defines generated at build time, rc from win/rc/tk.rc with explicit include_paths (wish.exe.manifest and tcl headers), system libs incl oleaut32 (tkWinSend OLE). tk script library installs to out/lib/tk9.0; the driver generates tkUuid.h + wish.exe.manifest (TK_WIN_VERSION 9.0.2.902 by the tree's own formula) and writes the pkgIndex.tcl (tk + Tk ifneeded -> ../../bin/tcl9tk90.dll, makefile.vc install convention).
  • SMOKE PASS on the suite shell: package require Tk -> 9.0.2; winfo screen 3840x2160 depth 32; label pack + update + destroy clean (real window station exercised, not just a load).

2026-07-20 increment 2: tklib installed via its own installer; tooltip smoke

  • Installer behaviour checked (per the user's caveat) before use: NOT a straight copy
    • module exclusion list (unless +excluded), app-script generation, optional nroff/html doc install, and generation of the aggregating top-level pkgIndex.tcl (gen_main_index sources each module's index - required for package resolution since module indexes sit two levels below auto_path). critcl DSL procs are stubbed to no-ops (pure-tcl confirmed). Batch surface: -no-gui -no-wait with -pkgs/-apps/-html/-nroff/-examples toggles and *-path overrides; default paths derive from the RUNNING tclsh.
  • Driver step: run installer.tcl with the SUITE-BUILT shell, batch, packages only (-no-gui -no-wait -pkgs -no-apps -no-html -no-nroff -no-examples) - defaults land it at out/lib/tklib0.9 with the generated main pkgIndex. Idempotent (skipped when a tklib* install exists).
  • SMOKE PASS: in the suite shell, package require Tk + package require tooltip -> tooltip 2.0.4 (a Tk-dependent tklib package resolving through the aggregate index).

2026-07-20 increment 3: tcllib installed; tcllibc built via critcl 3.3.1 + zig cc; 248x hashing evidence

  • tcllib pure-tcl side installs via its own installer (same family as tklib: critcl DSL stubbed, exclusions, aggregating pkgIndex; batch packages-only, suite shell). INCIDENT: the installer's default libdir derives from the running shell's tcl_pkgPath, which included the user's machine-global C:/TCLPKGS via inherited TCLLIBPATH - the first run installed tcllib2.0 THERE. Verified pure additive (all content fresh-dated, no pre-existing tcllib at that path) and removed. Fixes: the driver now UNSETS TCLLIBPATH/TCL_LIBRARY/TK_LIBRARY for all child shells (hermetic; also removes false-positive smoke risk via machine packages), and both tklib/tcllib installs pass explicit -pkg-path (version parsed from each project's support/installation/version.tcl). Smoke: md5 2.0.9, sha1 2.0.5, cmdline 1.5.3 from out/lib/tcllib2.0.
  • install-libraries recipe fix surfaced by critcl's package interception: tcl's installed library/pkgIndex.tcl references subdir packages (msgcat/ opt/ cookiejar/ ...) the piecemeal top-level install never provided - phantom ifneeded entries. The recipe now installs the whole library tree to lib/tcl9.0 (stock-install parity) alongside the tm installs.
  • tcllibc: critcl git-cloned and pinned at tag 3.3.1 under _build (hermetic git-mirror treatment analogous to the fossil store = noted refinement); tracked critcl_zig.config overrides critcl's gcc defaults with zig cc -target x86_64-windows-gnu compile/link (driver prepends the pinned zig dir to PATH). sak.tcl's windows path wants a tclkitsh+starkit combo, so the driver replicates its underlying invocation directly: critcl main.tcl -config ... -cache ... -force -libdir out/lib -pkg tcllibc + the 21 critcl files parsed from tcllib's own support/installation/version.tcl declarations (critcl_main first; brace-grouped lists handled). RESULT: tcllibc.dll built and placed at out/lib/tcllibc (provide tcllibc 2.0).
  • Evidence: package require tcllibc -> 2.0; tcllib md5 auto-engages the critcl accelerator (accel(critcl)=1). Hashing comparison (punkcheck-relevant): sha1 -hex over ~5MB in the suite shell - critcl 12.3ms vs pure-tcl 3.06s (pure measured with tcllibc moved OUTSIDE lib/ - child pkgIndex scanning ignores dir names, so an in-place rename does not hide a package) = ~248x speedup, confirming the user-reported punkcheck hashing pain and its fix.

Remaining for acceptance:

  • suite.tcl test gate: parse all.tcl totals vs a recorded expected-failure baseline; disposition the 72 current failures.
  • punkshell runtests against the suite-built runtime with Tk suites unskipped.
  • (superseded note kept for history below: the clone store subsequently moved from the suite-owned _build location to the machine-level ~/.punkshell/fossils - see increment 1 and the suite README for current truth)
  • Fetch conventions follow suite_tcl90, with the hermetic clone store adopted at this goal's activation (user decision 2026-07-20): clones live in the suite-owned _build/suite_tcl90/fossils store (seeded READ-ONLY from ~/.fossils when present, else network-cloned; -repofolder/PUNK_FOSSIL_STORE override; clean keeps the store, clean -all removes it), checkouts under _build with FOSSIL_HOME isolation and --nested. critcl is git, not fossil - clone/pin convention to be settled in the work (git clone under _build with a pinned tag/commit is the expected shape).