Browse Source

build outputs: thin-layout make.tcl copies synced (bake/bakehouse era)

The bakehouse acceptance run's thin-layout sync refreshed the three layout
make.tcl copies (basic, project-0.1, templates modpod payload) with the
G-112/G-113/G-104 make.tcl - punkcheck-managed, batched per the build-output
commit carve-out.

Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com
master
Julian Noble 1 week ago
parent
commit
a04979eb38
  1. 443
      src/modules/punk/mix/#modpod-templates-999999.0a1.0/templates/project_layouts/vendor/punk/project-0.1/src/make.tcl
  2. 443
      src/project_layouts/vendor/punk/basic/src/make.tcl
  3. 443
      src/project_layouts/vendor/punk/project-0.1/src/make.tcl

443
src/modules/punk/mix/#modpod-templates-999999.0a1.0/templates/project_layouts/vendor/punk/project-0.1/src/make.tcl vendored

@ -153,7 +153,7 @@ namespace eval ::punkboot {
variable foldername [file tail $scriptfolder] variable foldername [file tail $scriptfolder]
variable pkg_requirements [list]; variable pkg_missing [list];variable pkg_loaded [list] variable pkg_requirements [list]; variable pkg_missing [list];variable pkg_loaded [list]
variable help_flags [list -help --help /? -h] variable help_flags [list -help --help /? -h]
variable known_commands [list project modules libs packages vfs vfslibs bin info check shell vendorupdate bootsupport vfscommonupdate projectversion workflow] variable known_commands [list bakehouse packages modules libs bake vfslibs bin info check shell vendorupdate bootsupport vfscommonupdate projectversion workflow buildsuite project vfs]
} }
@ -1519,10 +1519,14 @@ proc ::punkboot::punkboot_gethelp {args} {
append h "" \n append h "" \n
append h " $scriptname -help or $scriptname --help or $scriptname /? or just $scriptname" \n append h " $scriptname -help or $scriptname --help or $scriptname /? or just $scriptname" \n
append h " - This help." \n \n append h " - This help." \n \n
append h " $scriptname project ?-k?" \n append h " $scriptname bakehouse ?-k? ?-dirty-abort 1|0?" \n
append h " - this is the literal word project - and confirms you want to run the project build - which includes src/vfs/* checks and builds" \n append h " - consumer build from a clean checkout: runs the packages stage (modules + libs) then bakes kit/zipkit executables to <projectdir>/bin" \n
append h " - refuses uncommitted src by default (-dirty-abort defaults ON: the bakehouse bakes from the committed recipe; pass -dirty-abort 0 to override)" \n
append h " - the optional -k flag will terminate running processes matching the executable being built (if applicable)" \n append h " - the optional -k flag will terminate running processes matching the executable being built (if applicable)" \n
append h " - builds/copies .tm modules from src to <projectdir>/modules etc and pkgIndex.tcl based libraries from src to <projectdir>/lib etc." \n \n append h " - does NOT run the promotion gates (bootsupport, vfscommonupdate) - on a clean checkout they are already satisfied by the committed tree" \n \n
append h " $scriptname bake ?-k?" \n
append h " - assemble kit/zipkit executables from the promoted payload (src/vfs) and src/runtime runtimes into <projectdir>/bin" \n
append h " - includes the vfslibs phase; does not rebuild modules/libs and does not run the promotion gates" \n \n
append h " $scriptname modules" \n append h " $scriptname modules" \n
append h " - build (or copy if build not required) .tm modules from src/modules src/vendormodules etc to their corresponding locations under <projectdir>" \n append h " - build (or copy if build not required) .tm modules from src/modules src/vendormodules etc to their corresponding locations under <projectdir>" \n
append h " This does not scan src/runtime and src/vfs folders to build kit/zipkit/cookfs executables" \n \n append h " This does not scan src/runtime and src/vfs folders to build kit/zipkit/cookfs executables" \n \n
@ -1544,10 +1548,10 @@ proc ::punkboot::punkboot_gethelp {args} {
append h " $scriptname vfslibs" \n append h " $scriptname vfslibs" \n
append h " - propagate declared vendored platform-library packages into kit vfs lib_tcl<N> trees" \n append h " - propagate declared vendored platform-library packages into kit vfs lib_tcl<N> trees" \n
append h " - declarations (per-package per-kit, with superseded-version removal) live in src/runtime/vendorlib_vfs.toml" \n append h " - declarations (per-package per-kit, with superseded-version removal) live in src/runtime/vendorlib_vfs.toml" \n
append h " - also runs automatically as part of '$scriptname project'" \n \n append h " - also runs automatically as a phase of '$scriptname bake' (and therefore of '$scriptname bakehouse')" \n \n
append h " $scriptname vfscommonupdate" \n append h " $scriptname vfscommonupdate" \n
append h " - update the src/vfs/_vfscommon.vfs from compiled src/modules and src/lib etc" \n append h " - promotion gate: update the src/vfs/_vfscommon.vfs from compiled src/modules and src/lib etc" \n
append h " - before calling this (followed by make project) - you can test using '<builtexe>(.exe) dev'" \n append h " - before calling this (followed by '$scriptname bake') - you can test using '<builtexe>(.exe) dev'" \n
append h " this will load modules from your <projectdir>/module <projectdir>/lib paths instead of from the kit/zipkit" \n \n append h " this will load modules from your <projectdir>/module <projectdir>/lib paths instead of from the kit/zipkit" \n \n
append h " $scriptname info" \n append h " $scriptname info" \n
append h " - show the name and base folder of the project to be built" \n \n append h " - show the name and base folder of the project to be built" \n \n
@ -1559,16 +1563,23 @@ proc ::punkboot::punkboot_gethelp {args} {
append h " - advisory check: verify CHANGELOG.md matches punkproject.toml and warn if src/ has changes since the last project-version bump." \n \n append h " - advisory check: verify CHANGELOG.md matches punkproject.toml and warn if src/ has changes since the last project-version bump." \n \n
append h " $scriptname workflow" \n append h " $scriptname workflow" \n
append h " - print an ASCII data-flow overview of the build/release workflow (edit -> packages -> bootsupport -> kits)" \n \n append h " - print an ASCII data-flow overview of the build/release workflow (edit -> packages -> bootsupport -> kits)" \n \n
append h " $scriptname buildsuite list|info|build ?<suitename>? ?driver-args ...?" \n
append h " - list the defined buildsuites under src/buildsuites (zig runtime factory), show a suite's configured" \n
append h " detail (sources/zig pin/products from its sources.config), or run its driver forwarding the args" \n \n
append h " $scriptname help ?subcommand?" \n append h " $scriptname help ?subcommand?" \n
append h " - show usage for $scriptname or one of its subcommands (equivalent: $scriptname <subcommand> -help)" \n \n append h " - show usage for $scriptname or one of its subcommands (equivalent: $scriptname <subcommand> -help)" \n \n
append h " Deprecated aliases (transition window):" \n
append h " $scriptname project -> runs bakehouse (with a one-line notice)" \n
append h " $scriptname vfs -> runs bake (with a one-line notice)" \n \n
append h " Flags:" \n append h " Flags:" \n
append h " -confirm 0|1" \n append h " -confirm 0|1" \n
append h " - interactive y/n confirmation policy (default 1: prompt when stdin is a terminal, abort fast when it is not)." \n append h " - interactive y/n confirmation policy (default 1: prompt when stdin is a terminal, abort fast when it is not)." \n
append h " Use -confirm 0 for unattended runs: the bootsupport minor-staleness gate and the vfscommonupdate REPLACE" \n append h " Use -confirm 0 for unattended runs: the bootsupport minor-staleness gate and the vfscommonupdate REPLACE" \n
append h " confirmation proceed without prompting; kits with a source/target kit-type mismatch are skipped." \n append h " confirmation proceed without prompting; kits with a source/target kit-type mismatch are skipped." \n
append h " -dirty-abort" \n append h " -dirty-abort" \n
append h " - abort build/promotion commands (project packages modules libs vfs vfslibs bin bootsupport vfscommonupdate) when src/ has" \n append h " - abort build/promotion commands (bakehouse packages modules libs bake vfslibs bin bootsupport vfscommonupdate) when src/ has" \n
append h " uncommitted VCS changes. Default is warn-only: artifacts built from dirty src have no committed provenance." \n append h " uncommitted VCS changes. Default is warn-only EXCEPT bakehouse (defaults ON there; -dirty-abort 0 overrides):" \n
append h " artifacts built from dirty src have no committed provenance." \n
append h " Warnings carry a plain PROVENANCE-WARNING: prefix (greppable in redirected output) and are recapped at the end of the run." \n append h " Warnings carry a plain PROVENANCE-WARNING: prefix (greppable in redirected output) and are recapped at the end of the run." \n
append h " Use '$scriptname check' to see the current provenance status. To evaluate uncommitted source without building," \n append h " Use '$scriptname check' to see the current provenance status. To evaluate uncommitted source without building," \n
append h " use '<builtexe> src' or '<builtexe> src shell'." \n \n append h " use '<builtexe> src' or '<builtexe> src shell'." \n \n
@ -1592,7 +1603,20 @@ All commands run from the projectroot with a native tclsh, e.g:
tclsh src/make.tcl <subcommand> -confirm 0 (see [K6]) tclsh src/make.tcl <subcommand> -confirm 0 (see [K6])
RELEASE SEQUENCE (the order that satisfies the staleness + provenance gates) TWO PERSONAS (stage-true subcommand model - one build stage, two promotion
gates, one bake)
----------------------------------------------------------------------------
CONSUMER (clean checkout, wants baked kits):
tclsh src/make.tcl bakehouse -confirm 0
= packages + bake in one uninterrupted run. The promotion gates are already
satisfied by the committed tree. bakehouse REFUSES uncommitted src by
default (-dirty-abort defaults ON: the bakehouse bakes from the committed
recipe; -dirty-abort 0 overrides).
DEVELOPER (changing payload): pass the gates explicitly - the commit is the
publishing act, not a build step. That is the RELEASE SEQUENCE below.
Deprecated aliases (transition window): 'project' -> bakehouse, 'vfs' -> bake.
RELEASE SEQUENCE (the developer order that satisfies the staleness + provenance gates)
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
(1) edit src/modules/foo-999999.0a1.0.tm code change [K1] (1) edit src/modules/foo-999999.0a1.0.tm code change [K1]
@ -1603,7 +1627,7 @@ RELEASE SEQUENCE (the order that satisfies the staleness + provenance gates)
(5) build tclsh src/make.tcl modules -confirm 0 (or 'packages' = modules + libs) (5) build tclsh src/make.tcl modules -confirm 0 (or 'packages' = modules + libs)
(6) build tclsh src/make.tcl bootsupport -confirm 0 run twice: 2nd pass must copy 0 files [K4] (6) build tclsh src/make.tcl bootsupport -confirm 0 run twice: 2nd pass must copy 0 files [K4]
(7) build tclsh src/make.tcl vfscommonupdate -confirm 0 (7) build tclsh src/make.tcl vfscommonupdate -confirm 0
(8) build tclsh src/make.tcl project -confirm 0 kits; close running kit shells first [K5] (8) build tclsh src/make.tcl bake -confirm 0 kits; close running kit shells first [K5]
(9) commit tracked build outputs src/bootsupport, thin-layout script/ (9) commit tracked build outputs src/bootsupport, thin-layout script/
manifest copies (src/project_layouts + manifest copies (src/project_layouts +
templates modpod payload), templates modpod payload),
@ -1634,13 +1658,13 @@ DIAGRAM 1 - DATA FLOW: SOURCE -> BUILT PACKAGES -> PROPAGATION TARGETS
(the module set make.tcl itself src/vfs/_vfscommon.vfs/modules/ + libs (the module set make.tcl itself src/vfs/_vfscommon.vfs/modules/ + libs
boots from; staleness-gated. (VCS-tracked kit payload source) boots from; staleness-gated. (VCS-tracked kit payload source)
Project layouts store NO module | Project layouts store NO module |
snapshots - 'dev project.new' | make.tcl project (or: make.tcl vfs) snapshots - 'dev project.new' | make.tcl bake (kit-assembly stage;
injects bootsupport into generated v injects bootsupport into generated v consumer umbrella: bakehouse)
projects from the generating src/_build/<kit>.exe --deploy--> bin/<kit>.exe projects from the generating src/_build/<kit>.exe --deploy--> bin/<kit>.exe
shell at generation time - G-087) (see DIAGRAM 2) [K5] shell at generation time - G-087) (see DIAGRAM 2) [K5]
DIAGRAM 1b - THIN-LAYOUT SYNC (part of modules/libs/packages/project runs) DIAGRAM 1b - THIN-LAYOUT SYNC (part of modules/libs/packages/bakehouse runs)
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
src/make.tcl src/build.tcl src/bootsupport/modules*/include_modules.config src/make.tcl src/build.tcl src/bootsupport/modules*/include_modules.config
@ -1656,7 +1680,7 @@ DIAGRAM 1b - THIN-LAYOUT SYNC (part of modules/libs/packages/project runs)
kit outside any project can list and generate the punk.project layout) kit outside any project can list and generate the punk.project layout)
DIAGRAM 2 - KIT ASSEMBLY DETAIL (inside 'make.tcl project' / 'make.tcl vfs') DIAGRAM 2 - KIT ASSEMBLY DETAIL (the 'make.tcl bake' stage; incl. vfslibs phase)
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
src/runtime/mapvfs.config which vfs folder pairs with which runtime -> kit name src/runtime/mapvfs.config which vfs folder pairs with which runtime -> kit name
@ -1707,7 +1731,7 @@ KEY / NOTES
a pass copies 0 files (a converged second pass also proves prune tooling ran). a pass copies 0 files (a converged second pass also proves prune tooling ran).
[K5] The deploy step cannot replace a kit exe that is currently executing. Close [K5] The deploy step cannot replace a kit exe that is currently executing. Close
running kit shells before step 8, or rerun 'make.tcl vfs -confirm 0' running kit shells before step 8, or rerun 'make.tcl bake -confirm 0'
afterwards - the freshly built kits wait in src/_build. punkcheck records afterwards - the freshly built kits wait in src/_build. punkcheck records
mean the rerun only redoes the failed deploys. mean the rerun only redoes the failed deploys.
@ -1719,7 +1743,7 @@ KEY / NOTES
- src/tests/runtests.tcl exercises the src/ trees directly (dev modules). - src/tests/runtests.tcl exercises the src/ trees directly (dev modules).
- '<builtkit>.exe dev' (or '<builtkit> src') runs a built shell against the - '<builtkit>.exe dev' (or '<builtkit> src') runs a built shell against the
project dev modules - useful for testing built packages before they are project dev modules - useful for testing built packages before they are
baked into kits via vfscommonupdate + project. baked into kits via vfscommonupdate + bake.
[K8] What is VCS-tracked where (checkin targets after a build): [K8] What is VCS-tracked where (checkin targets after a build):
tracked: src/** (sources, src/bootsupport, src/project_layouts copies, tracked: src/** (sources, src/bootsupport, src/project_layouts copies,
@ -1821,22 +1845,25 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
#single source for the subcommand one-line summaries: each subcommand definition's #single source for the subcommand one-line summaries: each subcommand definition's
#@cmd -summary and the top-level subcommand -choicelabels are both built from this. #@cmd -summary and the top-level subcommand -choicelabels are both built from this.
variable SUMMARIES { variable SUMMARIES {
project "Full project build - packages plus kit/zipkit executables from src/vfs and src/runtime" bakehouse "Consumer build from a clean checkout: packages then bake - refuses uncommitted src by default"
packages "Build .tm modules and pkgIndex.tcl libraries from src into <projectdir> (no kit executables)" packages "Build .tm modules and pkgIndex.tcl libraries from src into <projectdir> (no kit executables)"
modules "Build .tm modules from src/modules, src/vendormodules etc into <projectdir>/modules etc" modules "Build .tm modules from src/modules, src/vendormodules etc into <projectdir>/modules etc"
libs "Build pkgIndex.tcl libraries from src/lib, src/vendorlib etc into <projectdir>/lib etc" libs "Build pkgIndex.tcl libraries from src/lib, src/vendorlib etc into <projectdir>/lib etc"
vfs "Build kit/zipkit executables from src/vfs and src/runtime into <projectdir>/bin" bake "Assemble kit/zipkit executables from promoted payload (src/vfs) and runtimes into <projectdir>/bin"
vfslibs "Propagate declared vendored platform-library packages into kit vfs lib_tcl<N> trees" vfslibs "Propagate declared vendored platform-library packages into kit vfs lib_tcl<N> trees"
bin "Install executables from src/bin into <projectdir>/bin, then build kits as for vfs" bin "Install executables from src/bin into <projectdir>/bin, then build kits as for bake"
vendorupdate "Update src/vendormodules based on src/vendormodules/include_modules.config" vendorupdate "Update src/vendormodules based on src/vendormodules/include_modules.config"
bootsupport "Update src/bootsupport modules from built project modules" bootsupport "Promotion gate: update src/bootsupport modules from built project modules"
vfscommonupdate "Replace src/vfs/_vfscommon.vfs modules and libs with the project's built modules and libs" vfscommonupdate "Promotion gate: replace src/vfs/_vfscommon.vfs modules and libs with the project's built set"
info "Show the name and base folder of the project to be built" info "Show the name and base folder of the project to be built"
check "Show module/library paths and any potentially problematic packages for running this script" check "Show module/library paths and any potentially problematic packages for running this script"
projectversion "Advisory check: CHANGELOG.md vs punkproject.toml and src/ changes since last version bump" projectversion "Advisory check: CHANGELOG.md vs punkproject.toml and src/ changes since last version bump"
workflow "Print an ASCII data-flow overview of the build/release workflow (edit -> packages -> bootsupport -> kits)" workflow "Print an ASCII data-flow overview of the build/release workflow (edit -> packages -> gates -> bake)"
shell "Run the punk shell using bootsupport libraries" shell "Run the punk shell using bootsupport libraries"
help "Show usage for make.tcl or one of its subcommands" help "Show usage for make.tcl or one of its subcommands"
buildsuite "List, describe or run the defined buildsuites under src/buildsuites (zig runtime factory)"
project "DEPRECATED alias for bakehouse (one-line notice, then runs bakehouse)"
vfs "DEPRECATED alias for bake (one-line notice, then runs bake)"
} }
#@cmd -help bodies for the constructed definitions below. Authored BLOCK-FORM #@cmd -help bodies for the constructed definitions below. Authored BLOCK-FORM
#(first value line whitespace-only) so the @normalize directive in each #(first value line whitespace-only) so the @normalize directive in each
@ -1845,14 +1872,20 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
#normalization (head-form values here would leak this file's indentation into #normalization (head-form values here would leak this file's indentation into
#the rendered Description column). #the rendered Description column).
variable HELPTEXTS { variable HELPTEXTS {
project bakehouse
" "
Run the full project build - includes src/vfs/* checks and builds. Consumer umbrella: run the packages stage (modules + libs) then bake
Builds/copies .tm modules and pkgIndex.tcl based libraries from src to the kit/zipkit executables - the full path from a CLEAN checkout to
<projectdir>/modules, <projectdir>/lib etc, propagates declared vendored installed kits in <projectdir>/bin.
platform-libraries into kit vfs trees (as for vfslibs), then scans The bakehouse bakes from the committed recipe: by default it refuses
src/runtime and src/vfs folders to build kit/zipkit executables and to run when src/ has uncommitted changes (-dirty-abort defaults ON),
installs them to <projectdir>/bin." pointing at the granular developer flow (packages -> test ->
bootsupport/vfscommonupdate -> commit -> bake). Pass -dirty-abort 0
to build anyway with PROVENANCE-WARNINGs.
Deliberately does NOT run the promotion gates (bootsupport,
vfscommonupdate): payload promotion is a confirm-gated, committed
act - on a clean checkout the gates are already satisfied by the
committed tree."
packages packages
" "
Build (or copy if build not required) both .tm and pkgIndex.tcl based Build (or copy if build not required) both .tm and pkgIndex.tcl based
@ -1872,23 +1905,32 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
<projectdir>. <projectdir>.
This does not scan src/runtime and src/vfs folders to build kit/zipkit This does not scan src/runtime and src/vfs folders to build kit/zipkit
executables." executables."
vfs bake
" "
Scan src/vfs and src/runtime folders and build kit/zipkit executables Assemble kit/zipkit executables: scan src/vfs and src/runtime folders,
into <projectdir>/bin. build each configured kit from the promoted payload
Does not first rebuild modules/libs - use 'make.tcl project' for the (src/vfs/_vfscommon.vfs + custom vfs folders) and its runtime, and
full pipeline." install to <projectdir>/bin.
Includes the vfslibs phase (declared vendored platform-library
propagation into kit vfs lib_tcl<N> trees) so a bake cannot ship
stale binary libs.
Does not rebuild modules/libs and does not run the promotion gates -
built modules reach the kit payload only via 'make.tcl
vfscommonupdate' (committed for provenance). Consumer full path from
a clean checkout: 'make.tcl bakehouse'."
vfslibs vfslibs
" "
Propagate declared vendored platform-library packages into kit vfs Propagate declared vendored platform-library packages into kit vfs
lib_tcl<N> trees. lib_tcl<N> trees.
Declarations (per-package per-kit, with superseded-version removal) Declarations (per-package per-kit, with superseded-version removal)
live in src/runtime/vendorlib_vfs.toml. live in src/runtime/vendorlib_vfs.toml.
Also runs automatically as part of 'make.tcl project'." Also runs automatically as a phase of 'make.tcl bake' (and therefore
of 'make.tcl bakehouse'); this standalone narrowing serves quick
iteration on the declarations."
bin bin
" "
Install executables from src/bin to <projectdir>/bin, then check vfs Install executables from src/bin to <projectdir>/bin, then check vfs
folders and build kit/zipkit executables as for the vfs subcommand." folders and build kit/zipkit executables as for the bake subcommand."
vendorupdate vendorupdate
" "
Update the src/vendormodules based on src/vendormodules/include_modules.config. Update the src/vendormodules based on src/vendormodules/include_modules.config.
@ -1907,7 +1949,7 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
vfscommonupdate vfscommonupdate
" "
Update the src/vfs/_vfscommon.vfs from compiled src/modules and src/lib etc. Update the src/vfs/_vfscommon.vfs from compiled src/modules and src/lib etc.
Before calling this (followed by 'make.tcl project') - you can test using Before calling this (followed by 'make.tcl bake') - you can test using
'<builtexe>(.exe) dev' - this will load modules from your <projectdir>/modules, '<builtexe>(.exe) dev' - this will load modules from your <projectdir>/modules,
<projectdir>/lib paths instead of from the kit/zipkit. <projectdir>/lib paths instead of from the kit/zipkit.
Replacing the _vfscommon.vfs contents requires confirmation - see -confirm." Replacing the _vfscommon.vfs contents requires confirmation - see -confirm."
@ -1933,6 +1975,41 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
The text is embedded in make.tcl (::punkboot::workflow_text) so it is The text is embedded in make.tcl (::punkboot::workflow_text) so it is
available wherever make.tcl runs; its MAINTENANCE key states the available wherever make.tcl runs; its MAINTENANCE key states the
update contract for keeping it in step with build behaviour." update contract for keeping it in step with build behaviour."
buildsuite
"
Surface for the defined buildsuites under src/buildsuites (zig-built
runtime factory - an arm's-length subsystem building Tcl runtimes
from external sources, distinct from the project build/bake stages).
Actions:
buildsuite list
Discover the suites (directories carrying a suite.tcl driver;
_build excluded) with their one-line descriptions.
buildsuite info <name>
Show the suite's configured detail: description, source records
(name/kind/url/ref/dir from sources.config), pinned zig and its
resolution, products, doc pointers.
buildsuite build <name> ?driver-args ...?
Run the suite's driver ('suite.tcl build' with the given args
forwarded untouched, e.g -tclbranch/-refresh/-steps), streaming
its output and exiting with the driver's status.
Suites are SELF-describing: list/info read each suite's
sources.config records (description/product/doc/zigpin - the same
manifest the suite.tcl driver parses), so a copied/retargeted tree
(copy-and-tweak workflow) appears here automatically with no
make.tcl edits. The contract is documented in
src/buildsuites/README.md."
project
"
DEPRECATED alias for 'bakehouse' (G-112 stage-true rename) - prints a
one-line notice and runs bakehouse (packages + bake, -dirty-abort
default ON). Retained for a transition window."
vfs
"
DEPRECATED alias for 'bake' (G-112 stage-true rename) - prints a
one-line notice and runs bake (kit assembly including the vfslibs
phase). Retained for a transition window."
} }
#shared option fragments composed into the per-subcommand definitions below #shared option fragments composed into the per-subcommand definitions below
variable OPT_CONFIRM { variable OPT_CONFIRM {
@ -1966,15 +2043,26 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
"Terminate running processes matching the executable being built "Terminate running processes matching the executable being built
(if applicable) so the build can install over it." (if applicable) so the build can install over it."
} }
#bakehouse (and its deprecated alias project) defaults the dirty gate ON:
#the bakehouse bakes from the committed recipe (G-112 two-persona model).
variable OPT_DIRTYABORT_ON {
-dirty-abort -type boolean -default 1 -help\
"Abort when src/ has uncommitted VCS changes - DEFAULT ON for this
subcommand: the bakehouse bakes from the committed recipe. A
consumer build on a clean checkout runs uninterrupted; uncommitted
developer changes get a refusal naming the granular flow
(packages -> test -> bootsupport/vfscommonupdate -> commit -> bake).
Pass -dirty-abort 0 to build anyway with PROVENANCE-WARNINGs."
}
#which shared option fragments each subcommand declares #which shared option fragments each subcommand declares
#(shell and help have bespoke definitions below: shell passes trailing args #(shell and help have bespoke definitions below: shell passes trailing args
# through to the repl untouched, help takes a subject value) # through to the repl untouched, help takes a subject value)
variable SUBOPTS { variable SUBOPTS {
project {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM} bakehouse {OPT_FORCEKILL OPT_DIRTYABORT_ON OPT_CONFIRM}
packages {OPT_DIRTYABORT OPT_CONFIRM} packages {OPT_DIRTYABORT OPT_CONFIRM}
modules {OPT_DIRTYABORT OPT_CONFIRM} modules {OPT_DIRTYABORT OPT_CONFIRM}
libs {OPT_DIRTYABORT OPT_CONFIRM} libs {OPT_DIRTYABORT OPT_CONFIRM}
vfs {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM} bake {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM}
vfslibs {OPT_DIRTYABORT OPT_CONFIRM} vfslibs {OPT_DIRTYABORT OPT_CONFIRM}
bin {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM} bin {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM}
vendorupdate {OPT_CONFIRM} vendorupdate {OPT_CONFIRM}
@ -1984,14 +2072,17 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
check {} check {}
projectversion {} projectversion {}
workflow {} workflow {}
project {OPT_FORCEKILL OPT_DIRTYABORT_ON OPT_CONFIRM}
vfs {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM}
} }
#synopsis fragments matching the shared option fragments (explicit @form -synopsis #synopsis fragments matching the shared option fragments (explicit @form -synopsis
#so usage shows the real invocation 'make.tcl <subcommand> ...' rather than the #so usage shows the real invocation 'make.tcl <subcommand> ...' rather than the
#internal definition id) #internal definition id)
variable OPT_SYNOPSES { variable OPT_SYNOPSES {
OPT_FORCEKILL "?-k?" OPT_FORCEKILL "?-k?"
OPT_DIRTYABORT "?-dirty-abort?" OPT_DIRTYABORT "?-dirty-abort?"
OPT_CONFIRM "?-confirm 0|1?" OPT_DIRTYABORT_ON "?-dirty-abort 1|0?"
OPT_CONFIRM "?-confirm 0|1?"
} }
foreach {sub optvars} $SUBOPTS { foreach {sub optvars} $SUBOPTS {
set synparts [list "make.tcl $sub"] set synparts [list "make.tcl $sub"]
@ -2022,6 +2113,15 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
{@values -min 0 -max -1 {@values -min 0 -max -1
arg -type any -optional 1 -multiple 1 -help\ arg -type any -optional 1 -multiple 1 -help\
"Arguments passed through to the punk repl."} "Arguments passed through to the punk repl."}
punk::args::define\
"@id -id (script)::punkboot::buildsuite"\
"@normalize"\
"@cmd -name [list "make.tcl buildsuite"] -summary [list [dict get $SUMMARIES buildsuite]] -help [list [dict get $HELPTEXTS buildsuite]]"\
{@form -synopsis "make.tcl buildsuite list|info|build ?<suitename>? ?driver-args ...?"}\
{@values -min 0 -max -1
arg -type any -optional 1 -multiple 1 -help\
"Action (list|info|build), suite name, and - for build - driver
arguments forwarded to the suite's suite.tcl untouched."}
punk::args::define\ punk::args::define\
"@id -id (script)::punkboot::help"\ "@id -id (script)::punkboot::help"\
"@normalize"\ "@normalize"\
@ -2034,10 +2134,13 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
"subject -type string -optional 0 -choices [list [dict keys $SUMMARIES]] -help {Subcommand to show usage for.}" "subject -type string -optional 0 -choices [list [dict keys $SUMMARIES]] -help {Subcommand to show usage for.}"
#top-level definition: the subcommand table rendered by 'make.tcl' / 'make.tcl -help' #top-level definition: the subcommand table rendered by 'make.tcl' / 'make.tcl -help'
variable SUBGROUPS { variable SUBGROUPS {
"build & promotion" {project packages modules libs vfs vfslibs bin} "build & bake" {bakehouse packages modules libs bake vfslibs bin}
"source maintenance" {vendorupdate bootsupport vfscommonupdate} "promotion gates" {bootsupport vfscommonupdate}
"source maintenance" {vendorupdate}
"buildsuites" {buildsuite}
"informational" {info check projectversion workflow help} "informational" {info check projectversion workflow help}
"interactive" {shell} "interactive" {shell}
"deprecated aliases" {project vfs}
} }
punk::args::define\ punk::args::define\
"@id -id (script)::punkboot"\ "@id -id (script)::punkboot"\
@ -2062,7 +2165,7 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
#resolve a mechanism used here (e.g pre-@normalize snapshots) degrades to the #resolve a mechanism used here (e.g pre-@normalize snapshots) degrades to the
#plain fallback immediately instead of erroring at first parse/usage. #plain fallback immediately instead of erroring at first parse/usage.
punk::args::get_spec (script)::punkboot punk::args::get_spec (script)::punkboot
punk::args::get_spec (script)::punkboot::project punk::args::get_spec (script)::punkboot::bakehouse
punk::args::get_spec (script)::punkboot::help punk::args::get_spec (script)::punkboot::help
punk::args::get_spec (script)::punkboot::shell punk::args::get_spec (script)::punkboot::shell
unset -nocomplain sub optvars defparts ov unset -nocomplain sub optvars defparts ov
@ -2120,6 +2223,11 @@ if {$::punkboot::punkargs_ok} {
} elseif {$subcommand eq "shell"} { } elseif {$subcommand eq "shell"} {
#declared passthrough: everything after 'shell' goes to the repl unparsed #declared passthrough: everything after 'shell' goes to the repl unparsed
set ::punkboot::command shell set ::punkboot::command shell
} elseif {$subcommand eq "buildsuite"} {
#declared passthrough: the handler parses action/name itself; driver
#args (arbitrary suite flags) are forwarded untouched (G-104)
set ::punkboot::command buildsuite
set ::punkboot::bs_args $subargs
} else { } else {
if {[catch {punk::args::parse $subargs -errorstyle $::punkboot::errstyle withid (script)::punkboot::$subcommand} argd]} { if {[catch {punk::args::parse $subargs -errorstyle $::punkboot::errstyle withid (script)::punkboot::$subcommand} argd]} {
puts stderr $argd puts stderr $argd
@ -2140,6 +2248,13 @@ if {$::punkboot::punkargs_ok} {
#unavailable). Keeps check/bootsupport/modules and the -k/-dirty-abort/-confirm flags working. #unavailable). Keeps check/bootsupport/modules and the -k/-dirty-abort/-confirm flags working.
set commands_found [list] set commands_found [list]
set argsleft $scriptargs set argsleft $scriptargs
if {[lindex $scriptargs 0] eq "buildsuite"} {
#declared passthrough (as in the punk::args path): driver args carry
#arbitrary suite flags the fallback flag scan must not consume (G-104)
set commands_found [list buildsuite]
set argsleft [list]
set ::punkboot::bs_args [lrange $scriptargs 1 end]
}
while {[llength $argsleft]} { while {[llength $argsleft]} {
set a [lindex $argsleft 0] set a [lindex $argsleft 0]
set argsleft [lrange $argsleft 1 end] set argsleft [lrange $argsleft 1 end]
@ -2219,6 +2334,30 @@ if {$do_help} {
exit $help_exitcode exit $help_exitcode
} }
#G-112 deprecated aliases - one-line mapping before any dispatch:
# project -> bakehouse (packages + bake, -dirty-abort default ON)
# vfs -> bake (kit assembly including the vfslibs phase)
#Kept for a transition window (until the 8.6 arc completes - see the G-112
#dispositions). The alias definitions above mirror their targets' options so
#flags parse identically; only the command word maps here.
if {[info exists ::punkboot::command]} {
switch -- $::punkboot::command {
project {
puts stderr "make.tcl: 'project' is DEPRECATED - use 'bakehouse' (packages + bake; refuses uncommitted src by default). Running bakehouse."
set ::punkboot::command bakehouse
}
vfs {
puts stderr "make.tcl: 'vfs' is DEPRECATED - use 'bake' (kit assembly incl. the vfslibs phase). Running bake."
set ::punkboot::command bake
}
}
if {!$::punkboot::punkargs_ok && $::punkboot::command eq "bakehouse"} {
#degraded fallback scan has flag-only -dirty-abort (no way to pass 0):
#bakehouse's documented default is ON, so force it here.
set ::punkboot::opt_dirty_abort 1
}
}
set forcekill $::punkboot::opt_forcekill set forcekill $::punkboot::opt_forcekill
#puts stdout "::argv $::argv" #puts stdout "::argv $::argv"
# ---------------------------------------- # ----------------------------------------
@ -2231,7 +2370,7 @@ set forcekill $::punkboot::opt_forcekill
# - patch bump -> warn and proceed (non-breaking) # - patch bump -> warn and proceed (non-breaking)
# 'check' is exempt in all cases the warning is shown at the end of its output instead. # 'check' is exempt in all cases the warning is shown at the end of its output instead.
# 'projectversion' and 'workflow' are informational/read-only and are likewise exempt. # 'projectversion' and 'workflow' are informational/read-only and are likewise exempt.
if {[info exists ::punkboot::stale_bootsupport] && $::punkboot::command ni {check projectversion workflow}} { if {[info exists ::punkboot::stale_bootsupport] && $::punkboot::command ni {check projectversion workflow buildsuite}} {
set _stale $::punkboot::stale_bootsupport set _stale $::punkboot::stale_bootsupport
set _have_major 0 set _have_major 0
set _have_minor 0 set _have_minor 0
@ -2383,7 +2522,7 @@ if {![llength [info commands ::punkboot::exit_original]]} {
} }
} }
if {$::punkboot::command in {project packages modules libs vfs vfslibs bin bootsupport vfscommonupdate}} { if {$::punkboot::command in {bakehouse packages modules libs bake vfslibs bin bootsupport vfscommonupdate}} {
set dirty_abort $::punkboot::opt_dirty_abort set dirty_abort $::punkboot::opt_dirty_abort
lassign [::punkboot::get_src_provenance_warnings $projectroot "make.tcl $::punkboot::command"] have_scoped_dirty_check dirty_warnings lassign [::punkboot::get_src_provenance_warnings $projectroot "make.tcl $::punkboot::command"] have_scoped_dirty_check dirty_warnings
if {$have_scoped_dirty_check} { if {$have_scoped_dirty_check} {
@ -2392,7 +2531,16 @@ if {$::punkboot::command in {project packages modules libs vfs vfslibs bin boots
puts stderr " To evaluate uncommitted source without building, use '<builtexe> src' or '<builtexe> src shell'." puts stderr " To evaluate uncommitted source without building, use '<builtexe> src' or '<builtexe> src shell'."
if {$dirty_abort} { if {$dirty_abort} {
set ::punkboot::provenance_warnings_pending [list] ;#no recap needed - aborting adjacent to the warning set ::punkboot::provenance_warnings_pending [list] ;#no recap needed - aborting adjacent to the warning
puts stderr "-aborted- (-dirty-abort given and src has uncommitted changes - commit first, or rerun without -dirty-abort to build with a warning)" if {$::punkboot::command eq "bakehouse"} {
puts stderr "-aborted- bakehouse refuses to bake from uncommitted src (the bakehouse bakes from the committed recipe)."
puts stderr " Developer flow for uncommitted changes:"
puts stderr " make.tcl packages -> test ('<builtexe> src', src/tests/runtests.tcl)"
puts stderr " make.tcl bootsupport + make.tcl vfscommonupdate (promotion gates)"
puts stderr " commit -> make.tcl bake"
puts stderr " To build anyway without committed provenance: make.tcl bakehouse -dirty-abort 0"
} else {
puts stderr "-aborted- (-dirty-abort given and src has uncommitted changes - commit first, or rerun without -dirty-abort to build with a warning)"
}
exit 1 exit 1
} }
#Grace period for an attentive human to ctrl-c - only when stdin is a terminal #Grace period for an attentive human to ctrl-c - only when stdin is a terminal
@ -2770,6 +2918,160 @@ if {$::punkboot::command eq "workflow"} {
exit 0 exit 0
} }
if {$::punkboot::command eq "buildsuite"} {
#G-104: thin front for the buildsuites (zig runtime factory - arm's-length
#subsystem building Tcl runtimes from external sources). Discovery is a
#directory scan; description/info come from each suite's sources.config
#records (description/product/doc/zigpin - the same manifest the suite.tcl
#driver parses), so copied/retargeted trees are first-class with no edits
#here. Contract: src/buildsuites/README.md.
set bs_root [file join $sourcefolder buildsuites]
if {![info exists ::punkboot::bs_args]} {set ::punkboot::bs_args [list]}
set bsargs $::punkboot::bs_args
set bs_action [lindex $bsargs 0]
if {$bs_action eq ""} {set bs_action list}
#tolerant manifest reader (make.tcl side): a suite with a malformed or absent
#sources.config still lists - with the problem as its description - rather
#than breaking discovery of the others. suite.tcl's own parser stays strict.
proc ::punkboot::buildsuite_manifest {suitedir} {
set m [dict create description "" products [list] docs [list] zigpin "" sources [list] note ""]
set cfg [file join $suitedir sources.config]
if {![file exists $cfg]} {
dict set m note "(no sources.config manifest)"
return $m
}
if {[catch {
set f [open $cfg r]; set data [read $f]; close $f
foreach line [split $data \n] {
set line [string trim $line]
if {$line eq "" || [string index $line 0] eq "#"} {continue}
if {[catch {llength $line}]} {continue}
switch -- [lindex $line 0] {
source {dict lappend m sources [lrange $line 1 end]}
description {dict set m description [join [lrange $line 1 end] " "]}
product {dict lappend m products [join [lrange $line 1 end] " "]}
doc {dict lappend m docs [lindex $line 1]}
zigpin {dict set m zigpin [lindex $line 1]}
}
}
} cfgerr]} {
dict set m note "(sources.config unreadable: $cfgerr)"
}
return $m
}
proc ::punkboot::buildsuite_dirs {bs_root} {
set dirs [list]
foreach dir [lsort [glob -nocomplain -dir $bs_root -type d *]] {
if {[file tail $dir] eq "_build"} {continue}
if {![file exists [file join $dir suite.tcl]]} {continue} ;#not a suite (no driver)
lappend dirs $dir
}
return $dirs
}
switch -- $bs_action {
list {
set suitedirs [::punkboot::buildsuite_dirs $bs_root]
if {![llength $suitedirs]} {
puts stdout "no buildsuites found under $bs_root (a suite = a directory carrying a suite.tcl driver)"
exit 0
}
puts stdout "buildsuites under $bs_root:"
foreach dir $suitedirs {
set m [::punkboot::buildsuite_manifest $dir]
set desc [dict get $m description]
if {$desc eq ""} {set desc [dict get $m note]}
if {$desc eq ""} {set desc "(no description record in sources.config)"}
puts stdout [format " %-16s %s" [file tail $dir] $desc]
}
puts stdout ""
puts stdout " - 'make.tcl buildsuite info <name>' shows a suite's configured detail"
puts stdout " - 'make.tcl buildsuite build <name> ?driver-args ...?' runs its driver"
exit 0
}
info {
set bs_name [lindex $bsargs 1]
if {$bs_name eq ""} {
puts stderr "usage: make.tcl buildsuite info <suitename> ('make.tcl buildsuite list' shows the names)"
exit 2
}
set dir [file join $bs_root $bs_name]
if {![file isdirectory $dir] || ![file exists [file join $dir suite.tcl]]} {
puts stderr "buildsuite '$bs_name' not found (no [file join $dir suite.tcl]) - 'make.tcl buildsuite list' shows the suites"
exit 2
}
set m [::punkboot::buildsuite_manifest $dir]
puts stdout "buildsuite: $bs_name"
puts stdout " path: $dir"
if {[dict get $m note] ne ""} {puts stdout " note: [dict get $m note]"}
if {[dict get $m description] ne ""} {puts stdout " description: [dict get $m description]"}
if {[llength [dict get $m sources]]} {
puts stdout " sources (sources.config - the live dev-flow refs; the 'zig build' flow pins per-checkin via build.zig.zon):"
puts stdout [format " %-10s %-7s %-40s %-16s %s" name kind url ref dir]
foreach s [dict get $m sources] {
lassign $s sname skind surl sref sdir
puts stdout [format " %-10s %-7s %-40s %-16s %s" $sname $skind $surl $sref $sdir]
}
}
set zigpin [dict get $m zigpin]
if {$zigpin ne ""} {
set pinpath [file normalize [file join $projectroot $zigpin]]
set pinstate [expr {[file exists $pinpath] ? "present" : "NOT PRESENT (bin/punk-getzig.cmd can fetch it)"}]
puts stdout " zig pin: $zigpin ($pinstate)"
} else {
puts stdout " zig pin: (no zigpin record in sources.config)"
}
if {[info exists ::env(PUNK_ZIG)]} {
puts stdout " zig via env: PUNK_ZIG=$::env(PUNK_ZIG) (overrides the pin for driver runs)"
}
foreach p [dict get $m products] {
puts stdout " product: $p"
}
foreach d [dict get $m docs] {
puts stdout " doc: [file join $dir $d]"
}
exit 0
}
build {
set bs_name [lindex $bsargs 1]
if {$bs_name eq ""} {
puts stderr "usage: make.tcl buildsuite build <suitename> ?driver-args ...?"
exit 2
}
set dir [file join $bs_root $bs_name]
set driver [file join $dir suite.tcl]
if {![file exists $driver]} {
puts stderr "buildsuite '$bs_name' not found (no $driver) - 'make.tcl buildsuite list' shows the suites"
exit 2
}
set fwdargs [lrange $bsargs 2 end]
#interpreter for the driver: this tclsh - or, punk-exe-hosted (the
#G-058 static-capture marker identifies a kit boot), the kit's
#'script' subcommand so the driver runs with plain script semantics
set launcher [list [info nameofexecutable]]
if {[info exists ::punkboot::static_packages]} {
set launcher [list [info nameofexecutable] script]
}
puts stdout "buildsuite build $bs_name: running '$driver build' with forwarded args: $fwdargs"
flush stdout
#stream driver output; exit with the driver's status
if {[catch {exec {*}$launcher $driver build {*}$fwdargs >@stdout 2>@stderr} execerr execopts]} {
set ecode [dict get $execopts -errorcode]
if {[lindex $ecode 0] eq "CHILDSTATUS"} {
exit [lindex $ecode 2]
}
puts stderr "buildsuite build $bs_name: failed to run the driver: $execerr"
exit 1
}
exit 0
}
default {
puts stderr "unknown buildsuite action '$bs_action' - expected list|info|build"
puts stderr "usage: make.tcl buildsuite list|info|build ?<suitename>? ?driver-args ...?"
exit 2
}
}
}
if {$::punkboot::command eq "shell"} { if {$::punkboot::command eq "shell"} {
#G-113: the ansistrip transform serves make.tcl's own output only - the repl's #G-113: the ansistrip transform serves make.tcl's own output only - the repl's
#colour behaviour is the shell's own concern (colour on/off + NO_COLOR there). #colour behaviour is the shell's own concern (colour on/off + NO_COLOR there).
@ -3175,7 +3477,7 @@ if {$::punkboot::command eq "bootsupport"} {
#Project layouts store no bootsupport module snapshots - 'dev project.new' injects bootsupport #Project layouts store no bootsupport module snapshots - 'dev project.new' injects bootsupport
#into generated projects from the generating shell at generation time. Layout-carried scripts #into generated projects from the generating shell at generation time. Layout-carried scripts
#and bootsupport manifests are kept current by the thin-layout sync step (see DIAGRAM 1b in #and bootsupport manifests are kept current by the thin-layout sync step (see DIAGRAM 1b in
#::punkboot::workflow_text), which runs during modules/libs/packages/project builds. #::punkboot::workflow_text), which runs during modules/libs/packages/bakehouse builds.
puts stdout " bootsupport done " puts stdout " bootsupport done "
flush stderr flush stderr
@ -3187,7 +3489,7 @@ if {$::punkboot::command eq "bootsupport"} {
if {$::punkboot::command ni {project modules libs packages vfs vfslibs bin}} { if {$::punkboot::command ni {bakehouse packages modules libs bake vfslibs bin}} {
puts stderr "Command $::punkboot::command not implemented - aborting." puts stderr "Command $::punkboot::command not implemented - aborting."
flush stderr flush stderr
after 100 after 100
@ -3200,7 +3502,7 @@ if {$::punkboot::command ni {project modules libs packages vfs vfslibs bin}} {
#install src vendor contents (from version controlled src folder) to base of project (same target folders as our own src/modules etc ie to paths that go on the auto_path and in tcl::tm::list) #install src vendor contents (from version controlled src folder) to base of project (same target folders as our own src/modules etc ie to paths that go on the auto_path and in tcl::tm::list)
if {$::punkboot::command in {project packages modules}} { if {$::punkboot::command in {bakehouse packages modules}} {
set vendormodulefolders [glob -nocomplain -dir $sourcefolder -type d -tails vendormodules vendormodules_tcl*] set vendormodulefolders [glob -nocomplain -dir $sourcefolder -type d -tails vendormodules vendormodules_tcl*]
foreach vf $vendormodulefolders { foreach vf $vendormodulefolders {
lassign [split $vf _] _vm tclx lassign [split $vf _] _vm tclx
@ -3240,7 +3542,7 @@ if {$::punkboot::command in {project packages modules}} {
} }
} }
if {$::punkboot::command in {project packages libs}} { if {$::punkboot::command in {bakehouse packages libs}} {
#exclude README.md from source folder - but only the root one #exclude README.md from source folder - but only the root one
#-exclude-paths takes relative patterns e.g #-exclude-paths takes relative patterns e.g
# */test.txt will only match test.txt exactly one level deep. # */test.txt will only match test.txt exactly one level deep.
@ -3309,7 +3611,7 @@ if {$::punkboot::command in {project packages libs}} {
} }
} }
if {$::punkboot::command in {project vfslibs}} { if {$::punkboot::command in {bakehouse bake vfslibs}} {
#G-037: propagate declared vendored platform-library packages into kit vfs lib_tcl<N> trees. #G-037: propagate declared vendored platform-library packages into kit vfs lib_tcl<N> trees.
#Participation is per-package per-kit (kit vfs package sets intentionally differ - e.g. twapi #Participation is per-package per-kit (kit vfs package sets intentionally differ - e.g. twapi
#versions vary per kit) - declared in src/runtime/vendorlib_vfs.toml, never blanket-copied. #versions vary per kit) - declared in src/runtime/vendorlib_vfs.toml, never blanket-copied.
@ -3400,7 +3702,7 @@ if {$::punkboot::command in {project vfslibs}} {
} }
} }
if {$::punkboot::command in {project packages libs}} { if {$::punkboot::command in {bakehouse packages libs}} {
######################################################## ########################################################
lappend projectlibfolders lib lappend projectlibfolders lib
#exclude README.md from source folder - but only the root one #exclude README.md from source folder - but only the root one
@ -3473,7 +3775,7 @@ if {$::punkboot::command in {project packages libs}} {
} }
if {$::punkboot::command in {project packages modules libs}} { if {$::punkboot::command in {bakehouse packages modules libs}} {
######################################################## ########################################################
#templates - thin-layout sync (G-087 stage 3; see DIAGRAM 1b in ::punkboot::workflow_text) #templates - thin-layout sync (G-087 stage 3; see DIAGRAM 1b in ::punkboot::workflow_text)
#sync boot scripts (build.tcl, make.tcl) and bootsupport include_modules.config manifests into the #sync boot scripts (build.tcl, make.tcl) and bootsupport include_modules.config manifests into the
@ -3584,7 +3886,7 @@ if {$::punkboot::command in {project packages modules libs}} {
} }
} }
if {$::punkboot::command in {project packages modules}} { if {$::punkboot::command in {bakehouse packages modules}} {
#consolidated /modules /modules_tclX folder used for target where X is tcl major version #consolidated /modules /modules_tclX folder used for target where X is tcl major version
#the make process will process for any _tclX not just the major version of the current interpreter #the make process will process for any _tclX not just the major version of the current interpreter
@ -3623,7 +3925,7 @@ if {$::punkboot::command in {project packages modules}} {
} }
} }
if {$::punkboot::command in {project packages modules libs}} { if {$::punkboot::command in {bakehouse packages modules libs}} {
set installername "make.tcl" set installername "make.tcl"
# ---------------------------------------- # ----------------------------------------
if {[punk::repo::is_fossil_root $projectroot]} { if {[punk::repo::is_fossil_root $projectroot]} {
@ -3671,14 +3973,15 @@ if {$::punkboot::command in {project packages modules libs}} {
#review #review
set installername "make.tcl" set installername "make.tcl"
if {$::punkboot::command ni {project vfs bin}} { if {$::punkboot::command ni {bakehouse bake bin}} {
#command = modules #command = packages/modules/libs/vfslibs - stops before kit assembly
puts stdout "vfs folders not checked" puts stdout "vfs folders not checked"
puts stdout " - use 'make.tcl vfscommonupdate' to copy built modules into base vfs folder" puts stdout " - use 'make.tcl vfscommonupdate' to promote built modules into the base vfs folder (promotion gate - commit for provenance)"
puts stdout " - use 'make.tcl project' to build executable kits/zipkits from vfs folders as well if you have runtimes installed" puts stdout " - use 'make.tcl bake' to build executable kits/zipkits from the vfs folders if you have runtimes installed"
puts stdout " Note that without the vfscommonupdate step, 'make.tcl project' will include any manual changes in the *custom* vfs folders but" puts stdout " Note that without the vfscommonupdate step, 'make.tcl bake' will include any manual changes in the *custom* vfs folders but"
puts stdout " without the latest built modules." puts stdout " without the latest built modules."
puts stdout " calling 'builtexename(.exe) dev' will allow testing of built modules before they are put into the kits/zipkits via 'vfscommonupdate' then 'project'" puts stdout " calling 'builtexename(.exe) dev' will allow testing of built modules before they are baked into the kits/zipkits via 'vfscommonupdate' then 'bake'"
puts stdout " - consumer full path from a clean checkout: 'make.tcl bakehouse'"
puts stdout "-done-" puts stdout "-done-"
exit 0 exit 0
} }
@ -5123,11 +5426,11 @@ if {[llength $failed_kits]} {
set had_kits [expr {[llength $installed_kits] || [llength $failed_kits] || [llength $skipped_kits]}] set had_kits [expr {[llength $installed_kits] || [llength $failed_kits] || [llength $skipped_kits]}]
if {$had_kits} { if {$had_kits} {
puts stdout " module builds and kit/zipkit builds processed (vfs config: src/runtime/mapvfs.config)" puts stdout " module builds and kit/zipkit builds processed (vfs config: src/runtime/mapvfs.config)"
puts stdout " - use 'make.tcl modules' to build modules without scanning/building the vfs folders into executable kits/zipkits" puts stdout " - use 'make.tcl modules' to build modules without baking the vfs folders into executable kits/zipkits"
puts stdout " - use 'make.tcl vfscommonupdate' to copy built modules into the base vfs folder <projectdir>/src/vfs/_vfscommon.vfs" puts stdout " - use 'make.tcl vfscommonupdate' to promote built modules into the base vfs folder <projectdir>/src/vfs/_vfscommon.vfs (promotion gate)"
puts stdout " - Note that without the vfscommonupdate step, 'make tcl vfs' (included in 'make tcl project') will build vfs based executables" puts stdout " - Note that without the vfscommonupdate step, 'make.tcl bake' (the kit-assembly stage of 'make.tcl bakehouse') will build vfs based executables"
puts stdout " that include your current custom vfs folders in src/vfs, but with a _vfscommon.vfs that doesn't have the latest built modules" puts stdout " that include your current custom vfs folders in src/vfs, but with a _vfscommon.vfs that doesn't have the latest built modules"
puts stdout " calling 'builtexename(.exe) dev' will allow testing of built modules before they are put into the kits/zipkits via 'vfscommonupdate' then 'project'" puts stdout " calling 'builtexename(.exe) dev' will allow testing of built modules before they are baked into the kits/zipkits via 'vfscommonupdate' then 'bake'"
} else { } else {
puts stdout " module builds processed" puts stdout " module builds processed"
puts stdout "" puts stdout ""

443
src/project_layouts/vendor/punk/basic/src/make.tcl vendored

@ -153,7 +153,7 @@ namespace eval ::punkboot {
variable foldername [file tail $scriptfolder] variable foldername [file tail $scriptfolder]
variable pkg_requirements [list]; variable pkg_missing [list];variable pkg_loaded [list] variable pkg_requirements [list]; variable pkg_missing [list];variable pkg_loaded [list]
variable help_flags [list -help --help /? -h] variable help_flags [list -help --help /? -h]
variable known_commands [list project modules libs packages vfs vfslibs bin info check shell vendorupdate bootsupport vfscommonupdate projectversion workflow] variable known_commands [list bakehouse packages modules libs bake vfslibs bin info check shell vendorupdate bootsupport vfscommonupdate projectversion workflow buildsuite project vfs]
} }
@ -1519,10 +1519,14 @@ proc ::punkboot::punkboot_gethelp {args} {
append h "" \n append h "" \n
append h " $scriptname -help or $scriptname --help or $scriptname /? or just $scriptname" \n append h " $scriptname -help or $scriptname --help or $scriptname /? or just $scriptname" \n
append h " - This help." \n \n append h " - This help." \n \n
append h " $scriptname project ?-k?" \n append h " $scriptname bakehouse ?-k? ?-dirty-abort 1|0?" \n
append h " - this is the literal word project - and confirms you want to run the project build - which includes src/vfs/* checks and builds" \n append h " - consumer build from a clean checkout: runs the packages stage (modules + libs) then bakes kit/zipkit executables to <projectdir>/bin" \n
append h " - refuses uncommitted src by default (-dirty-abort defaults ON: the bakehouse bakes from the committed recipe; pass -dirty-abort 0 to override)" \n
append h " - the optional -k flag will terminate running processes matching the executable being built (if applicable)" \n append h " - the optional -k flag will terminate running processes matching the executable being built (if applicable)" \n
append h " - builds/copies .tm modules from src to <projectdir>/modules etc and pkgIndex.tcl based libraries from src to <projectdir>/lib etc." \n \n append h " - does NOT run the promotion gates (bootsupport, vfscommonupdate) - on a clean checkout they are already satisfied by the committed tree" \n \n
append h " $scriptname bake ?-k?" \n
append h " - assemble kit/zipkit executables from the promoted payload (src/vfs) and src/runtime runtimes into <projectdir>/bin" \n
append h " - includes the vfslibs phase; does not rebuild modules/libs and does not run the promotion gates" \n \n
append h " $scriptname modules" \n append h " $scriptname modules" \n
append h " - build (or copy if build not required) .tm modules from src/modules src/vendormodules etc to their corresponding locations under <projectdir>" \n append h " - build (or copy if build not required) .tm modules from src/modules src/vendormodules etc to their corresponding locations under <projectdir>" \n
append h " This does not scan src/runtime and src/vfs folders to build kit/zipkit/cookfs executables" \n \n append h " This does not scan src/runtime and src/vfs folders to build kit/zipkit/cookfs executables" \n \n
@ -1544,10 +1548,10 @@ proc ::punkboot::punkboot_gethelp {args} {
append h " $scriptname vfslibs" \n append h " $scriptname vfslibs" \n
append h " - propagate declared vendored platform-library packages into kit vfs lib_tcl<N> trees" \n append h " - propagate declared vendored platform-library packages into kit vfs lib_tcl<N> trees" \n
append h " - declarations (per-package per-kit, with superseded-version removal) live in src/runtime/vendorlib_vfs.toml" \n append h " - declarations (per-package per-kit, with superseded-version removal) live in src/runtime/vendorlib_vfs.toml" \n
append h " - also runs automatically as part of '$scriptname project'" \n \n append h " - also runs automatically as a phase of '$scriptname bake' (and therefore of '$scriptname bakehouse')" \n \n
append h " $scriptname vfscommonupdate" \n append h " $scriptname vfscommonupdate" \n
append h " - update the src/vfs/_vfscommon.vfs from compiled src/modules and src/lib etc" \n append h " - promotion gate: update the src/vfs/_vfscommon.vfs from compiled src/modules and src/lib etc" \n
append h " - before calling this (followed by make project) - you can test using '<builtexe>(.exe) dev'" \n append h " - before calling this (followed by '$scriptname bake') - you can test using '<builtexe>(.exe) dev'" \n
append h " this will load modules from your <projectdir>/module <projectdir>/lib paths instead of from the kit/zipkit" \n \n append h " this will load modules from your <projectdir>/module <projectdir>/lib paths instead of from the kit/zipkit" \n \n
append h " $scriptname info" \n append h " $scriptname info" \n
append h " - show the name and base folder of the project to be built" \n \n append h " - show the name and base folder of the project to be built" \n \n
@ -1559,16 +1563,23 @@ proc ::punkboot::punkboot_gethelp {args} {
append h " - advisory check: verify CHANGELOG.md matches punkproject.toml and warn if src/ has changes since the last project-version bump." \n \n append h " - advisory check: verify CHANGELOG.md matches punkproject.toml and warn if src/ has changes since the last project-version bump." \n \n
append h " $scriptname workflow" \n append h " $scriptname workflow" \n
append h " - print an ASCII data-flow overview of the build/release workflow (edit -> packages -> bootsupport -> kits)" \n \n append h " - print an ASCII data-flow overview of the build/release workflow (edit -> packages -> bootsupport -> kits)" \n \n
append h " $scriptname buildsuite list|info|build ?<suitename>? ?driver-args ...?" \n
append h " - list the defined buildsuites under src/buildsuites (zig runtime factory), show a suite's configured" \n
append h " detail (sources/zig pin/products from its sources.config), or run its driver forwarding the args" \n \n
append h " $scriptname help ?subcommand?" \n append h " $scriptname help ?subcommand?" \n
append h " - show usage for $scriptname or one of its subcommands (equivalent: $scriptname <subcommand> -help)" \n \n append h " - show usage for $scriptname or one of its subcommands (equivalent: $scriptname <subcommand> -help)" \n \n
append h " Deprecated aliases (transition window):" \n
append h " $scriptname project -> runs bakehouse (with a one-line notice)" \n
append h " $scriptname vfs -> runs bake (with a one-line notice)" \n \n
append h " Flags:" \n append h " Flags:" \n
append h " -confirm 0|1" \n append h " -confirm 0|1" \n
append h " - interactive y/n confirmation policy (default 1: prompt when stdin is a terminal, abort fast when it is not)." \n append h " - interactive y/n confirmation policy (default 1: prompt when stdin is a terminal, abort fast when it is not)." \n
append h " Use -confirm 0 for unattended runs: the bootsupport minor-staleness gate and the vfscommonupdate REPLACE" \n append h " Use -confirm 0 for unattended runs: the bootsupport minor-staleness gate and the vfscommonupdate REPLACE" \n
append h " confirmation proceed without prompting; kits with a source/target kit-type mismatch are skipped." \n append h " confirmation proceed without prompting; kits with a source/target kit-type mismatch are skipped." \n
append h " -dirty-abort" \n append h " -dirty-abort" \n
append h " - abort build/promotion commands (project packages modules libs vfs vfslibs bin bootsupport vfscommonupdate) when src/ has" \n append h " - abort build/promotion commands (bakehouse packages modules libs bake vfslibs bin bootsupport vfscommonupdate) when src/ has" \n
append h " uncommitted VCS changes. Default is warn-only: artifacts built from dirty src have no committed provenance." \n append h " uncommitted VCS changes. Default is warn-only EXCEPT bakehouse (defaults ON there; -dirty-abort 0 overrides):" \n
append h " artifacts built from dirty src have no committed provenance." \n
append h " Warnings carry a plain PROVENANCE-WARNING: prefix (greppable in redirected output) and are recapped at the end of the run." \n append h " Warnings carry a plain PROVENANCE-WARNING: prefix (greppable in redirected output) and are recapped at the end of the run." \n
append h " Use '$scriptname check' to see the current provenance status. To evaluate uncommitted source without building," \n append h " Use '$scriptname check' to see the current provenance status. To evaluate uncommitted source without building," \n
append h " use '<builtexe> src' or '<builtexe> src shell'." \n \n append h " use '<builtexe> src' or '<builtexe> src shell'." \n \n
@ -1592,7 +1603,20 @@ All commands run from the projectroot with a native tclsh, e.g:
tclsh src/make.tcl <subcommand> -confirm 0 (see [K6]) tclsh src/make.tcl <subcommand> -confirm 0 (see [K6])
RELEASE SEQUENCE (the order that satisfies the staleness + provenance gates) TWO PERSONAS (stage-true subcommand model - one build stage, two promotion
gates, one bake)
----------------------------------------------------------------------------
CONSUMER (clean checkout, wants baked kits):
tclsh src/make.tcl bakehouse -confirm 0
= packages + bake in one uninterrupted run. The promotion gates are already
satisfied by the committed tree. bakehouse REFUSES uncommitted src by
default (-dirty-abort defaults ON: the bakehouse bakes from the committed
recipe; -dirty-abort 0 overrides).
DEVELOPER (changing payload): pass the gates explicitly - the commit is the
publishing act, not a build step. That is the RELEASE SEQUENCE below.
Deprecated aliases (transition window): 'project' -> bakehouse, 'vfs' -> bake.
RELEASE SEQUENCE (the developer order that satisfies the staleness + provenance gates)
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
(1) edit src/modules/foo-999999.0a1.0.tm code change [K1] (1) edit src/modules/foo-999999.0a1.0.tm code change [K1]
@ -1603,7 +1627,7 @@ RELEASE SEQUENCE (the order that satisfies the staleness + provenance gates)
(5) build tclsh src/make.tcl modules -confirm 0 (or 'packages' = modules + libs) (5) build tclsh src/make.tcl modules -confirm 0 (or 'packages' = modules + libs)
(6) build tclsh src/make.tcl bootsupport -confirm 0 run twice: 2nd pass must copy 0 files [K4] (6) build tclsh src/make.tcl bootsupport -confirm 0 run twice: 2nd pass must copy 0 files [K4]
(7) build tclsh src/make.tcl vfscommonupdate -confirm 0 (7) build tclsh src/make.tcl vfscommonupdate -confirm 0
(8) build tclsh src/make.tcl project -confirm 0 kits; close running kit shells first [K5] (8) build tclsh src/make.tcl bake -confirm 0 kits; close running kit shells first [K5]
(9) commit tracked build outputs src/bootsupport, thin-layout script/ (9) commit tracked build outputs src/bootsupport, thin-layout script/
manifest copies (src/project_layouts + manifest copies (src/project_layouts +
templates modpod payload), templates modpod payload),
@ -1634,13 +1658,13 @@ DIAGRAM 1 - DATA FLOW: SOURCE -> BUILT PACKAGES -> PROPAGATION TARGETS
(the module set make.tcl itself src/vfs/_vfscommon.vfs/modules/ + libs (the module set make.tcl itself src/vfs/_vfscommon.vfs/modules/ + libs
boots from; staleness-gated. (VCS-tracked kit payload source) boots from; staleness-gated. (VCS-tracked kit payload source)
Project layouts store NO module | Project layouts store NO module |
snapshots - 'dev project.new' | make.tcl project (or: make.tcl vfs) snapshots - 'dev project.new' | make.tcl bake (kit-assembly stage;
injects bootsupport into generated v injects bootsupport into generated v consumer umbrella: bakehouse)
projects from the generating src/_build/<kit>.exe --deploy--> bin/<kit>.exe projects from the generating src/_build/<kit>.exe --deploy--> bin/<kit>.exe
shell at generation time - G-087) (see DIAGRAM 2) [K5] shell at generation time - G-087) (see DIAGRAM 2) [K5]
DIAGRAM 1b - THIN-LAYOUT SYNC (part of modules/libs/packages/project runs) DIAGRAM 1b - THIN-LAYOUT SYNC (part of modules/libs/packages/bakehouse runs)
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
src/make.tcl src/build.tcl src/bootsupport/modules*/include_modules.config src/make.tcl src/build.tcl src/bootsupport/modules*/include_modules.config
@ -1656,7 +1680,7 @@ DIAGRAM 1b - THIN-LAYOUT SYNC (part of modules/libs/packages/project runs)
kit outside any project can list and generate the punk.project layout) kit outside any project can list and generate the punk.project layout)
DIAGRAM 2 - KIT ASSEMBLY DETAIL (inside 'make.tcl project' / 'make.tcl vfs') DIAGRAM 2 - KIT ASSEMBLY DETAIL (the 'make.tcl bake' stage; incl. vfslibs phase)
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
src/runtime/mapvfs.config which vfs folder pairs with which runtime -> kit name src/runtime/mapvfs.config which vfs folder pairs with which runtime -> kit name
@ -1707,7 +1731,7 @@ KEY / NOTES
a pass copies 0 files (a converged second pass also proves prune tooling ran). a pass copies 0 files (a converged second pass also proves prune tooling ran).
[K5] The deploy step cannot replace a kit exe that is currently executing. Close [K5] The deploy step cannot replace a kit exe that is currently executing. Close
running kit shells before step 8, or rerun 'make.tcl vfs -confirm 0' running kit shells before step 8, or rerun 'make.tcl bake -confirm 0'
afterwards - the freshly built kits wait in src/_build. punkcheck records afterwards - the freshly built kits wait in src/_build. punkcheck records
mean the rerun only redoes the failed deploys. mean the rerun only redoes the failed deploys.
@ -1719,7 +1743,7 @@ KEY / NOTES
- src/tests/runtests.tcl exercises the src/ trees directly (dev modules). - src/tests/runtests.tcl exercises the src/ trees directly (dev modules).
- '<builtkit>.exe dev' (or '<builtkit> src') runs a built shell against the - '<builtkit>.exe dev' (or '<builtkit> src') runs a built shell against the
project dev modules - useful for testing built packages before they are project dev modules - useful for testing built packages before they are
baked into kits via vfscommonupdate + project. baked into kits via vfscommonupdate + bake.
[K8] What is VCS-tracked where (checkin targets after a build): [K8] What is VCS-tracked where (checkin targets after a build):
tracked: src/** (sources, src/bootsupport, src/project_layouts copies, tracked: src/** (sources, src/bootsupport, src/project_layouts copies,
@ -1821,22 +1845,25 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
#single source for the subcommand one-line summaries: each subcommand definition's #single source for the subcommand one-line summaries: each subcommand definition's
#@cmd -summary and the top-level subcommand -choicelabels are both built from this. #@cmd -summary and the top-level subcommand -choicelabels are both built from this.
variable SUMMARIES { variable SUMMARIES {
project "Full project build - packages plus kit/zipkit executables from src/vfs and src/runtime" bakehouse "Consumer build from a clean checkout: packages then bake - refuses uncommitted src by default"
packages "Build .tm modules and pkgIndex.tcl libraries from src into <projectdir> (no kit executables)" packages "Build .tm modules and pkgIndex.tcl libraries from src into <projectdir> (no kit executables)"
modules "Build .tm modules from src/modules, src/vendormodules etc into <projectdir>/modules etc" modules "Build .tm modules from src/modules, src/vendormodules etc into <projectdir>/modules etc"
libs "Build pkgIndex.tcl libraries from src/lib, src/vendorlib etc into <projectdir>/lib etc" libs "Build pkgIndex.tcl libraries from src/lib, src/vendorlib etc into <projectdir>/lib etc"
vfs "Build kit/zipkit executables from src/vfs and src/runtime into <projectdir>/bin" bake "Assemble kit/zipkit executables from promoted payload (src/vfs) and runtimes into <projectdir>/bin"
vfslibs "Propagate declared vendored platform-library packages into kit vfs lib_tcl<N> trees" vfslibs "Propagate declared vendored platform-library packages into kit vfs lib_tcl<N> trees"
bin "Install executables from src/bin into <projectdir>/bin, then build kits as for vfs" bin "Install executables from src/bin into <projectdir>/bin, then build kits as for bake"
vendorupdate "Update src/vendormodules based on src/vendormodules/include_modules.config" vendorupdate "Update src/vendormodules based on src/vendormodules/include_modules.config"
bootsupport "Update src/bootsupport modules from built project modules" bootsupport "Promotion gate: update src/bootsupport modules from built project modules"
vfscommonupdate "Replace src/vfs/_vfscommon.vfs modules and libs with the project's built modules and libs" vfscommonupdate "Promotion gate: replace src/vfs/_vfscommon.vfs modules and libs with the project's built set"
info "Show the name and base folder of the project to be built" info "Show the name and base folder of the project to be built"
check "Show module/library paths and any potentially problematic packages for running this script" check "Show module/library paths and any potentially problematic packages for running this script"
projectversion "Advisory check: CHANGELOG.md vs punkproject.toml and src/ changes since last version bump" projectversion "Advisory check: CHANGELOG.md vs punkproject.toml and src/ changes since last version bump"
workflow "Print an ASCII data-flow overview of the build/release workflow (edit -> packages -> bootsupport -> kits)" workflow "Print an ASCII data-flow overview of the build/release workflow (edit -> packages -> gates -> bake)"
shell "Run the punk shell using bootsupport libraries" shell "Run the punk shell using bootsupport libraries"
help "Show usage for make.tcl or one of its subcommands" help "Show usage for make.tcl or one of its subcommands"
buildsuite "List, describe or run the defined buildsuites under src/buildsuites (zig runtime factory)"
project "DEPRECATED alias for bakehouse (one-line notice, then runs bakehouse)"
vfs "DEPRECATED alias for bake (one-line notice, then runs bake)"
} }
#@cmd -help bodies for the constructed definitions below. Authored BLOCK-FORM #@cmd -help bodies for the constructed definitions below. Authored BLOCK-FORM
#(first value line whitespace-only) so the @normalize directive in each #(first value line whitespace-only) so the @normalize directive in each
@ -1845,14 +1872,20 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
#normalization (head-form values here would leak this file's indentation into #normalization (head-form values here would leak this file's indentation into
#the rendered Description column). #the rendered Description column).
variable HELPTEXTS { variable HELPTEXTS {
project bakehouse
" "
Run the full project build - includes src/vfs/* checks and builds. Consumer umbrella: run the packages stage (modules + libs) then bake
Builds/copies .tm modules and pkgIndex.tcl based libraries from src to the kit/zipkit executables - the full path from a CLEAN checkout to
<projectdir>/modules, <projectdir>/lib etc, propagates declared vendored installed kits in <projectdir>/bin.
platform-libraries into kit vfs trees (as for vfslibs), then scans The bakehouse bakes from the committed recipe: by default it refuses
src/runtime and src/vfs folders to build kit/zipkit executables and to run when src/ has uncommitted changes (-dirty-abort defaults ON),
installs them to <projectdir>/bin." pointing at the granular developer flow (packages -> test ->
bootsupport/vfscommonupdate -> commit -> bake). Pass -dirty-abort 0
to build anyway with PROVENANCE-WARNINGs.
Deliberately does NOT run the promotion gates (bootsupport,
vfscommonupdate): payload promotion is a confirm-gated, committed
act - on a clean checkout the gates are already satisfied by the
committed tree."
packages packages
" "
Build (or copy if build not required) both .tm and pkgIndex.tcl based Build (or copy if build not required) both .tm and pkgIndex.tcl based
@ -1872,23 +1905,32 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
<projectdir>. <projectdir>.
This does not scan src/runtime and src/vfs folders to build kit/zipkit This does not scan src/runtime and src/vfs folders to build kit/zipkit
executables." executables."
vfs bake
" "
Scan src/vfs and src/runtime folders and build kit/zipkit executables Assemble kit/zipkit executables: scan src/vfs and src/runtime folders,
into <projectdir>/bin. build each configured kit from the promoted payload
Does not first rebuild modules/libs - use 'make.tcl project' for the (src/vfs/_vfscommon.vfs + custom vfs folders) and its runtime, and
full pipeline." install to <projectdir>/bin.
Includes the vfslibs phase (declared vendored platform-library
propagation into kit vfs lib_tcl<N> trees) so a bake cannot ship
stale binary libs.
Does not rebuild modules/libs and does not run the promotion gates -
built modules reach the kit payload only via 'make.tcl
vfscommonupdate' (committed for provenance). Consumer full path from
a clean checkout: 'make.tcl bakehouse'."
vfslibs vfslibs
" "
Propagate declared vendored platform-library packages into kit vfs Propagate declared vendored platform-library packages into kit vfs
lib_tcl<N> trees. lib_tcl<N> trees.
Declarations (per-package per-kit, with superseded-version removal) Declarations (per-package per-kit, with superseded-version removal)
live in src/runtime/vendorlib_vfs.toml. live in src/runtime/vendorlib_vfs.toml.
Also runs automatically as part of 'make.tcl project'." Also runs automatically as a phase of 'make.tcl bake' (and therefore
of 'make.tcl bakehouse'); this standalone narrowing serves quick
iteration on the declarations."
bin bin
" "
Install executables from src/bin to <projectdir>/bin, then check vfs Install executables from src/bin to <projectdir>/bin, then check vfs
folders and build kit/zipkit executables as for the vfs subcommand." folders and build kit/zipkit executables as for the bake subcommand."
vendorupdate vendorupdate
" "
Update the src/vendormodules based on src/vendormodules/include_modules.config. Update the src/vendormodules based on src/vendormodules/include_modules.config.
@ -1907,7 +1949,7 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
vfscommonupdate vfscommonupdate
" "
Update the src/vfs/_vfscommon.vfs from compiled src/modules and src/lib etc. Update the src/vfs/_vfscommon.vfs from compiled src/modules and src/lib etc.
Before calling this (followed by 'make.tcl project') - you can test using Before calling this (followed by 'make.tcl bake') - you can test using
'<builtexe>(.exe) dev' - this will load modules from your <projectdir>/modules, '<builtexe>(.exe) dev' - this will load modules from your <projectdir>/modules,
<projectdir>/lib paths instead of from the kit/zipkit. <projectdir>/lib paths instead of from the kit/zipkit.
Replacing the _vfscommon.vfs contents requires confirmation - see -confirm." Replacing the _vfscommon.vfs contents requires confirmation - see -confirm."
@ -1933,6 +1975,41 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
The text is embedded in make.tcl (::punkboot::workflow_text) so it is The text is embedded in make.tcl (::punkboot::workflow_text) so it is
available wherever make.tcl runs; its MAINTENANCE key states the available wherever make.tcl runs; its MAINTENANCE key states the
update contract for keeping it in step with build behaviour." update contract for keeping it in step with build behaviour."
buildsuite
"
Surface for the defined buildsuites under src/buildsuites (zig-built
runtime factory - an arm's-length subsystem building Tcl runtimes
from external sources, distinct from the project build/bake stages).
Actions:
buildsuite list
Discover the suites (directories carrying a suite.tcl driver;
_build excluded) with their one-line descriptions.
buildsuite info <name>
Show the suite's configured detail: description, source records
(name/kind/url/ref/dir from sources.config), pinned zig and its
resolution, products, doc pointers.
buildsuite build <name> ?driver-args ...?
Run the suite's driver ('suite.tcl build' with the given args
forwarded untouched, e.g -tclbranch/-refresh/-steps), streaming
its output and exiting with the driver's status.
Suites are SELF-describing: list/info read each suite's
sources.config records (description/product/doc/zigpin - the same
manifest the suite.tcl driver parses), so a copied/retargeted tree
(copy-and-tweak workflow) appears here automatically with no
make.tcl edits. The contract is documented in
src/buildsuites/README.md."
project
"
DEPRECATED alias for 'bakehouse' (G-112 stage-true rename) - prints a
one-line notice and runs bakehouse (packages + bake, -dirty-abort
default ON). Retained for a transition window."
vfs
"
DEPRECATED alias for 'bake' (G-112 stage-true rename) - prints a
one-line notice and runs bake (kit assembly including the vfslibs
phase). Retained for a transition window."
} }
#shared option fragments composed into the per-subcommand definitions below #shared option fragments composed into the per-subcommand definitions below
variable OPT_CONFIRM { variable OPT_CONFIRM {
@ -1966,15 +2043,26 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
"Terminate running processes matching the executable being built "Terminate running processes matching the executable being built
(if applicable) so the build can install over it." (if applicable) so the build can install over it."
} }
#bakehouse (and its deprecated alias project) defaults the dirty gate ON:
#the bakehouse bakes from the committed recipe (G-112 two-persona model).
variable OPT_DIRTYABORT_ON {
-dirty-abort -type boolean -default 1 -help\
"Abort when src/ has uncommitted VCS changes - DEFAULT ON for this
subcommand: the bakehouse bakes from the committed recipe. A
consumer build on a clean checkout runs uninterrupted; uncommitted
developer changes get a refusal naming the granular flow
(packages -> test -> bootsupport/vfscommonupdate -> commit -> bake).
Pass -dirty-abort 0 to build anyway with PROVENANCE-WARNINGs."
}
#which shared option fragments each subcommand declares #which shared option fragments each subcommand declares
#(shell and help have bespoke definitions below: shell passes trailing args #(shell and help have bespoke definitions below: shell passes trailing args
# through to the repl untouched, help takes a subject value) # through to the repl untouched, help takes a subject value)
variable SUBOPTS { variable SUBOPTS {
project {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM} bakehouse {OPT_FORCEKILL OPT_DIRTYABORT_ON OPT_CONFIRM}
packages {OPT_DIRTYABORT OPT_CONFIRM} packages {OPT_DIRTYABORT OPT_CONFIRM}
modules {OPT_DIRTYABORT OPT_CONFIRM} modules {OPT_DIRTYABORT OPT_CONFIRM}
libs {OPT_DIRTYABORT OPT_CONFIRM} libs {OPT_DIRTYABORT OPT_CONFIRM}
vfs {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM} bake {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM}
vfslibs {OPT_DIRTYABORT OPT_CONFIRM} vfslibs {OPT_DIRTYABORT OPT_CONFIRM}
bin {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM} bin {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM}
vendorupdate {OPT_CONFIRM} vendorupdate {OPT_CONFIRM}
@ -1984,14 +2072,17 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
check {} check {}
projectversion {} projectversion {}
workflow {} workflow {}
project {OPT_FORCEKILL OPT_DIRTYABORT_ON OPT_CONFIRM}
vfs {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM}
} }
#synopsis fragments matching the shared option fragments (explicit @form -synopsis #synopsis fragments matching the shared option fragments (explicit @form -synopsis
#so usage shows the real invocation 'make.tcl <subcommand> ...' rather than the #so usage shows the real invocation 'make.tcl <subcommand> ...' rather than the
#internal definition id) #internal definition id)
variable OPT_SYNOPSES { variable OPT_SYNOPSES {
OPT_FORCEKILL "?-k?" OPT_FORCEKILL "?-k?"
OPT_DIRTYABORT "?-dirty-abort?" OPT_DIRTYABORT "?-dirty-abort?"
OPT_CONFIRM "?-confirm 0|1?" OPT_DIRTYABORT_ON "?-dirty-abort 1|0?"
OPT_CONFIRM "?-confirm 0|1?"
} }
foreach {sub optvars} $SUBOPTS { foreach {sub optvars} $SUBOPTS {
set synparts [list "make.tcl $sub"] set synparts [list "make.tcl $sub"]
@ -2022,6 +2113,15 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
{@values -min 0 -max -1 {@values -min 0 -max -1
arg -type any -optional 1 -multiple 1 -help\ arg -type any -optional 1 -multiple 1 -help\
"Arguments passed through to the punk repl."} "Arguments passed through to the punk repl."}
punk::args::define\
"@id -id (script)::punkboot::buildsuite"\
"@normalize"\
"@cmd -name [list "make.tcl buildsuite"] -summary [list [dict get $SUMMARIES buildsuite]] -help [list [dict get $HELPTEXTS buildsuite]]"\
{@form -synopsis "make.tcl buildsuite list|info|build ?<suitename>? ?driver-args ...?"}\
{@values -min 0 -max -1
arg -type any -optional 1 -multiple 1 -help\
"Action (list|info|build), suite name, and - for build - driver
arguments forwarded to the suite's suite.tcl untouched."}
punk::args::define\ punk::args::define\
"@id -id (script)::punkboot::help"\ "@id -id (script)::punkboot::help"\
"@normalize"\ "@normalize"\
@ -2034,10 +2134,13 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
"subject -type string -optional 0 -choices [list [dict keys $SUMMARIES]] -help {Subcommand to show usage for.}" "subject -type string -optional 0 -choices [list [dict keys $SUMMARIES]] -help {Subcommand to show usage for.}"
#top-level definition: the subcommand table rendered by 'make.tcl' / 'make.tcl -help' #top-level definition: the subcommand table rendered by 'make.tcl' / 'make.tcl -help'
variable SUBGROUPS { variable SUBGROUPS {
"build & promotion" {project packages modules libs vfs vfslibs bin} "build & bake" {bakehouse packages modules libs bake vfslibs bin}
"source maintenance" {vendorupdate bootsupport vfscommonupdate} "promotion gates" {bootsupport vfscommonupdate}
"source maintenance" {vendorupdate}
"buildsuites" {buildsuite}
"informational" {info check projectversion workflow help} "informational" {info check projectversion workflow help}
"interactive" {shell} "interactive" {shell}
"deprecated aliases" {project vfs}
} }
punk::args::define\ punk::args::define\
"@id -id (script)::punkboot"\ "@id -id (script)::punkboot"\
@ -2062,7 +2165,7 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
#resolve a mechanism used here (e.g pre-@normalize snapshots) degrades to the #resolve a mechanism used here (e.g pre-@normalize snapshots) degrades to the
#plain fallback immediately instead of erroring at first parse/usage. #plain fallback immediately instead of erroring at first parse/usage.
punk::args::get_spec (script)::punkboot punk::args::get_spec (script)::punkboot
punk::args::get_spec (script)::punkboot::project punk::args::get_spec (script)::punkboot::bakehouse
punk::args::get_spec (script)::punkboot::help punk::args::get_spec (script)::punkboot::help
punk::args::get_spec (script)::punkboot::shell punk::args::get_spec (script)::punkboot::shell
unset -nocomplain sub optvars defparts ov unset -nocomplain sub optvars defparts ov
@ -2120,6 +2223,11 @@ if {$::punkboot::punkargs_ok} {
} elseif {$subcommand eq "shell"} { } elseif {$subcommand eq "shell"} {
#declared passthrough: everything after 'shell' goes to the repl unparsed #declared passthrough: everything after 'shell' goes to the repl unparsed
set ::punkboot::command shell set ::punkboot::command shell
} elseif {$subcommand eq "buildsuite"} {
#declared passthrough: the handler parses action/name itself; driver
#args (arbitrary suite flags) are forwarded untouched (G-104)
set ::punkboot::command buildsuite
set ::punkboot::bs_args $subargs
} else { } else {
if {[catch {punk::args::parse $subargs -errorstyle $::punkboot::errstyle withid (script)::punkboot::$subcommand} argd]} { if {[catch {punk::args::parse $subargs -errorstyle $::punkboot::errstyle withid (script)::punkboot::$subcommand} argd]} {
puts stderr $argd puts stderr $argd
@ -2140,6 +2248,13 @@ if {$::punkboot::punkargs_ok} {
#unavailable). Keeps check/bootsupport/modules and the -k/-dirty-abort/-confirm flags working. #unavailable). Keeps check/bootsupport/modules and the -k/-dirty-abort/-confirm flags working.
set commands_found [list] set commands_found [list]
set argsleft $scriptargs set argsleft $scriptargs
if {[lindex $scriptargs 0] eq "buildsuite"} {
#declared passthrough (as in the punk::args path): driver args carry
#arbitrary suite flags the fallback flag scan must not consume (G-104)
set commands_found [list buildsuite]
set argsleft [list]
set ::punkboot::bs_args [lrange $scriptargs 1 end]
}
while {[llength $argsleft]} { while {[llength $argsleft]} {
set a [lindex $argsleft 0] set a [lindex $argsleft 0]
set argsleft [lrange $argsleft 1 end] set argsleft [lrange $argsleft 1 end]
@ -2219,6 +2334,30 @@ if {$do_help} {
exit $help_exitcode exit $help_exitcode
} }
#G-112 deprecated aliases - one-line mapping before any dispatch:
# project -> bakehouse (packages + bake, -dirty-abort default ON)
# vfs -> bake (kit assembly including the vfslibs phase)
#Kept for a transition window (until the 8.6 arc completes - see the G-112
#dispositions). The alias definitions above mirror their targets' options so
#flags parse identically; only the command word maps here.
if {[info exists ::punkboot::command]} {
switch -- $::punkboot::command {
project {
puts stderr "make.tcl: 'project' is DEPRECATED - use 'bakehouse' (packages + bake; refuses uncommitted src by default). Running bakehouse."
set ::punkboot::command bakehouse
}
vfs {
puts stderr "make.tcl: 'vfs' is DEPRECATED - use 'bake' (kit assembly incl. the vfslibs phase). Running bake."
set ::punkboot::command bake
}
}
if {!$::punkboot::punkargs_ok && $::punkboot::command eq "bakehouse"} {
#degraded fallback scan has flag-only -dirty-abort (no way to pass 0):
#bakehouse's documented default is ON, so force it here.
set ::punkboot::opt_dirty_abort 1
}
}
set forcekill $::punkboot::opt_forcekill set forcekill $::punkboot::opt_forcekill
#puts stdout "::argv $::argv" #puts stdout "::argv $::argv"
# ---------------------------------------- # ----------------------------------------
@ -2231,7 +2370,7 @@ set forcekill $::punkboot::opt_forcekill
# - patch bump -> warn and proceed (non-breaking) # - patch bump -> warn and proceed (non-breaking)
# 'check' is exempt in all cases the warning is shown at the end of its output instead. # 'check' is exempt in all cases the warning is shown at the end of its output instead.
# 'projectversion' and 'workflow' are informational/read-only and are likewise exempt. # 'projectversion' and 'workflow' are informational/read-only and are likewise exempt.
if {[info exists ::punkboot::stale_bootsupport] && $::punkboot::command ni {check projectversion workflow}} { if {[info exists ::punkboot::stale_bootsupport] && $::punkboot::command ni {check projectversion workflow buildsuite}} {
set _stale $::punkboot::stale_bootsupport set _stale $::punkboot::stale_bootsupport
set _have_major 0 set _have_major 0
set _have_minor 0 set _have_minor 0
@ -2383,7 +2522,7 @@ if {![llength [info commands ::punkboot::exit_original]]} {
} }
} }
if {$::punkboot::command in {project packages modules libs vfs vfslibs bin bootsupport vfscommonupdate}} { if {$::punkboot::command in {bakehouse packages modules libs bake vfslibs bin bootsupport vfscommonupdate}} {
set dirty_abort $::punkboot::opt_dirty_abort set dirty_abort $::punkboot::opt_dirty_abort
lassign [::punkboot::get_src_provenance_warnings $projectroot "make.tcl $::punkboot::command"] have_scoped_dirty_check dirty_warnings lassign [::punkboot::get_src_provenance_warnings $projectroot "make.tcl $::punkboot::command"] have_scoped_dirty_check dirty_warnings
if {$have_scoped_dirty_check} { if {$have_scoped_dirty_check} {
@ -2392,7 +2531,16 @@ if {$::punkboot::command in {project packages modules libs vfs vfslibs bin boots
puts stderr " To evaluate uncommitted source without building, use '<builtexe> src' or '<builtexe> src shell'." puts stderr " To evaluate uncommitted source without building, use '<builtexe> src' or '<builtexe> src shell'."
if {$dirty_abort} { if {$dirty_abort} {
set ::punkboot::provenance_warnings_pending [list] ;#no recap needed - aborting adjacent to the warning set ::punkboot::provenance_warnings_pending [list] ;#no recap needed - aborting adjacent to the warning
puts stderr "-aborted- (-dirty-abort given and src has uncommitted changes - commit first, or rerun without -dirty-abort to build with a warning)" if {$::punkboot::command eq "bakehouse"} {
puts stderr "-aborted- bakehouse refuses to bake from uncommitted src (the bakehouse bakes from the committed recipe)."
puts stderr " Developer flow for uncommitted changes:"
puts stderr " make.tcl packages -> test ('<builtexe> src', src/tests/runtests.tcl)"
puts stderr " make.tcl bootsupport + make.tcl vfscommonupdate (promotion gates)"
puts stderr " commit -> make.tcl bake"
puts stderr " To build anyway without committed provenance: make.tcl bakehouse -dirty-abort 0"
} else {
puts stderr "-aborted- (-dirty-abort given and src has uncommitted changes - commit first, or rerun without -dirty-abort to build with a warning)"
}
exit 1 exit 1
} }
#Grace period for an attentive human to ctrl-c - only when stdin is a terminal #Grace period for an attentive human to ctrl-c - only when stdin is a terminal
@ -2770,6 +2918,160 @@ if {$::punkboot::command eq "workflow"} {
exit 0 exit 0
} }
if {$::punkboot::command eq "buildsuite"} {
#G-104: thin front for the buildsuites (zig runtime factory - arm's-length
#subsystem building Tcl runtimes from external sources). Discovery is a
#directory scan; description/info come from each suite's sources.config
#records (description/product/doc/zigpin - the same manifest the suite.tcl
#driver parses), so copied/retargeted trees are first-class with no edits
#here. Contract: src/buildsuites/README.md.
set bs_root [file join $sourcefolder buildsuites]
if {![info exists ::punkboot::bs_args]} {set ::punkboot::bs_args [list]}
set bsargs $::punkboot::bs_args
set bs_action [lindex $bsargs 0]
if {$bs_action eq ""} {set bs_action list}
#tolerant manifest reader (make.tcl side): a suite with a malformed or absent
#sources.config still lists - with the problem as its description - rather
#than breaking discovery of the others. suite.tcl's own parser stays strict.
proc ::punkboot::buildsuite_manifest {suitedir} {
set m [dict create description "" products [list] docs [list] zigpin "" sources [list] note ""]
set cfg [file join $suitedir sources.config]
if {![file exists $cfg]} {
dict set m note "(no sources.config manifest)"
return $m
}
if {[catch {
set f [open $cfg r]; set data [read $f]; close $f
foreach line [split $data \n] {
set line [string trim $line]
if {$line eq "" || [string index $line 0] eq "#"} {continue}
if {[catch {llength $line}]} {continue}
switch -- [lindex $line 0] {
source {dict lappend m sources [lrange $line 1 end]}
description {dict set m description [join [lrange $line 1 end] " "]}
product {dict lappend m products [join [lrange $line 1 end] " "]}
doc {dict lappend m docs [lindex $line 1]}
zigpin {dict set m zigpin [lindex $line 1]}
}
}
} cfgerr]} {
dict set m note "(sources.config unreadable: $cfgerr)"
}
return $m
}
proc ::punkboot::buildsuite_dirs {bs_root} {
set dirs [list]
foreach dir [lsort [glob -nocomplain -dir $bs_root -type d *]] {
if {[file tail $dir] eq "_build"} {continue}
if {![file exists [file join $dir suite.tcl]]} {continue} ;#not a suite (no driver)
lappend dirs $dir
}
return $dirs
}
switch -- $bs_action {
list {
set suitedirs [::punkboot::buildsuite_dirs $bs_root]
if {![llength $suitedirs]} {
puts stdout "no buildsuites found under $bs_root (a suite = a directory carrying a suite.tcl driver)"
exit 0
}
puts stdout "buildsuites under $bs_root:"
foreach dir $suitedirs {
set m [::punkboot::buildsuite_manifest $dir]
set desc [dict get $m description]
if {$desc eq ""} {set desc [dict get $m note]}
if {$desc eq ""} {set desc "(no description record in sources.config)"}
puts stdout [format " %-16s %s" [file tail $dir] $desc]
}
puts stdout ""
puts stdout " - 'make.tcl buildsuite info <name>' shows a suite's configured detail"
puts stdout " - 'make.tcl buildsuite build <name> ?driver-args ...?' runs its driver"
exit 0
}
info {
set bs_name [lindex $bsargs 1]
if {$bs_name eq ""} {
puts stderr "usage: make.tcl buildsuite info <suitename> ('make.tcl buildsuite list' shows the names)"
exit 2
}
set dir [file join $bs_root $bs_name]
if {![file isdirectory $dir] || ![file exists [file join $dir suite.tcl]]} {
puts stderr "buildsuite '$bs_name' not found (no [file join $dir suite.tcl]) - 'make.tcl buildsuite list' shows the suites"
exit 2
}
set m [::punkboot::buildsuite_manifest $dir]
puts stdout "buildsuite: $bs_name"
puts stdout " path: $dir"
if {[dict get $m note] ne ""} {puts stdout " note: [dict get $m note]"}
if {[dict get $m description] ne ""} {puts stdout " description: [dict get $m description]"}
if {[llength [dict get $m sources]]} {
puts stdout " sources (sources.config - the live dev-flow refs; the 'zig build' flow pins per-checkin via build.zig.zon):"
puts stdout [format " %-10s %-7s %-40s %-16s %s" name kind url ref dir]
foreach s [dict get $m sources] {
lassign $s sname skind surl sref sdir
puts stdout [format " %-10s %-7s %-40s %-16s %s" $sname $skind $surl $sref $sdir]
}
}
set zigpin [dict get $m zigpin]
if {$zigpin ne ""} {
set pinpath [file normalize [file join $projectroot $zigpin]]
set pinstate [expr {[file exists $pinpath] ? "present" : "NOT PRESENT (bin/punk-getzig.cmd can fetch it)"}]
puts stdout " zig pin: $zigpin ($pinstate)"
} else {
puts stdout " zig pin: (no zigpin record in sources.config)"
}
if {[info exists ::env(PUNK_ZIG)]} {
puts stdout " zig via env: PUNK_ZIG=$::env(PUNK_ZIG) (overrides the pin for driver runs)"
}
foreach p [dict get $m products] {
puts stdout " product: $p"
}
foreach d [dict get $m docs] {
puts stdout " doc: [file join $dir $d]"
}
exit 0
}
build {
set bs_name [lindex $bsargs 1]
if {$bs_name eq ""} {
puts stderr "usage: make.tcl buildsuite build <suitename> ?driver-args ...?"
exit 2
}
set dir [file join $bs_root $bs_name]
set driver [file join $dir suite.tcl]
if {![file exists $driver]} {
puts stderr "buildsuite '$bs_name' not found (no $driver) - 'make.tcl buildsuite list' shows the suites"
exit 2
}
set fwdargs [lrange $bsargs 2 end]
#interpreter for the driver: this tclsh - or, punk-exe-hosted (the
#G-058 static-capture marker identifies a kit boot), the kit's
#'script' subcommand so the driver runs with plain script semantics
set launcher [list [info nameofexecutable]]
if {[info exists ::punkboot::static_packages]} {
set launcher [list [info nameofexecutable] script]
}
puts stdout "buildsuite build $bs_name: running '$driver build' with forwarded args: $fwdargs"
flush stdout
#stream driver output; exit with the driver's status
if {[catch {exec {*}$launcher $driver build {*}$fwdargs >@stdout 2>@stderr} execerr execopts]} {
set ecode [dict get $execopts -errorcode]
if {[lindex $ecode 0] eq "CHILDSTATUS"} {
exit [lindex $ecode 2]
}
puts stderr "buildsuite build $bs_name: failed to run the driver: $execerr"
exit 1
}
exit 0
}
default {
puts stderr "unknown buildsuite action '$bs_action' - expected list|info|build"
puts stderr "usage: make.tcl buildsuite list|info|build ?<suitename>? ?driver-args ...?"
exit 2
}
}
}
if {$::punkboot::command eq "shell"} { if {$::punkboot::command eq "shell"} {
#G-113: the ansistrip transform serves make.tcl's own output only - the repl's #G-113: the ansistrip transform serves make.tcl's own output only - the repl's
#colour behaviour is the shell's own concern (colour on/off + NO_COLOR there). #colour behaviour is the shell's own concern (colour on/off + NO_COLOR there).
@ -3175,7 +3477,7 @@ if {$::punkboot::command eq "bootsupport"} {
#Project layouts store no bootsupport module snapshots - 'dev project.new' injects bootsupport #Project layouts store no bootsupport module snapshots - 'dev project.new' injects bootsupport
#into generated projects from the generating shell at generation time. Layout-carried scripts #into generated projects from the generating shell at generation time. Layout-carried scripts
#and bootsupport manifests are kept current by the thin-layout sync step (see DIAGRAM 1b in #and bootsupport manifests are kept current by the thin-layout sync step (see DIAGRAM 1b in
#::punkboot::workflow_text), which runs during modules/libs/packages/project builds. #::punkboot::workflow_text), which runs during modules/libs/packages/bakehouse builds.
puts stdout " bootsupport done " puts stdout " bootsupport done "
flush stderr flush stderr
@ -3187,7 +3489,7 @@ if {$::punkboot::command eq "bootsupport"} {
if {$::punkboot::command ni {project modules libs packages vfs vfslibs bin}} { if {$::punkboot::command ni {bakehouse packages modules libs bake vfslibs bin}} {
puts stderr "Command $::punkboot::command not implemented - aborting." puts stderr "Command $::punkboot::command not implemented - aborting."
flush stderr flush stderr
after 100 after 100
@ -3200,7 +3502,7 @@ if {$::punkboot::command ni {project modules libs packages vfs vfslibs bin}} {
#install src vendor contents (from version controlled src folder) to base of project (same target folders as our own src/modules etc ie to paths that go on the auto_path and in tcl::tm::list) #install src vendor contents (from version controlled src folder) to base of project (same target folders as our own src/modules etc ie to paths that go on the auto_path and in tcl::tm::list)
if {$::punkboot::command in {project packages modules}} { if {$::punkboot::command in {bakehouse packages modules}} {
set vendormodulefolders [glob -nocomplain -dir $sourcefolder -type d -tails vendormodules vendormodules_tcl*] set vendormodulefolders [glob -nocomplain -dir $sourcefolder -type d -tails vendormodules vendormodules_tcl*]
foreach vf $vendormodulefolders { foreach vf $vendormodulefolders {
lassign [split $vf _] _vm tclx lassign [split $vf _] _vm tclx
@ -3240,7 +3542,7 @@ if {$::punkboot::command in {project packages modules}} {
} }
} }
if {$::punkboot::command in {project packages libs}} { if {$::punkboot::command in {bakehouse packages libs}} {
#exclude README.md from source folder - but only the root one #exclude README.md from source folder - but only the root one
#-exclude-paths takes relative patterns e.g #-exclude-paths takes relative patterns e.g
# */test.txt will only match test.txt exactly one level deep. # */test.txt will only match test.txt exactly one level deep.
@ -3309,7 +3611,7 @@ if {$::punkboot::command in {project packages libs}} {
} }
} }
if {$::punkboot::command in {project vfslibs}} { if {$::punkboot::command in {bakehouse bake vfslibs}} {
#G-037: propagate declared vendored platform-library packages into kit vfs lib_tcl<N> trees. #G-037: propagate declared vendored platform-library packages into kit vfs lib_tcl<N> trees.
#Participation is per-package per-kit (kit vfs package sets intentionally differ - e.g. twapi #Participation is per-package per-kit (kit vfs package sets intentionally differ - e.g. twapi
#versions vary per kit) - declared in src/runtime/vendorlib_vfs.toml, never blanket-copied. #versions vary per kit) - declared in src/runtime/vendorlib_vfs.toml, never blanket-copied.
@ -3400,7 +3702,7 @@ if {$::punkboot::command in {project vfslibs}} {
} }
} }
if {$::punkboot::command in {project packages libs}} { if {$::punkboot::command in {bakehouse packages libs}} {
######################################################## ########################################################
lappend projectlibfolders lib lappend projectlibfolders lib
#exclude README.md from source folder - but only the root one #exclude README.md from source folder - but only the root one
@ -3473,7 +3775,7 @@ if {$::punkboot::command in {project packages libs}} {
} }
if {$::punkboot::command in {project packages modules libs}} { if {$::punkboot::command in {bakehouse packages modules libs}} {
######################################################## ########################################################
#templates - thin-layout sync (G-087 stage 3; see DIAGRAM 1b in ::punkboot::workflow_text) #templates - thin-layout sync (G-087 stage 3; see DIAGRAM 1b in ::punkboot::workflow_text)
#sync boot scripts (build.tcl, make.tcl) and bootsupport include_modules.config manifests into the #sync boot scripts (build.tcl, make.tcl) and bootsupport include_modules.config manifests into the
@ -3584,7 +3886,7 @@ if {$::punkboot::command in {project packages modules libs}} {
} }
} }
if {$::punkboot::command in {project packages modules}} { if {$::punkboot::command in {bakehouse packages modules}} {
#consolidated /modules /modules_tclX folder used for target where X is tcl major version #consolidated /modules /modules_tclX folder used for target where X is tcl major version
#the make process will process for any _tclX not just the major version of the current interpreter #the make process will process for any _tclX not just the major version of the current interpreter
@ -3623,7 +3925,7 @@ if {$::punkboot::command in {project packages modules}} {
} }
} }
if {$::punkboot::command in {project packages modules libs}} { if {$::punkboot::command in {bakehouse packages modules libs}} {
set installername "make.tcl" set installername "make.tcl"
# ---------------------------------------- # ----------------------------------------
if {[punk::repo::is_fossil_root $projectroot]} { if {[punk::repo::is_fossil_root $projectroot]} {
@ -3671,14 +3973,15 @@ if {$::punkboot::command in {project packages modules libs}} {
#review #review
set installername "make.tcl" set installername "make.tcl"
if {$::punkboot::command ni {project vfs bin}} { if {$::punkboot::command ni {bakehouse bake bin}} {
#command = modules #command = packages/modules/libs/vfslibs - stops before kit assembly
puts stdout "vfs folders not checked" puts stdout "vfs folders not checked"
puts stdout " - use 'make.tcl vfscommonupdate' to copy built modules into base vfs folder" puts stdout " - use 'make.tcl vfscommonupdate' to promote built modules into the base vfs folder (promotion gate - commit for provenance)"
puts stdout " - use 'make.tcl project' to build executable kits/zipkits from vfs folders as well if you have runtimes installed" puts stdout " - use 'make.tcl bake' to build executable kits/zipkits from the vfs folders if you have runtimes installed"
puts stdout " Note that without the vfscommonupdate step, 'make.tcl project' will include any manual changes in the *custom* vfs folders but" puts stdout " Note that without the vfscommonupdate step, 'make.tcl bake' will include any manual changes in the *custom* vfs folders but"
puts stdout " without the latest built modules." puts stdout " without the latest built modules."
puts stdout " calling 'builtexename(.exe) dev' will allow testing of built modules before they are put into the kits/zipkits via 'vfscommonupdate' then 'project'" puts stdout " calling 'builtexename(.exe) dev' will allow testing of built modules before they are baked into the kits/zipkits via 'vfscommonupdate' then 'bake'"
puts stdout " - consumer full path from a clean checkout: 'make.tcl bakehouse'"
puts stdout "-done-" puts stdout "-done-"
exit 0 exit 0
} }
@ -5123,11 +5426,11 @@ if {[llength $failed_kits]} {
set had_kits [expr {[llength $installed_kits] || [llength $failed_kits] || [llength $skipped_kits]}] set had_kits [expr {[llength $installed_kits] || [llength $failed_kits] || [llength $skipped_kits]}]
if {$had_kits} { if {$had_kits} {
puts stdout " module builds and kit/zipkit builds processed (vfs config: src/runtime/mapvfs.config)" puts stdout " module builds and kit/zipkit builds processed (vfs config: src/runtime/mapvfs.config)"
puts stdout " - use 'make.tcl modules' to build modules without scanning/building the vfs folders into executable kits/zipkits" puts stdout " - use 'make.tcl modules' to build modules without baking the vfs folders into executable kits/zipkits"
puts stdout " - use 'make.tcl vfscommonupdate' to copy built modules into the base vfs folder <projectdir>/src/vfs/_vfscommon.vfs" puts stdout " - use 'make.tcl vfscommonupdate' to promote built modules into the base vfs folder <projectdir>/src/vfs/_vfscommon.vfs (promotion gate)"
puts stdout " - Note that without the vfscommonupdate step, 'make tcl vfs' (included in 'make tcl project') will build vfs based executables" puts stdout " - Note that without the vfscommonupdate step, 'make.tcl bake' (the kit-assembly stage of 'make.tcl bakehouse') will build vfs based executables"
puts stdout " that include your current custom vfs folders in src/vfs, but with a _vfscommon.vfs that doesn't have the latest built modules" puts stdout " that include your current custom vfs folders in src/vfs, but with a _vfscommon.vfs that doesn't have the latest built modules"
puts stdout " calling 'builtexename(.exe) dev' will allow testing of built modules before they are put into the kits/zipkits via 'vfscommonupdate' then 'project'" puts stdout " calling 'builtexename(.exe) dev' will allow testing of built modules before they are baked into the kits/zipkits via 'vfscommonupdate' then 'bake'"
} else { } else {
puts stdout " module builds processed" puts stdout " module builds processed"
puts stdout "" puts stdout ""

443
src/project_layouts/vendor/punk/project-0.1/src/make.tcl vendored

@ -153,7 +153,7 @@ namespace eval ::punkboot {
variable foldername [file tail $scriptfolder] variable foldername [file tail $scriptfolder]
variable pkg_requirements [list]; variable pkg_missing [list];variable pkg_loaded [list] variable pkg_requirements [list]; variable pkg_missing [list];variable pkg_loaded [list]
variable help_flags [list -help --help /? -h] variable help_flags [list -help --help /? -h]
variable known_commands [list project modules libs packages vfs vfslibs bin info check shell vendorupdate bootsupport vfscommonupdate projectversion workflow] variable known_commands [list bakehouse packages modules libs bake vfslibs bin info check shell vendorupdate bootsupport vfscommonupdate projectversion workflow buildsuite project vfs]
} }
@ -1519,10 +1519,14 @@ proc ::punkboot::punkboot_gethelp {args} {
append h "" \n append h "" \n
append h " $scriptname -help or $scriptname --help or $scriptname /? or just $scriptname" \n append h " $scriptname -help or $scriptname --help or $scriptname /? or just $scriptname" \n
append h " - This help." \n \n append h " - This help." \n \n
append h " $scriptname project ?-k?" \n append h " $scriptname bakehouse ?-k? ?-dirty-abort 1|0?" \n
append h " - this is the literal word project - and confirms you want to run the project build - which includes src/vfs/* checks and builds" \n append h " - consumer build from a clean checkout: runs the packages stage (modules + libs) then bakes kit/zipkit executables to <projectdir>/bin" \n
append h " - refuses uncommitted src by default (-dirty-abort defaults ON: the bakehouse bakes from the committed recipe; pass -dirty-abort 0 to override)" \n
append h " - the optional -k flag will terminate running processes matching the executable being built (if applicable)" \n append h " - the optional -k flag will terminate running processes matching the executable being built (if applicable)" \n
append h " - builds/copies .tm modules from src to <projectdir>/modules etc and pkgIndex.tcl based libraries from src to <projectdir>/lib etc." \n \n append h " - does NOT run the promotion gates (bootsupport, vfscommonupdate) - on a clean checkout they are already satisfied by the committed tree" \n \n
append h " $scriptname bake ?-k?" \n
append h " - assemble kit/zipkit executables from the promoted payload (src/vfs) and src/runtime runtimes into <projectdir>/bin" \n
append h " - includes the vfslibs phase; does not rebuild modules/libs and does not run the promotion gates" \n \n
append h " $scriptname modules" \n append h " $scriptname modules" \n
append h " - build (or copy if build not required) .tm modules from src/modules src/vendormodules etc to their corresponding locations under <projectdir>" \n append h " - build (or copy if build not required) .tm modules from src/modules src/vendormodules etc to their corresponding locations under <projectdir>" \n
append h " This does not scan src/runtime and src/vfs folders to build kit/zipkit/cookfs executables" \n \n append h " This does not scan src/runtime and src/vfs folders to build kit/zipkit/cookfs executables" \n \n
@ -1544,10 +1548,10 @@ proc ::punkboot::punkboot_gethelp {args} {
append h " $scriptname vfslibs" \n append h " $scriptname vfslibs" \n
append h " - propagate declared vendored platform-library packages into kit vfs lib_tcl<N> trees" \n append h " - propagate declared vendored platform-library packages into kit vfs lib_tcl<N> trees" \n
append h " - declarations (per-package per-kit, with superseded-version removal) live in src/runtime/vendorlib_vfs.toml" \n append h " - declarations (per-package per-kit, with superseded-version removal) live in src/runtime/vendorlib_vfs.toml" \n
append h " - also runs automatically as part of '$scriptname project'" \n \n append h " - also runs automatically as a phase of '$scriptname bake' (and therefore of '$scriptname bakehouse')" \n \n
append h " $scriptname vfscommonupdate" \n append h " $scriptname vfscommonupdate" \n
append h " - update the src/vfs/_vfscommon.vfs from compiled src/modules and src/lib etc" \n append h " - promotion gate: update the src/vfs/_vfscommon.vfs from compiled src/modules and src/lib etc" \n
append h " - before calling this (followed by make project) - you can test using '<builtexe>(.exe) dev'" \n append h " - before calling this (followed by '$scriptname bake') - you can test using '<builtexe>(.exe) dev'" \n
append h " this will load modules from your <projectdir>/module <projectdir>/lib paths instead of from the kit/zipkit" \n \n append h " this will load modules from your <projectdir>/module <projectdir>/lib paths instead of from the kit/zipkit" \n \n
append h " $scriptname info" \n append h " $scriptname info" \n
append h " - show the name and base folder of the project to be built" \n \n append h " - show the name and base folder of the project to be built" \n \n
@ -1559,16 +1563,23 @@ proc ::punkboot::punkboot_gethelp {args} {
append h " - advisory check: verify CHANGELOG.md matches punkproject.toml and warn if src/ has changes since the last project-version bump." \n \n append h " - advisory check: verify CHANGELOG.md matches punkproject.toml and warn if src/ has changes since the last project-version bump." \n \n
append h " $scriptname workflow" \n append h " $scriptname workflow" \n
append h " - print an ASCII data-flow overview of the build/release workflow (edit -> packages -> bootsupport -> kits)" \n \n append h " - print an ASCII data-flow overview of the build/release workflow (edit -> packages -> bootsupport -> kits)" \n \n
append h " $scriptname buildsuite list|info|build ?<suitename>? ?driver-args ...?" \n
append h " - list the defined buildsuites under src/buildsuites (zig runtime factory), show a suite's configured" \n
append h " detail (sources/zig pin/products from its sources.config), or run its driver forwarding the args" \n \n
append h " $scriptname help ?subcommand?" \n append h " $scriptname help ?subcommand?" \n
append h " - show usage for $scriptname or one of its subcommands (equivalent: $scriptname <subcommand> -help)" \n \n append h " - show usage for $scriptname or one of its subcommands (equivalent: $scriptname <subcommand> -help)" \n \n
append h " Deprecated aliases (transition window):" \n
append h " $scriptname project -> runs bakehouse (with a one-line notice)" \n
append h " $scriptname vfs -> runs bake (with a one-line notice)" \n \n
append h " Flags:" \n append h " Flags:" \n
append h " -confirm 0|1" \n append h " -confirm 0|1" \n
append h " - interactive y/n confirmation policy (default 1: prompt when stdin is a terminal, abort fast when it is not)." \n append h " - interactive y/n confirmation policy (default 1: prompt when stdin is a terminal, abort fast when it is not)." \n
append h " Use -confirm 0 for unattended runs: the bootsupport minor-staleness gate and the vfscommonupdate REPLACE" \n append h " Use -confirm 0 for unattended runs: the bootsupport minor-staleness gate and the vfscommonupdate REPLACE" \n
append h " confirmation proceed without prompting; kits with a source/target kit-type mismatch are skipped." \n append h " confirmation proceed without prompting; kits with a source/target kit-type mismatch are skipped." \n
append h " -dirty-abort" \n append h " -dirty-abort" \n
append h " - abort build/promotion commands (project packages modules libs vfs vfslibs bin bootsupport vfscommonupdate) when src/ has" \n append h " - abort build/promotion commands (bakehouse packages modules libs bake vfslibs bin bootsupport vfscommonupdate) when src/ has" \n
append h " uncommitted VCS changes. Default is warn-only: artifacts built from dirty src have no committed provenance." \n append h " uncommitted VCS changes. Default is warn-only EXCEPT bakehouse (defaults ON there; -dirty-abort 0 overrides):" \n
append h " artifacts built from dirty src have no committed provenance." \n
append h " Warnings carry a plain PROVENANCE-WARNING: prefix (greppable in redirected output) and are recapped at the end of the run." \n append h " Warnings carry a plain PROVENANCE-WARNING: prefix (greppable in redirected output) and are recapped at the end of the run." \n
append h " Use '$scriptname check' to see the current provenance status. To evaluate uncommitted source without building," \n append h " Use '$scriptname check' to see the current provenance status. To evaluate uncommitted source without building," \n
append h " use '<builtexe> src' or '<builtexe> src shell'." \n \n append h " use '<builtexe> src' or '<builtexe> src shell'." \n \n
@ -1592,7 +1603,20 @@ All commands run from the projectroot with a native tclsh, e.g:
tclsh src/make.tcl <subcommand> -confirm 0 (see [K6]) tclsh src/make.tcl <subcommand> -confirm 0 (see [K6])
RELEASE SEQUENCE (the order that satisfies the staleness + provenance gates) TWO PERSONAS (stage-true subcommand model - one build stage, two promotion
gates, one bake)
----------------------------------------------------------------------------
CONSUMER (clean checkout, wants baked kits):
tclsh src/make.tcl bakehouse -confirm 0
= packages + bake in one uninterrupted run. The promotion gates are already
satisfied by the committed tree. bakehouse REFUSES uncommitted src by
default (-dirty-abort defaults ON: the bakehouse bakes from the committed
recipe; -dirty-abort 0 overrides).
DEVELOPER (changing payload): pass the gates explicitly - the commit is the
publishing act, not a build step. That is the RELEASE SEQUENCE below.
Deprecated aliases (transition window): 'project' -> bakehouse, 'vfs' -> bake.
RELEASE SEQUENCE (the developer order that satisfies the staleness + provenance gates)
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
(1) edit src/modules/foo-999999.0a1.0.tm code change [K1] (1) edit src/modules/foo-999999.0a1.0.tm code change [K1]
@ -1603,7 +1627,7 @@ RELEASE SEQUENCE (the order that satisfies the staleness + provenance gates)
(5) build tclsh src/make.tcl modules -confirm 0 (or 'packages' = modules + libs) (5) build tclsh src/make.tcl modules -confirm 0 (or 'packages' = modules + libs)
(6) build tclsh src/make.tcl bootsupport -confirm 0 run twice: 2nd pass must copy 0 files [K4] (6) build tclsh src/make.tcl bootsupport -confirm 0 run twice: 2nd pass must copy 0 files [K4]
(7) build tclsh src/make.tcl vfscommonupdate -confirm 0 (7) build tclsh src/make.tcl vfscommonupdate -confirm 0
(8) build tclsh src/make.tcl project -confirm 0 kits; close running kit shells first [K5] (8) build tclsh src/make.tcl bake -confirm 0 kits; close running kit shells first [K5]
(9) commit tracked build outputs src/bootsupport, thin-layout script/ (9) commit tracked build outputs src/bootsupport, thin-layout script/
manifest copies (src/project_layouts + manifest copies (src/project_layouts +
templates modpod payload), templates modpod payload),
@ -1634,13 +1658,13 @@ DIAGRAM 1 - DATA FLOW: SOURCE -> BUILT PACKAGES -> PROPAGATION TARGETS
(the module set make.tcl itself src/vfs/_vfscommon.vfs/modules/ + libs (the module set make.tcl itself src/vfs/_vfscommon.vfs/modules/ + libs
boots from; staleness-gated. (VCS-tracked kit payload source) boots from; staleness-gated. (VCS-tracked kit payload source)
Project layouts store NO module | Project layouts store NO module |
snapshots - 'dev project.new' | make.tcl project (or: make.tcl vfs) snapshots - 'dev project.new' | make.tcl bake (kit-assembly stage;
injects bootsupport into generated v injects bootsupport into generated v consumer umbrella: bakehouse)
projects from the generating src/_build/<kit>.exe --deploy--> bin/<kit>.exe projects from the generating src/_build/<kit>.exe --deploy--> bin/<kit>.exe
shell at generation time - G-087) (see DIAGRAM 2) [K5] shell at generation time - G-087) (see DIAGRAM 2) [K5]
DIAGRAM 1b - THIN-LAYOUT SYNC (part of modules/libs/packages/project runs) DIAGRAM 1b - THIN-LAYOUT SYNC (part of modules/libs/packages/bakehouse runs)
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
src/make.tcl src/build.tcl src/bootsupport/modules*/include_modules.config src/make.tcl src/build.tcl src/bootsupport/modules*/include_modules.config
@ -1656,7 +1680,7 @@ DIAGRAM 1b - THIN-LAYOUT SYNC (part of modules/libs/packages/project runs)
kit outside any project can list and generate the punk.project layout) kit outside any project can list and generate the punk.project layout)
DIAGRAM 2 - KIT ASSEMBLY DETAIL (inside 'make.tcl project' / 'make.tcl vfs') DIAGRAM 2 - KIT ASSEMBLY DETAIL (the 'make.tcl bake' stage; incl. vfslibs phase)
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
src/runtime/mapvfs.config which vfs folder pairs with which runtime -> kit name src/runtime/mapvfs.config which vfs folder pairs with which runtime -> kit name
@ -1707,7 +1731,7 @@ KEY / NOTES
a pass copies 0 files (a converged second pass also proves prune tooling ran). a pass copies 0 files (a converged second pass also proves prune tooling ran).
[K5] The deploy step cannot replace a kit exe that is currently executing. Close [K5] The deploy step cannot replace a kit exe that is currently executing. Close
running kit shells before step 8, or rerun 'make.tcl vfs -confirm 0' running kit shells before step 8, or rerun 'make.tcl bake -confirm 0'
afterwards - the freshly built kits wait in src/_build. punkcheck records afterwards - the freshly built kits wait in src/_build. punkcheck records
mean the rerun only redoes the failed deploys. mean the rerun only redoes the failed deploys.
@ -1719,7 +1743,7 @@ KEY / NOTES
- src/tests/runtests.tcl exercises the src/ trees directly (dev modules). - src/tests/runtests.tcl exercises the src/ trees directly (dev modules).
- '<builtkit>.exe dev' (or '<builtkit> src') runs a built shell against the - '<builtkit>.exe dev' (or '<builtkit> src') runs a built shell against the
project dev modules - useful for testing built packages before they are project dev modules - useful for testing built packages before they are
baked into kits via vfscommonupdate + project. baked into kits via vfscommonupdate + bake.
[K8] What is VCS-tracked where (checkin targets after a build): [K8] What is VCS-tracked where (checkin targets after a build):
tracked: src/** (sources, src/bootsupport, src/project_layouts copies, tracked: src/** (sources, src/bootsupport, src/project_layouts copies,
@ -1821,22 +1845,25 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
#single source for the subcommand one-line summaries: each subcommand definition's #single source for the subcommand one-line summaries: each subcommand definition's
#@cmd -summary and the top-level subcommand -choicelabels are both built from this. #@cmd -summary and the top-level subcommand -choicelabels are both built from this.
variable SUMMARIES { variable SUMMARIES {
project "Full project build - packages plus kit/zipkit executables from src/vfs and src/runtime" bakehouse "Consumer build from a clean checkout: packages then bake - refuses uncommitted src by default"
packages "Build .tm modules and pkgIndex.tcl libraries from src into <projectdir> (no kit executables)" packages "Build .tm modules and pkgIndex.tcl libraries from src into <projectdir> (no kit executables)"
modules "Build .tm modules from src/modules, src/vendormodules etc into <projectdir>/modules etc" modules "Build .tm modules from src/modules, src/vendormodules etc into <projectdir>/modules etc"
libs "Build pkgIndex.tcl libraries from src/lib, src/vendorlib etc into <projectdir>/lib etc" libs "Build pkgIndex.tcl libraries from src/lib, src/vendorlib etc into <projectdir>/lib etc"
vfs "Build kit/zipkit executables from src/vfs and src/runtime into <projectdir>/bin" bake "Assemble kit/zipkit executables from promoted payload (src/vfs) and runtimes into <projectdir>/bin"
vfslibs "Propagate declared vendored platform-library packages into kit vfs lib_tcl<N> trees" vfslibs "Propagate declared vendored platform-library packages into kit vfs lib_tcl<N> trees"
bin "Install executables from src/bin into <projectdir>/bin, then build kits as for vfs" bin "Install executables from src/bin into <projectdir>/bin, then build kits as for bake"
vendorupdate "Update src/vendormodules based on src/vendormodules/include_modules.config" vendorupdate "Update src/vendormodules based on src/vendormodules/include_modules.config"
bootsupport "Update src/bootsupport modules from built project modules" bootsupport "Promotion gate: update src/bootsupport modules from built project modules"
vfscommonupdate "Replace src/vfs/_vfscommon.vfs modules and libs with the project's built modules and libs" vfscommonupdate "Promotion gate: replace src/vfs/_vfscommon.vfs modules and libs with the project's built set"
info "Show the name and base folder of the project to be built" info "Show the name and base folder of the project to be built"
check "Show module/library paths and any potentially problematic packages for running this script" check "Show module/library paths and any potentially problematic packages for running this script"
projectversion "Advisory check: CHANGELOG.md vs punkproject.toml and src/ changes since last version bump" projectversion "Advisory check: CHANGELOG.md vs punkproject.toml and src/ changes since last version bump"
workflow "Print an ASCII data-flow overview of the build/release workflow (edit -> packages -> bootsupport -> kits)" workflow "Print an ASCII data-flow overview of the build/release workflow (edit -> packages -> gates -> bake)"
shell "Run the punk shell using bootsupport libraries" shell "Run the punk shell using bootsupport libraries"
help "Show usage for make.tcl or one of its subcommands" help "Show usage for make.tcl or one of its subcommands"
buildsuite "List, describe or run the defined buildsuites under src/buildsuites (zig runtime factory)"
project "DEPRECATED alias for bakehouse (one-line notice, then runs bakehouse)"
vfs "DEPRECATED alias for bake (one-line notice, then runs bake)"
} }
#@cmd -help bodies for the constructed definitions below. Authored BLOCK-FORM #@cmd -help bodies for the constructed definitions below. Authored BLOCK-FORM
#(first value line whitespace-only) so the @normalize directive in each #(first value line whitespace-only) so the @normalize directive in each
@ -1845,14 +1872,20 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
#normalization (head-form values here would leak this file's indentation into #normalization (head-form values here would leak this file's indentation into
#the rendered Description column). #the rendered Description column).
variable HELPTEXTS { variable HELPTEXTS {
project bakehouse
" "
Run the full project build - includes src/vfs/* checks and builds. Consumer umbrella: run the packages stage (modules + libs) then bake
Builds/copies .tm modules and pkgIndex.tcl based libraries from src to the kit/zipkit executables - the full path from a CLEAN checkout to
<projectdir>/modules, <projectdir>/lib etc, propagates declared vendored installed kits in <projectdir>/bin.
platform-libraries into kit vfs trees (as for vfslibs), then scans The bakehouse bakes from the committed recipe: by default it refuses
src/runtime and src/vfs folders to build kit/zipkit executables and to run when src/ has uncommitted changes (-dirty-abort defaults ON),
installs them to <projectdir>/bin." pointing at the granular developer flow (packages -> test ->
bootsupport/vfscommonupdate -> commit -> bake). Pass -dirty-abort 0
to build anyway with PROVENANCE-WARNINGs.
Deliberately does NOT run the promotion gates (bootsupport,
vfscommonupdate): payload promotion is a confirm-gated, committed
act - on a clean checkout the gates are already satisfied by the
committed tree."
packages packages
" "
Build (or copy if build not required) both .tm and pkgIndex.tcl based Build (or copy if build not required) both .tm and pkgIndex.tcl based
@ -1872,23 +1905,32 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
<projectdir>. <projectdir>.
This does not scan src/runtime and src/vfs folders to build kit/zipkit This does not scan src/runtime and src/vfs folders to build kit/zipkit
executables." executables."
vfs bake
" "
Scan src/vfs and src/runtime folders and build kit/zipkit executables Assemble kit/zipkit executables: scan src/vfs and src/runtime folders,
into <projectdir>/bin. build each configured kit from the promoted payload
Does not first rebuild modules/libs - use 'make.tcl project' for the (src/vfs/_vfscommon.vfs + custom vfs folders) and its runtime, and
full pipeline." install to <projectdir>/bin.
Includes the vfslibs phase (declared vendored platform-library
propagation into kit vfs lib_tcl<N> trees) so a bake cannot ship
stale binary libs.
Does not rebuild modules/libs and does not run the promotion gates -
built modules reach the kit payload only via 'make.tcl
vfscommonupdate' (committed for provenance). Consumer full path from
a clean checkout: 'make.tcl bakehouse'."
vfslibs vfslibs
" "
Propagate declared vendored platform-library packages into kit vfs Propagate declared vendored platform-library packages into kit vfs
lib_tcl<N> trees. lib_tcl<N> trees.
Declarations (per-package per-kit, with superseded-version removal) Declarations (per-package per-kit, with superseded-version removal)
live in src/runtime/vendorlib_vfs.toml. live in src/runtime/vendorlib_vfs.toml.
Also runs automatically as part of 'make.tcl project'." Also runs automatically as a phase of 'make.tcl bake' (and therefore
of 'make.tcl bakehouse'); this standalone narrowing serves quick
iteration on the declarations."
bin bin
" "
Install executables from src/bin to <projectdir>/bin, then check vfs Install executables from src/bin to <projectdir>/bin, then check vfs
folders and build kit/zipkit executables as for the vfs subcommand." folders and build kit/zipkit executables as for the bake subcommand."
vendorupdate vendorupdate
" "
Update the src/vendormodules based on src/vendormodules/include_modules.config. Update the src/vendormodules based on src/vendormodules/include_modules.config.
@ -1907,7 +1949,7 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
vfscommonupdate vfscommonupdate
" "
Update the src/vfs/_vfscommon.vfs from compiled src/modules and src/lib etc. Update the src/vfs/_vfscommon.vfs from compiled src/modules and src/lib etc.
Before calling this (followed by 'make.tcl project') - you can test using Before calling this (followed by 'make.tcl bake') - you can test using
'<builtexe>(.exe) dev' - this will load modules from your <projectdir>/modules, '<builtexe>(.exe) dev' - this will load modules from your <projectdir>/modules,
<projectdir>/lib paths instead of from the kit/zipkit. <projectdir>/lib paths instead of from the kit/zipkit.
Replacing the _vfscommon.vfs contents requires confirmation - see -confirm." Replacing the _vfscommon.vfs contents requires confirmation - see -confirm."
@ -1933,6 +1975,41 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
The text is embedded in make.tcl (::punkboot::workflow_text) so it is The text is embedded in make.tcl (::punkboot::workflow_text) so it is
available wherever make.tcl runs; its MAINTENANCE key states the available wherever make.tcl runs; its MAINTENANCE key states the
update contract for keeping it in step with build behaviour." update contract for keeping it in step with build behaviour."
buildsuite
"
Surface for the defined buildsuites under src/buildsuites (zig-built
runtime factory - an arm's-length subsystem building Tcl runtimes
from external sources, distinct from the project build/bake stages).
Actions:
buildsuite list
Discover the suites (directories carrying a suite.tcl driver;
_build excluded) with their one-line descriptions.
buildsuite info <name>
Show the suite's configured detail: description, source records
(name/kind/url/ref/dir from sources.config), pinned zig and its
resolution, products, doc pointers.
buildsuite build <name> ?driver-args ...?
Run the suite's driver ('suite.tcl build' with the given args
forwarded untouched, e.g -tclbranch/-refresh/-steps), streaming
its output and exiting with the driver's status.
Suites are SELF-describing: list/info read each suite's
sources.config records (description/product/doc/zigpin - the same
manifest the suite.tcl driver parses), so a copied/retargeted tree
(copy-and-tweak workflow) appears here automatically with no
make.tcl edits. The contract is documented in
src/buildsuites/README.md."
project
"
DEPRECATED alias for 'bakehouse' (G-112 stage-true rename) - prints a
one-line notice and runs bakehouse (packages + bake, -dirty-abort
default ON). Retained for a transition window."
vfs
"
DEPRECATED alias for 'bake' (G-112 stage-true rename) - prints a
one-line notice and runs bake (kit assembly including the vfslibs
phase). Retained for a transition window."
} }
#shared option fragments composed into the per-subcommand definitions below #shared option fragments composed into the per-subcommand definitions below
variable OPT_CONFIRM { variable OPT_CONFIRM {
@ -1966,15 +2043,26 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
"Terminate running processes matching the executable being built "Terminate running processes matching the executable being built
(if applicable) so the build can install over it." (if applicable) so the build can install over it."
} }
#bakehouse (and its deprecated alias project) defaults the dirty gate ON:
#the bakehouse bakes from the committed recipe (G-112 two-persona model).
variable OPT_DIRTYABORT_ON {
-dirty-abort -type boolean -default 1 -help\
"Abort when src/ has uncommitted VCS changes - DEFAULT ON for this
subcommand: the bakehouse bakes from the committed recipe. A
consumer build on a clean checkout runs uninterrupted; uncommitted
developer changes get a refusal naming the granular flow
(packages -> test -> bootsupport/vfscommonupdate -> commit -> bake).
Pass -dirty-abort 0 to build anyway with PROVENANCE-WARNINGs."
}
#which shared option fragments each subcommand declares #which shared option fragments each subcommand declares
#(shell and help have bespoke definitions below: shell passes trailing args #(shell and help have bespoke definitions below: shell passes trailing args
# through to the repl untouched, help takes a subject value) # through to the repl untouched, help takes a subject value)
variable SUBOPTS { variable SUBOPTS {
project {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM} bakehouse {OPT_FORCEKILL OPT_DIRTYABORT_ON OPT_CONFIRM}
packages {OPT_DIRTYABORT OPT_CONFIRM} packages {OPT_DIRTYABORT OPT_CONFIRM}
modules {OPT_DIRTYABORT OPT_CONFIRM} modules {OPT_DIRTYABORT OPT_CONFIRM}
libs {OPT_DIRTYABORT OPT_CONFIRM} libs {OPT_DIRTYABORT OPT_CONFIRM}
vfs {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM} bake {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM}
vfslibs {OPT_DIRTYABORT OPT_CONFIRM} vfslibs {OPT_DIRTYABORT OPT_CONFIRM}
bin {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM} bin {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM}
vendorupdate {OPT_CONFIRM} vendorupdate {OPT_CONFIRM}
@ -1984,14 +2072,17 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
check {} check {}
projectversion {} projectversion {}
workflow {} workflow {}
project {OPT_FORCEKILL OPT_DIRTYABORT_ON OPT_CONFIRM}
vfs {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM}
} }
#synopsis fragments matching the shared option fragments (explicit @form -synopsis #synopsis fragments matching the shared option fragments (explicit @form -synopsis
#so usage shows the real invocation 'make.tcl <subcommand> ...' rather than the #so usage shows the real invocation 'make.tcl <subcommand> ...' rather than the
#internal definition id) #internal definition id)
variable OPT_SYNOPSES { variable OPT_SYNOPSES {
OPT_FORCEKILL "?-k?" OPT_FORCEKILL "?-k?"
OPT_DIRTYABORT "?-dirty-abort?" OPT_DIRTYABORT "?-dirty-abort?"
OPT_CONFIRM "?-confirm 0|1?" OPT_DIRTYABORT_ON "?-dirty-abort 1|0?"
OPT_CONFIRM "?-confirm 0|1?"
} }
foreach {sub optvars} $SUBOPTS { foreach {sub optvars} $SUBOPTS {
set synparts [list "make.tcl $sub"] set synparts [list "make.tcl $sub"]
@ -2022,6 +2113,15 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
{@values -min 0 -max -1 {@values -min 0 -max -1
arg -type any -optional 1 -multiple 1 -help\ arg -type any -optional 1 -multiple 1 -help\
"Arguments passed through to the punk repl."} "Arguments passed through to the punk repl."}
punk::args::define\
"@id -id (script)::punkboot::buildsuite"\
"@normalize"\
"@cmd -name [list "make.tcl buildsuite"] -summary [list [dict get $SUMMARIES buildsuite]] -help [list [dict get $HELPTEXTS buildsuite]]"\
{@form -synopsis "make.tcl buildsuite list|info|build ?<suitename>? ?driver-args ...?"}\
{@values -min 0 -max -1
arg -type any -optional 1 -multiple 1 -help\
"Action (list|info|build), suite name, and - for build - driver
arguments forwarded to the suite's suite.tcl untouched."}
punk::args::define\ punk::args::define\
"@id -id (script)::punkboot::help"\ "@id -id (script)::punkboot::help"\
"@normalize"\ "@normalize"\
@ -2034,10 +2134,13 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
"subject -type string -optional 0 -choices [list [dict keys $SUMMARIES]] -help {Subcommand to show usage for.}" "subject -type string -optional 0 -choices [list [dict keys $SUMMARIES]] -help {Subcommand to show usage for.}"
#top-level definition: the subcommand table rendered by 'make.tcl' / 'make.tcl -help' #top-level definition: the subcommand table rendered by 'make.tcl' / 'make.tcl -help'
variable SUBGROUPS { variable SUBGROUPS {
"build & promotion" {project packages modules libs vfs vfslibs bin} "build & bake" {bakehouse packages modules libs bake vfslibs bin}
"source maintenance" {vendorupdate bootsupport vfscommonupdate} "promotion gates" {bootsupport vfscommonupdate}
"source maintenance" {vendorupdate}
"buildsuites" {buildsuite}
"informational" {info check projectversion workflow help} "informational" {info check projectversion workflow help}
"interactive" {shell} "interactive" {shell}
"deprecated aliases" {project vfs}
} }
punk::args::define\ punk::args::define\
"@id -id (script)::punkboot"\ "@id -id (script)::punkboot"\
@ -2062,7 +2165,7 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
#resolve a mechanism used here (e.g pre-@normalize snapshots) degrades to the #resolve a mechanism used here (e.g pre-@normalize snapshots) degrades to the
#plain fallback immediately instead of erroring at first parse/usage. #plain fallback immediately instead of erroring at first parse/usage.
punk::args::get_spec (script)::punkboot punk::args::get_spec (script)::punkboot
punk::args::get_spec (script)::punkboot::project punk::args::get_spec (script)::punkboot::bakehouse
punk::args::get_spec (script)::punkboot::help punk::args::get_spec (script)::punkboot::help
punk::args::get_spec (script)::punkboot::shell punk::args::get_spec (script)::punkboot::shell
unset -nocomplain sub optvars defparts ov unset -nocomplain sub optvars defparts ov
@ -2120,6 +2223,11 @@ if {$::punkboot::punkargs_ok} {
} elseif {$subcommand eq "shell"} { } elseif {$subcommand eq "shell"} {
#declared passthrough: everything after 'shell' goes to the repl unparsed #declared passthrough: everything after 'shell' goes to the repl unparsed
set ::punkboot::command shell set ::punkboot::command shell
} elseif {$subcommand eq "buildsuite"} {
#declared passthrough: the handler parses action/name itself; driver
#args (arbitrary suite flags) are forwarded untouched (G-104)
set ::punkboot::command buildsuite
set ::punkboot::bs_args $subargs
} else { } else {
if {[catch {punk::args::parse $subargs -errorstyle $::punkboot::errstyle withid (script)::punkboot::$subcommand} argd]} { if {[catch {punk::args::parse $subargs -errorstyle $::punkboot::errstyle withid (script)::punkboot::$subcommand} argd]} {
puts stderr $argd puts stderr $argd
@ -2140,6 +2248,13 @@ if {$::punkboot::punkargs_ok} {
#unavailable). Keeps check/bootsupport/modules and the -k/-dirty-abort/-confirm flags working. #unavailable). Keeps check/bootsupport/modules and the -k/-dirty-abort/-confirm flags working.
set commands_found [list] set commands_found [list]
set argsleft $scriptargs set argsleft $scriptargs
if {[lindex $scriptargs 0] eq "buildsuite"} {
#declared passthrough (as in the punk::args path): driver args carry
#arbitrary suite flags the fallback flag scan must not consume (G-104)
set commands_found [list buildsuite]
set argsleft [list]
set ::punkboot::bs_args [lrange $scriptargs 1 end]
}
while {[llength $argsleft]} { while {[llength $argsleft]} {
set a [lindex $argsleft 0] set a [lindex $argsleft 0]
set argsleft [lrange $argsleft 1 end] set argsleft [lrange $argsleft 1 end]
@ -2219,6 +2334,30 @@ if {$do_help} {
exit $help_exitcode exit $help_exitcode
} }
#G-112 deprecated aliases - one-line mapping before any dispatch:
# project -> bakehouse (packages + bake, -dirty-abort default ON)
# vfs -> bake (kit assembly including the vfslibs phase)
#Kept for a transition window (until the 8.6 arc completes - see the G-112
#dispositions). The alias definitions above mirror their targets' options so
#flags parse identically; only the command word maps here.
if {[info exists ::punkboot::command]} {
switch -- $::punkboot::command {
project {
puts stderr "make.tcl: 'project' is DEPRECATED - use 'bakehouse' (packages + bake; refuses uncommitted src by default). Running bakehouse."
set ::punkboot::command bakehouse
}
vfs {
puts stderr "make.tcl: 'vfs' is DEPRECATED - use 'bake' (kit assembly incl. the vfslibs phase). Running bake."
set ::punkboot::command bake
}
}
if {!$::punkboot::punkargs_ok && $::punkboot::command eq "bakehouse"} {
#degraded fallback scan has flag-only -dirty-abort (no way to pass 0):
#bakehouse's documented default is ON, so force it here.
set ::punkboot::opt_dirty_abort 1
}
}
set forcekill $::punkboot::opt_forcekill set forcekill $::punkboot::opt_forcekill
#puts stdout "::argv $::argv" #puts stdout "::argv $::argv"
# ---------------------------------------- # ----------------------------------------
@ -2231,7 +2370,7 @@ set forcekill $::punkboot::opt_forcekill
# - patch bump -> warn and proceed (non-breaking) # - patch bump -> warn and proceed (non-breaking)
# 'check' is exempt in all cases the warning is shown at the end of its output instead. # 'check' is exempt in all cases the warning is shown at the end of its output instead.
# 'projectversion' and 'workflow' are informational/read-only and are likewise exempt. # 'projectversion' and 'workflow' are informational/read-only and are likewise exempt.
if {[info exists ::punkboot::stale_bootsupport] && $::punkboot::command ni {check projectversion workflow}} { if {[info exists ::punkboot::stale_bootsupport] && $::punkboot::command ni {check projectversion workflow buildsuite}} {
set _stale $::punkboot::stale_bootsupport set _stale $::punkboot::stale_bootsupport
set _have_major 0 set _have_major 0
set _have_minor 0 set _have_minor 0
@ -2383,7 +2522,7 @@ if {![llength [info commands ::punkboot::exit_original]]} {
} }
} }
if {$::punkboot::command in {project packages modules libs vfs vfslibs bin bootsupport vfscommonupdate}} { if {$::punkboot::command in {bakehouse packages modules libs bake vfslibs bin bootsupport vfscommonupdate}} {
set dirty_abort $::punkboot::opt_dirty_abort set dirty_abort $::punkboot::opt_dirty_abort
lassign [::punkboot::get_src_provenance_warnings $projectroot "make.tcl $::punkboot::command"] have_scoped_dirty_check dirty_warnings lassign [::punkboot::get_src_provenance_warnings $projectroot "make.tcl $::punkboot::command"] have_scoped_dirty_check dirty_warnings
if {$have_scoped_dirty_check} { if {$have_scoped_dirty_check} {
@ -2392,7 +2531,16 @@ if {$::punkboot::command in {project packages modules libs vfs vfslibs bin boots
puts stderr " To evaluate uncommitted source without building, use '<builtexe> src' or '<builtexe> src shell'." puts stderr " To evaluate uncommitted source without building, use '<builtexe> src' or '<builtexe> src shell'."
if {$dirty_abort} { if {$dirty_abort} {
set ::punkboot::provenance_warnings_pending [list] ;#no recap needed - aborting adjacent to the warning set ::punkboot::provenance_warnings_pending [list] ;#no recap needed - aborting adjacent to the warning
puts stderr "-aborted- (-dirty-abort given and src has uncommitted changes - commit first, or rerun without -dirty-abort to build with a warning)" if {$::punkboot::command eq "bakehouse"} {
puts stderr "-aborted- bakehouse refuses to bake from uncommitted src (the bakehouse bakes from the committed recipe)."
puts stderr " Developer flow for uncommitted changes:"
puts stderr " make.tcl packages -> test ('<builtexe> src', src/tests/runtests.tcl)"
puts stderr " make.tcl bootsupport + make.tcl vfscommonupdate (promotion gates)"
puts stderr " commit -> make.tcl bake"
puts stderr " To build anyway without committed provenance: make.tcl bakehouse -dirty-abort 0"
} else {
puts stderr "-aborted- (-dirty-abort given and src has uncommitted changes - commit first, or rerun without -dirty-abort to build with a warning)"
}
exit 1 exit 1
} }
#Grace period for an attentive human to ctrl-c - only when stdin is a terminal #Grace period for an attentive human to ctrl-c - only when stdin is a terminal
@ -2770,6 +2918,160 @@ if {$::punkboot::command eq "workflow"} {
exit 0 exit 0
} }
if {$::punkboot::command eq "buildsuite"} {
#G-104: thin front for the buildsuites (zig runtime factory - arm's-length
#subsystem building Tcl runtimes from external sources). Discovery is a
#directory scan; description/info come from each suite's sources.config
#records (description/product/doc/zigpin - the same manifest the suite.tcl
#driver parses), so copied/retargeted trees are first-class with no edits
#here. Contract: src/buildsuites/README.md.
set bs_root [file join $sourcefolder buildsuites]
if {![info exists ::punkboot::bs_args]} {set ::punkboot::bs_args [list]}
set bsargs $::punkboot::bs_args
set bs_action [lindex $bsargs 0]
if {$bs_action eq ""} {set bs_action list}
#tolerant manifest reader (make.tcl side): a suite with a malformed or absent
#sources.config still lists - with the problem as its description - rather
#than breaking discovery of the others. suite.tcl's own parser stays strict.
proc ::punkboot::buildsuite_manifest {suitedir} {
set m [dict create description "" products [list] docs [list] zigpin "" sources [list] note ""]
set cfg [file join $suitedir sources.config]
if {![file exists $cfg]} {
dict set m note "(no sources.config manifest)"
return $m
}
if {[catch {
set f [open $cfg r]; set data [read $f]; close $f
foreach line [split $data \n] {
set line [string trim $line]
if {$line eq "" || [string index $line 0] eq "#"} {continue}
if {[catch {llength $line}]} {continue}
switch -- [lindex $line 0] {
source {dict lappend m sources [lrange $line 1 end]}
description {dict set m description [join [lrange $line 1 end] " "]}
product {dict lappend m products [join [lrange $line 1 end] " "]}
doc {dict lappend m docs [lindex $line 1]}
zigpin {dict set m zigpin [lindex $line 1]}
}
}
} cfgerr]} {
dict set m note "(sources.config unreadable: $cfgerr)"
}
return $m
}
proc ::punkboot::buildsuite_dirs {bs_root} {
set dirs [list]
foreach dir [lsort [glob -nocomplain -dir $bs_root -type d *]] {
if {[file tail $dir] eq "_build"} {continue}
if {![file exists [file join $dir suite.tcl]]} {continue} ;#not a suite (no driver)
lappend dirs $dir
}
return $dirs
}
switch -- $bs_action {
list {
set suitedirs [::punkboot::buildsuite_dirs $bs_root]
if {![llength $suitedirs]} {
puts stdout "no buildsuites found under $bs_root (a suite = a directory carrying a suite.tcl driver)"
exit 0
}
puts stdout "buildsuites under $bs_root:"
foreach dir $suitedirs {
set m [::punkboot::buildsuite_manifest $dir]
set desc [dict get $m description]
if {$desc eq ""} {set desc [dict get $m note]}
if {$desc eq ""} {set desc "(no description record in sources.config)"}
puts stdout [format " %-16s %s" [file tail $dir] $desc]
}
puts stdout ""
puts stdout " - 'make.tcl buildsuite info <name>' shows a suite's configured detail"
puts stdout " - 'make.tcl buildsuite build <name> ?driver-args ...?' runs its driver"
exit 0
}
info {
set bs_name [lindex $bsargs 1]
if {$bs_name eq ""} {
puts stderr "usage: make.tcl buildsuite info <suitename> ('make.tcl buildsuite list' shows the names)"
exit 2
}
set dir [file join $bs_root $bs_name]
if {![file isdirectory $dir] || ![file exists [file join $dir suite.tcl]]} {
puts stderr "buildsuite '$bs_name' not found (no [file join $dir suite.tcl]) - 'make.tcl buildsuite list' shows the suites"
exit 2
}
set m [::punkboot::buildsuite_manifest $dir]
puts stdout "buildsuite: $bs_name"
puts stdout " path: $dir"
if {[dict get $m note] ne ""} {puts stdout " note: [dict get $m note]"}
if {[dict get $m description] ne ""} {puts stdout " description: [dict get $m description]"}
if {[llength [dict get $m sources]]} {
puts stdout " sources (sources.config - the live dev-flow refs; the 'zig build' flow pins per-checkin via build.zig.zon):"
puts stdout [format " %-10s %-7s %-40s %-16s %s" name kind url ref dir]
foreach s [dict get $m sources] {
lassign $s sname skind surl sref sdir
puts stdout [format " %-10s %-7s %-40s %-16s %s" $sname $skind $surl $sref $sdir]
}
}
set zigpin [dict get $m zigpin]
if {$zigpin ne ""} {
set pinpath [file normalize [file join $projectroot $zigpin]]
set pinstate [expr {[file exists $pinpath] ? "present" : "NOT PRESENT (bin/punk-getzig.cmd can fetch it)"}]
puts stdout " zig pin: $zigpin ($pinstate)"
} else {
puts stdout " zig pin: (no zigpin record in sources.config)"
}
if {[info exists ::env(PUNK_ZIG)]} {
puts stdout " zig via env: PUNK_ZIG=$::env(PUNK_ZIG) (overrides the pin for driver runs)"
}
foreach p [dict get $m products] {
puts stdout " product: $p"
}
foreach d [dict get $m docs] {
puts stdout " doc: [file join $dir $d]"
}
exit 0
}
build {
set bs_name [lindex $bsargs 1]
if {$bs_name eq ""} {
puts stderr "usage: make.tcl buildsuite build <suitename> ?driver-args ...?"
exit 2
}
set dir [file join $bs_root $bs_name]
set driver [file join $dir suite.tcl]
if {![file exists $driver]} {
puts stderr "buildsuite '$bs_name' not found (no $driver) - 'make.tcl buildsuite list' shows the suites"
exit 2
}
set fwdargs [lrange $bsargs 2 end]
#interpreter for the driver: this tclsh - or, punk-exe-hosted (the
#G-058 static-capture marker identifies a kit boot), the kit's
#'script' subcommand so the driver runs with plain script semantics
set launcher [list [info nameofexecutable]]
if {[info exists ::punkboot::static_packages]} {
set launcher [list [info nameofexecutable] script]
}
puts stdout "buildsuite build $bs_name: running '$driver build' with forwarded args: $fwdargs"
flush stdout
#stream driver output; exit with the driver's status
if {[catch {exec {*}$launcher $driver build {*}$fwdargs >@stdout 2>@stderr} execerr execopts]} {
set ecode [dict get $execopts -errorcode]
if {[lindex $ecode 0] eq "CHILDSTATUS"} {
exit [lindex $ecode 2]
}
puts stderr "buildsuite build $bs_name: failed to run the driver: $execerr"
exit 1
}
exit 0
}
default {
puts stderr "unknown buildsuite action '$bs_action' - expected list|info|build"
puts stderr "usage: make.tcl buildsuite list|info|build ?<suitename>? ?driver-args ...?"
exit 2
}
}
}
if {$::punkboot::command eq "shell"} { if {$::punkboot::command eq "shell"} {
#G-113: the ansistrip transform serves make.tcl's own output only - the repl's #G-113: the ansistrip transform serves make.tcl's own output only - the repl's
#colour behaviour is the shell's own concern (colour on/off + NO_COLOR there). #colour behaviour is the shell's own concern (colour on/off + NO_COLOR there).
@ -3175,7 +3477,7 @@ if {$::punkboot::command eq "bootsupport"} {
#Project layouts store no bootsupport module snapshots - 'dev project.new' injects bootsupport #Project layouts store no bootsupport module snapshots - 'dev project.new' injects bootsupport
#into generated projects from the generating shell at generation time. Layout-carried scripts #into generated projects from the generating shell at generation time. Layout-carried scripts
#and bootsupport manifests are kept current by the thin-layout sync step (see DIAGRAM 1b in #and bootsupport manifests are kept current by the thin-layout sync step (see DIAGRAM 1b in
#::punkboot::workflow_text), which runs during modules/libs/packages/project builds. #::punkboot::workflow_text), which runs during modules/libs/packages/bakehouse builds.
puts stdout " bootsupport done " puts stdout " bootsupport done "
flush stderr flush stderr
@ -3187,7 +3489,7 @@ if {$::punkboot::command eq "bootsupport"} {
if {$::punkboot::command ni {project modules libs packages vfs vfslibs bin}} { if {$::punkboot::command ni {bakehouse packages modules libs bake vfslibs bin}} {
puts stderr "Command $::punkboot::command not implemented - aborting." puts stderr "Command $::punkboot::command not implemented - aborting."
flush stderr flush stderr
after 100 after 100
@ -3200,7 +3502,7 @@ if {$::punkboot::command ni {project modules libs packages vfs vfslibs bin}} {
#install src vendor contents (from version controlled src folder) to base of project (same target folders as our own src/modules etc ie to paths that go on the auto_path and in tcl::tm::list) #install src vendor contents (from version controlled src folder) to base of project (same target folders as our own src/modules etc ie to paths that go on the auto_path and in tcl::tm::list)
if {$::punkboot::command in {project packages modules}} { if {$::punkboot::command in {bakehouse packages modules}} {
set vendormodulefolders [glob -nocomplain -dir $sourcefolder -type d -tails vendormodules vendormodules_tcl*] set vendormodulefolders [glob -nocomplain -dir $sourcefolder -type d -tails vendormodules vendormodules_tcl*]
foreach vf $vendormodulefolders { foreach vf $vendormodulefolders {
lassign [split $vf _] _vm tclx lassign [split $vf _] _vm tclx
@ -3240,7 +3542,7 @@ if {$::punkboot::command in {project packages modules}} {
} }
} }
if {$::punkboot::command in {project packages libs}} { if {$::punkboot::command in {bakehouse packages libs}} {
#exclude README.md from source folder - but only the root one #exclude README.md from source folder - but only the root one
#-exclude-paths takes relative patterns e.g #-exclude-paths takes relative patterns e.g
# */test.txt will only match test.txt exactly one level deep. # */test.txt will only match test.txt exactly one level deep.
@ -3309,7 +3611,7 @@ if {$::punkboot::command in {project packages libs}} {
} }
} }
if {$::punkboot::command in {project vfslibs}} { if {$::punkboot::command in {bakehouse bake vfslibs}} {
#G-037: propagate declared vendored platform-library packages into kit vfs lib_tcl<N> trees. #G-037: propagate declared vendored platform-library packages into kit vfs lib_tcl<N> trees.
#Participation is per-package per-kit (kit vfs package sets intentionally differ - e.g. twapi #Participation is per-package per-kit (kit vfs package sets intentionally differ - e.g. twapi
#versions vary per kit) - declared in src/runtime/vendorlib_vfs.toml, never blanket-copied. #versions vary per kit) - declared in src/runtime/vendorlib_vfs.toml, never blanket-copied.
@ -3400,7 +3702,7 @@ if {$::punkboot::command in {project vfslibs}} {
} }
} }
if {$::punkboot::command in {project packages libs}} { if {$::punkboot::command in {bakehouse packages libs}} {
######################################################## ########################################################
lappend projectlibfolders lib lappend projectlibfolders lib
#exclude README.md from source folder - but only the root one #exclude README.md from source folder - but only the root one
@ -3473,7 +3775,7 @@ if {$::punkboot::command in {project packages libs}} {
} }
if {$::punkboot::command in {project packages modules libs}} { if {$::punkboot::command in {bakehouse packages modules libs}} {
######################################################## ########################################################
#templates - thin-layout sync (G-087 stage 3; see DIAGRAM 1b in ::punkboot::workflow_text) #templates - thin-layout sync (G-087 stage 3; see DIAGRAM 1b in ::punkboot::workflow_text)
#sync boot scripts (build.tcl, make.tcl) and bootsupport include_modules.config manifests into the #sync boot scripts (build.tcl, make.tcl) and bootsupport include_modules.config manifests into the
@ -3584,7 +3886,7 @@ if {$::punkboot::command in {project packages modules libs}} {
} }
} }
if {$::punkboot::command in {project packages modules}} { if {$::punkboot::command in {bakehouse packages modules}} {
#consolidated /modules /modules_tclX folder used for target where X is tcl major version #consolidated /modules /modules_tclX folder used for target where X is tcl major version
#the make process will process for any _tclX not just the major version of the current interpreter #the make process will process for any _tclX not just the major version of the current interpreter
@ -3623,7 +3925,7 @@ if {$::punkboot::command in {project packages modules}} {
} }
} }
if {$::punkboot::command in {project packages modules libs}} { if {$::punkboot::command in {bakehouse packages modules libs}} {
set installername "make.tcl" set installername "make.tcl"
# ---------------------------------------- # ----------------------------------------
if {[punk::repo::is_fossil_root $projectroot]} { if {[punk::repo::is_fossil_root $projectroot]} {
@ -3671,14 +3973,15 @@ if {$::punkboot::command in {project packages modules libs}} {
#review #review
set installername "make.tcl" set installername "make.tcl"
if {$::punkboot::command ni {project vfs bin}} { if {$::punkboot::command ni {bakehouse bake bin}} {
#command = modules #command = packages/modules/libs/vfslibs - stops before kit assembly
puts stdout "vfs folders not checked" puts stdout "vfs folders not checked"
puts stdout " - use 'make.tcl vfscommonupdate' to copy built modules into base vfs folder" puts stdout " - use 'make.tcl vfscommonupdate' to promote built modules into the base vfs folder (promotion gate - commit for provenance)"
puts stdout " - use 'make.tcl project' to build executable kits/zipkits from vfs folders as well if you have runtimes installed" puts stdout " - use 'make.tcl bake' to build executable kits/zipkits from the vfs folders if you have runtimes installed"
puts stdout " Note that without the vfscommonupdate step, 'make.tcl project' will include any manual changes in the *custom* vfs folders but" puts stdout " Note that without the vfscommonupdate step, 'make.tcl bake' will include any manual changes in the *custom* vfs folders but"
puts stdout " without the latest built modules." puts stdout " without the latest built modules."
puts stdout " calling 'builtexename(.exe) dev' will allow testing of built modules before they are put into the kits/zipkits via 'vfscommonupdate' then 'project'" puts stdout " calling 'builtexename(.exe) dev' will allow testing of built modules before they are baked into the kits/zipkits via 'vfscommonupdate' then 'bake'"
puts stdout " - consumer full path from a clean checkout: 'make.tcl bakehouse'"
puts stdout "-done-" puts stdout "-done-"
exit 0 exit 0
} }
@ -5123,11 +5426,11 @@ if {[llength $failed_kits]} {
set had_kits [expr {[llength $installed_kits] || [llength $failed_kits] || [llength $skipped_kits]}] set had_kits [expr {[llength $installed_kits] || [llength $failed_kits] || [llength $skipped_kits]}]
if {$had_kits} { if {$had_kits} {
puts stdout " module builds and kit/zipkit builds processed (vfs config: src/runtime/mapvfs.config)" puts stdout " module builds and kit/zipkit builds processed (vfs config: src/runtime/mapvfs.config)"
puts stdout " - use 'make.tcl modules' to build modules without scanning/building the vfs folders into executable kits/zipkits" puts stdout " - use 'make.tcl modules' to build modules without baking the vfs folders into executable kits/zipkits"
puts stdout " - use 'make.tcl vfscommonupdate' to copy built modules into the base vfs folder <projectdir>/src/vfs/_vfscommon.vfs" puts stdout " - use 'make.tcl vfscommonupdate' to promote built modules into the base vfs folder <projectdir>/src/vfs/_vfscommon.vfs (promotion gate)"
puts stdout " - Note that without the vfscommonupdate step, 'make tcl vfs' (included in 'make tcl project') will build vfs based executables" puts stdout " - Note that without the vfscommonupdate step, 'make.tcl bake' (the kit-assembly stage of 'make.tcl bakehouse') will build vfs based executables"
puts stdout " that include your current custom vfs folders in src/vfs, but with a _vfscommon.vfs that doesn't have the latest built modules" puts stdout " that include your current custom vfs folders in src/vfs, but with a _vfscommon.vfs that doesn't have the latest built modules"
puts stdout " calling 'builtexename(.exe) dev' will allow testing of built modules before they are put into the kits/zipkits via 'vfscommonupdate' then 'project'" puts stdout " calling 'builtexename(.exe) dev' will allow testing of built modules before they are baked into the kits/zipkits via 'vfscommonupdate' then 'bake'"
} else { } else {
puts stdout " module builds processed" puts stdout " module builds processed"
puts stdout "" puts stdout ""

Loading…
Cancel
Save