From 917916c5be039b01d25555f8a0a2d0af05d07e81 Mon Sep 17 00:00:00 2001 From: Julian Noble Date: Sun, 26 Jul 2026 02:48:42 +1000 Subject: [PATCH] G-122 drafted (user-approved): make.tcl host/target platform split Index entry + detail file per the approved wording: bake/bakelist keyed by an explicit target platform (store folder, exe suffixing, kit naming, presence, process-sweep tooling) with host personality only selecting defaults; stable punk::platform canon tags for cygwin-family hosts (MSYSTEM variance documented); per-entry mapping target as a minimal extension ceding schema to G-024; zipfs-less zip-type assembly via split + punk::zip::mkzip + cat (archive-start-relative offsets - user's correction); third-party tier REPRESENTATION in scope, publication/fetch flagged as a follow-on candidate; FreeBSD linuxulator expectation recorded with verification deferred to the planned linux-kit trial. Overlap survey run; Related notes name G-024, G-105, G-114, G-101, G-057, G-023. G-013's msys raw-mode note now cites G-122 by id. Claude-Session: https://claude.ai/code/session_01Jz7wkUsknJzyuJ3tgMaL2t Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com --- GOALS.md | 4 + goals/G-013-raw-mode-default.md | 2 +- goals/G-122-host-target-platform-split.md | 105 ++++++++++++++++++++++ 3 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 goals/G-122-host-target-platform-split.md diff --git a/GOALS.md b/GOALS.md index 5521a4df..de376545 100644 --- a/GOALS.md +++ b/GOALS.md @@ -393,3 +393,7 @@ Detail: goals/G-115-declarative-vfs-composition.md Scope: src/buildsuites/suite_tcl90/ (build_tcltls module + crypto-backend build, sources.config + build.zig.zon source records, kit-family bi payload + metadata extension, test_gate record step); src/vfs kit payloads carrying vendored tcltls binaries (current-state reference + recorded disposition only - removal stays G-004-era work); punkbin (as eventual artifact destination via the G-067 library class); consumers punk::imap4 / punk::netbox (package require tls) as verification context Detail: goals/G-116-suite-built-tcltls.md +### G-122 [proposed] make.tcl host/target platform split: bake by target, not host personality +Scope: src/make.tcl (target-platform derivation; store folder, exe suffixing, kit naming, presence checks and process-sweep tooling keyed by target; platform-canon inline copy; zipfs-less zip-type assembly fallback); src/modules/punk/platform-999999.0a1.0.tm (stable canon tags for cygwin-family hosts, help platforms doc); src/runtime/mapvfs.config (per-entry target platform via minimal compatible extension - format ownership coordinated with G-024); bin/runtime// store tiers (as consumed; fixture tier for tests); src/tests/shell/testsuites/punkexe/ (characterization) +Detail: goals/G-122-host-target-platform-split.md + diff --git a/goals/G-013-raw-mode-default.md b/goals/G-013-raw-mode-default.md index adde377c..1b7b598a 100644 --- a/goals/G-013-raw-mode-default.md +++ b/goals/G-013-raw-mode-default.md @@ -84,4 +84,4 @@ stays (see inventory item 4). the suite runtimes and kit shape; first enable of a session costs ~0.6-0.7s server spawn - an eager warm-up at repl init is noted there as a future nicety if raw becomes the default). See goals/archive/G-106-powershell-consolemode-fallback.md. -- 2026-07-26 field finding (msys/cygwin-runtime tclsh: scoop msys2 tclsh8.6 driving 'src/make.tcl shell' on windows): line mode is largely functional, but RAW mode places the cursor at row 1 after each command - the raw-mode cursor bookkeeping (cursor-position query/screen-state handling) does not yet cater for the msys pty terminal class. Recorded as a raw-mode-default blocker dimension alongside the existing cursor-move issues; the make.tcl host/target platform-split candidate goal drafted the same day is build-tooling only and deliberately excludes this console/repl work. +- 2026-07-26 field finding (msys/cygwin-runtime tclsh: scoop msys2 tclsh8.6 driving 'src/make.tcl shell' on windows): line mode is largely functional, but RAW mode places the cursor at row 1 after each command - the raw-mode cursor bookkeeping (cursor-position query/screen-state handling) does not yet cater for the msys pty terminal class. Recorded as a raw-mode-default blocker dimension alongside the existing cursor-move issues; the make.tcl host/target platform-split goal (G-122, proposed the same day) is build-tooling only and deliberately excludes this console/repl work. diff --git a/goals/G-122-host-target-platform-split.md b/goals/G-122-host-target-platform-split.md new file mode 100644 index 00000000..6f782e89 --- /dev/null +++ b/goals/G-122-host-target-platform-split.md @@ -0,0 +1,105 @@ +# G-122 make.tcl host/target platform split: bake by target, not host personality + +Status: proposed +Scope: src/make.tcl (target-platform derivation; store folder, exe suffixing, kit naming, presence checks and process-sweep tooling keyed by target; platform-canon inline copy; zipfs-less zip-type assembly fallback); src/modules/punk/platform-999999.0a1.0.tm (stable canon tags for cygwin-family hosts, help platforms doc); src/runtime/mapvfs.config (per-entry target platform via minimal compatible extension - format ownership coordinated with G-024); bin/runtime// store tiers (as consumed; fixture tier for tests); src/tests/shell/testsuites/punkexe/ (characterization) +Goal: make.tcl's kit surfaces (bake/bakelist/bin) operate on an explicit target platform rather than the driving tclsh's personality: any capable host (native windows tclsh, msys/cygwin-runtime tclsh, a FreeBSD host running linux binaries) addresses the same per-target runtime store, artifact naming and process handling for the kits it reports/bakes; non-native-personality runtime tiers (e.g third-party mingw64 builds served from punkbin or an alternative artifact server) are representable as first-class mapping entries with their own store tier; and zip-type kit assembly no longer requires zipfs in the driving tcl. +Acceptance: an msys/cygwin-runtime tclsh driving bakelist/bake on windows reports - and for a changed kit, bakes and deploys - the same win32-x86_64 kit set with identical names and store addressing as a native tclsh, with the pre-deploy process sweep using windows tooling for win32 targets regardless of host personality; punk::platform and the make.tcl inline canon map MSYS_NT/MINGW64_NT/CYGWIN_NT/UCRT64-class hosts to stable documented tags (MSYSTEM-variance documented, no windows build number in the tag) and 'help platforms' lists them; a mapvfs entry declaring a non-default target platform lists in bakelist with its own tier's store presence and bakes to a correctly suffixed artifact, verified against a fixture store tier (a real third-party runtime is not required); a zipfs-less driving tcl (8.6) assembles a zip-type kit via runtime split + punk::zip::mkzip + concatenation (archive-start-relative offsets) and the artifact boots on a zipfs-capable runtime; the linuxulator expectation (a linux-personality tclsh on FreeBSD 14/15 addresses the linux-x86_64 store unchanged) is recorded here with verification deferred to the planned linux-kit-on-FreeBSD trial; native-windows behaviour stays characterization-stable (existing punkexe maketcl tests pass unchanged). + +## Context + +Field session 2026-07-26: the scoop msys2 tclsh8.6 driving `src/make.tcl +bakelist` on windows showed every configured kit as runtime=missing (and +deployed absent) from two compounding causes: the store folder derives from the +HOST's platform canon (observed `mingw64-x86_64` under a MINGW64_NT os string - +note the tag follows the MSYSTEM environment, so the same binary can canonize +as msys/ucrt64/mingw64 in different shells), and the platform=unix branch +probes suffixless filenames - an assumption that is false for the entire +cygwin family, whose executables are `.exe` files (the msys tclsh itself is +`tclsh8.6.exe`). The interim self-diagnosis shipped in punkshell 0.24.1 +(bakelist store-folder WARNING with the canon derivation + `(FOLDER MISSING)` +header mark; bake's no-runtimes exit note) tells the user what happened; this +goal makes the tooling actually cater for it. + +The underlying defect is a conflation: make.tcl's scattered +`$::tcl_platform(platform) eq "windows"` tests mix three separable concerns - +host process semantics (cp vs `cmd /c copy`, `ps`/`kill` vs +tasklist/taskkill, path personality), target artifact naming (`.exe` +suffixing, kit/output names), and store addressing (`bin/runtime/`). +An msys host pulls them apart. The process sweep is the sharpest edge: msys +`ps` sees only msys-descendant processes, so a natively-launched kit exe is +invisible to the pre-deploy sweep (taskkill remains exec-able from msys). + +Direction (user, 2026-07-26): even if msys never becomes a zig buildsuite +target, third-party-built runtime tiers (e.g an msys2-packaged tclsh) served +from punkbin or an alternative artifact server must be supportable as kit +runtimes - REPRESENTATION (mapping entry + store tier) belongs here; +publication/fetch is the flagged follow-on goal. + +FreeBSD linuxulator parallel (user): a linux-personality tclsh running on +FreeBSD via the linux compat layer is expected to self-identify as linux and +address `bin/runtime/linux-x86_64` correctly - the planned +linux-kit-on-FreeBSD-14/15 trial doubles as verification that target-keyed +stores follow runtime personality, not host OS identity. + +Zip offsets (user correction, 2026-07-26): tcl zipfs kits mount with +archive-start-relative offsets - cat-style construction (split the original +runtime first, then append a freshly written zip) is valid; `zipfs mkimg`'s +file-relative offset adjustment is one convention, not a mounting +requirement. The existing zipcat kit type is the in-repo proof, and its +machinery already has zipfs-less fallbacks. + +## Approach + +- One `target_platform` derivation: default from the host canon, with + cygwin-family hosts on windows defaulting to target `win32-x86_64`; + per-entry mapping override for non-default tiers (a minimal compatible + extension of the current vfsconfig entry - e.g a fourth element - whose + schema home is G-024's toml conversion; the parsed-model seam (G-121, + achieved - see goals/archive/G-121-bakelist-selective-bake.md) keeps every + consumer format-agnostic while the format moves). +- Key store folder, suffixing, kit/artifact naming, presence checks and the + process-sweep tool selection by TARGET; keep copy commands, path handling + and prompt behaviour host-driven. +- punk::platform canon: explicit MSYS_NT/MINGW64_NT/CYGWIN_NT/UCRT64 mapping + to stable documented tags with the MSYSTEM-variance caveat; the make.tcl + inline canon copy stays in sync per its existing comment contract. +- zip-type fallback for zipfs-less driving tcls: reuse the zipcat machinery + (extract_preamble split + punk::zip::mkzip + concatenation). +- Characterization against a fixture store tier so no real third-party + runtime is required; the msys-hosted acceptance run uses the dev machine's + msys tclsh where present (else recorded env-gated, per punkexe suite + conventions). + +## Alternatives considered + +- Per-site host patches (special-case each windows test) - rejected: the + three-concern conflation just re-accumulates with each new host class. +- Full self-hosted msys platform lineage (msys-personality kits, accelerator + builds, own test baselines) - out of scope: the third-party tier direction + covers the need without a new first-party build lineage. +- Status quo (require a native tclsh to drive make.tcl) - rejected: field + friction (the all-missing bakelist), and upcoming linux/FreeBSD hosts make + host-personality assumptions untenable regardless of msys. + +## Notes + +- Related: G-024 - owns the mapping format; the per-entry target platform is + drafted as a minimal compatible extension and its schema home is that + goal's toml conversion (make.tcl's own comments already pair the platform + column with the toml change). +- Related: G-105 - cross-target zig builds populate first-party non-native + store tiers; this goal is the consuming/addressing side. +- Related: G-114 - same punk::platform canon vocabulary, applied to + per-platform tm module roots. +- Related: G-101 - 8.6 kit containers ride the same mapping/store surfaces; + lister/bake stay kit-type-agnostic (per the archived G-121 decision). +- Related: G-057 - per-entry mapping extension precedent (per-vfs icon + override rides the same entry shape). +- Related: G-023 - kit naming schemes; target-keyed naming must not collide + with its version-named binaries direction. +- Follow-on candidate (flagged, drafted separately for approval): third-party + runtime tier publication/fetch via punkbin or alternative servers + (punk-runtime payloads, server platform manifests, consent gating per + G-006, artifact-channel kinship with G-067). +- Out of scope: msys pty raw-mode console/repl behaviour - the cursor-row-1 + field finding of 2026-07-26 is recorded in G-013's Notes.