diff --git a/src/bootsupport/modules/punk/mix/templates-0.2.0.tm b/src/bootsupport/modules/punk/mix/templates-0.2.0.tm index cce8edf2..cdac3694 100644 Binary files a/src/bootsupport/modules/punk/mix/templates-0.2.0.tm and b/src/bootsupport/modules/punk/mix/templates-0.2.0.tm differ diff --git a/src/bootsupport/modules/punkboot/utils-0.3.0.tm b/src/bootsupport/modules/punkboot/utils-0.4.0.tm similarity index 92% rename from src/bootsupport/modules/punkboot/utils-0.3.0.tm rename to src/bootsupport/modules/punkboot/utils-0.4.0.tm index 133378da..45ecbf9e 100644 --- a/src/bootsupport/modules/punkboot/utils-0.3.0.tm +++ b/src/bootsupport/modules/punkboot/utils-0.4.0.tm @@ -7,7 +7,7 @@ # (C) 2023 # # @@ Meta Begin -# Application punkboot::utils 0.3.0 +# Application punkboot::utils 0.4.0 # Meta platform tcl # Meta license BSD # @@ Meta End @@ -247,11 +247,16 @@ namespace eval punkboot::utils { a caller such as make.tcl can run it for every kit on every bake and for a cross-target kit it could never run itself. - Two conventions are recognised, both observed in this project's kits: + Three conventions are recognised, all observed in real runtimes: tcl_library/ zipfs-attached kits (tclZipfs looks for /tcl_library/init.tcl) lib/tcl./ starkit/tclkit-style kits (lib/tcl8.6, lib/tcl9.0) + tcl./ runtimes whose archive mounts at the + executable's own path rather than at + //zipfs:/app, so [info library] is + /tcl8.6 - the androwish/undroidwish + zipfs backport for Tcl 8.6 does this A candidate directory qualifies only when it holds init.tcl AND at least one companion file a real Tcl library carries beside it @@ -275,18 +280,24 @@ namespace eval punkboot::utils { } proc vfs_boot_library_report {vfsfolder} { variable boot_library_companions - set checked [list tcl_library lib/tcl.] + set checked [list tcl_library lib/tcl. tcl.] set report [dict create ok 0 locations {} rejected {} checked $checked reason ""] if {![file isdirectory $vfsfolder]} { dict set report reason "no such directory: $vfsfolder" return $report } - #candidates are the two conventions only - a full tree walk would find every - #package's init.tcl and cost more than the check is worth + #candidates are the three conventions only - a full tree walk would find every + #package's init.tcl and cost more than the check is worth. + #The tcl[0-9]* globs deliberately also match module trees named tcl8/ or tcl9/ + #(both exist in this project's kits); they carry no init.tcl, so the qualification + #test below rejects them without needing a narrower pattern. set candidates [list [file join $vfsfolder tcl_library]] foreach dir [lsort [glob -nocomplain -type d -directory [file join $vfsfolder lib] -- {tcl[0-9]*}]] { lappend candidates $dir } + foreach dir [lsort [glob -nocomplain -type d -directory $vfsfolder -- {tcl[0-9]*}]] { + lappend candidates $dir + } set locations [list] set rejected [list] foreach dir $candidates { @@ -320,7 +331,7 @@ namespace eval punkboot::utils { if {[llength $rejected]} { dict set report reason "no tcl library in [file tail $vfsfolder]: [join $rejected {, }] hold init.tcl but none of the companion files a tcl library carries beside it ([join $boot_library_companions {, }]) nor an encoding/ directory" } else { - dict set report reason "no tcl library in [file tail $vfsfolder]: neither tcl_library/init.tcl nor lib/tcl./init.tcl is present" + dict set report reason "no tcl library in [file tail $vfsfolder]: none of tcl_library/init.tcl, lib/tcl./init.tcl or tcl./init.tcl is present" } return $report } @@ -334,8 +345,8 @@ namespace eval ::punk::args::register { ## Ready package provide punkboot::utils [tcl::namespace::eval punkboot::utils { variable version - #- this version number, exactly 0.3.0, is a literal used in src module folders + #- this version number, exactly 0.4.0, is a literal used in src module folders #- we refer to this sometimes as the magic version number - set version 0.3.0 + set version 0.4.0 }] return diff --git a/src/modules/punk/mix/#modpod-templates-999999.0a1.0/templates/project_layouts/vendor/punk/project-0.1/src/make.tcl b/src/modules/punk/mix/#modpod-templates-999999.0a1.0/templates/project_layouts/vendor/punk/project-0.1/src/make.tcl index 4c119425..df240826 100644 --- a/src/modules/punk/mix/#modpod-templates-999999.0a1.0/templates/project_layouts/vendor/punk/project-0.1/src/make.tcl +++ b/src/modules/punk/mix/#modpod-templates-999999.0a1.0/templates/project_layouts/vendor/punk/project-0.1/src/make.tcl @@ -2283,7 +2283,7 @@ DIAGRAM 2 - KIT ASSEMBLY DETAIL (the 'make.tcl bake' stage; incl. vfslibs phase) src/_build/.exe.vfs | | boot-precondition gate: merged vfs must supply a tcl - | library (tcl_library/ or lib/tcl./) [K10] + | library (tcl_library/, lib/tcl./, tcl./) [K10] v (gate) --> refused: kit listed under FAILED KITS, nothing | built, nothing deployed, bin/ untouched @@ -2367,9 +2367,11 @@ KEY / NOTES left exactly as it was. This is deliberately not a warning: the deploy step deletes the old kit before copying the new one, so warning-and-proceeding replaced a working shell with one that could not start. The check is - structural (tcl_library/init.tcl or lib/tcl./init.tcl, plus a - companion file so a package's own init.tcl cannot answer for a tcl library) - and runs on the MERGED tree, not on whether extraction ran - a .vfs that + structural - init.tcl in tcl_library/, lib/tcl./ or + tcl./ (that last one for runtimes whose archive mounts at the + executable's own path rather than //zipfs:/app), plus a companion file so a + package's own init.tcl cannot answer for a tcl library - and runs on the + MERGED tree, not on whether extraction ran - a .vfs that supplies its own tcl library builds and deploys as normal. Nothing is executed, so cross-target kits are covered too. Usual cause: the runtime's own payload could not be extracted - see the BUILD-WARNING naming what was @@ -3548,9 +3550,10 @@ if {$::punkboot::command eq "check"} { lassign [::punkboot::get_vfs_boot_library_report [file join $projectroot __punkboot_bootgate_probe__]] _boot_available _boot_report if {$_boot_available} { puts stdout "boot-precondition gate (G-125): ACTIVE" - puts stdout " bake checks each kit's merged vfs for a tcl library (tcl_library/ or lib/tcl./) before" - puts stdout " building it. A kit with none is reported under FAILED KITS and is neither built nor deployed, so a" - puts stdout " previously deployed kit is never replaced by an artifact that cannot initialise." + puts stdout " bake checks each kit's merged vfs for a tcl library (tcl_library/, lib/tcl./ or" + puts stdout " tcl./) before building it. A kit with none is reported under FAILED KITS and is" + puts stdout " neither built nor deployed, so a previously deployed kit is never replaced by an artifact that" + puts stdout " cannot initialise." } else { puts stdout "boot-precondition gate (G-125): UNAVAILABLE (punkboot::utils vfs_boot_library_report not loadable from bootsupport)" puts stdout " bake will proceed with a NOTE and cannot refuse an unbootable kit - run 'make.tcl modules' then 'make.tcl bootsupport'." diff --git a/src/project_layouts/vendor/punk/basic/src/make.tcl b/src/project_layouts/vendor/punk/basic/src/make.tcl index 4c119425..df240826 100644 --- a/src/project_layouts/vendor/punk/basic/src/make.tcl +++ b/src/project_layouts/vendor/punk/basic/src/make.tcl @@ -2283,7 +2283,7 @@ DIAGRAM 2 - KIT ASSEMBLY DETAIL (the 'make.tcl bake' stage; incl. vfslibs phase) src/_build/.exe.vfs | | boot-precondition gate: merged vfs must supply a tcl - | library (tcl_library/ or lib/tcl./) [K10] + | library (tcl_library/, lib/tcl./, tcl./) [K10] v (gate) --> refused: kit listed under FAILED KITS, nothing | built, nothing deployed, bin/ untouched @@ -2367,9 +2367,11 @@ KEY / NOTES left exactly as it was. This is deliberately not a warning: the deploy step deletes the old kit before copying the new one, so warning-and-proceeding replaced a working shell with one that could not start. The check is - structural (tcl_library/init.tcl or lib/tcl./init.tcl, plus a - companion file so a package's own init.tcl cannot answer for a tcl library) - and runs on the MERGED tree, not on whether extraction ran - a .vfs that + structural - init.tcl in tcl_library/, lib/tcl./ or + tcl./ (that last one for runtimes whose archive mounts at the + executable's own path rather than //zipfs:/app), plus a companion file so a + package's own init.tcl cannot answer for a tcl library - and runs on the + MERGED tree, not on whether extraction ran - a .vfs that supplies its own tcl library builds and deploys as normal. Nothing is executed, so cross-target kits are covered too. Usual cause: the runtime's own payload could not be extracted - see the BUILD-WARNING naming what was @@ -3548,9 +3550,10 @@ if {$::punkboot::command eq "check"} { lassign [::punkboot::get_vfs_boot_library_report [file join $projectroot __punkboot_bootgate_probe__]] _boot_available _boot_report if {$_boot_available} { puts stdout "boot-precondition gate (G-125): ACTIVE" - puts stdout " bake checks each kit's merged vfs for a tcl library (tcl_library/ or lib/tcl./) before" - puts stdout " building it. A kit with none is reported under FAILED KITS and is neither built nor deployed, so a" - puts stdout " previously deployed kit is never replaced by an artifact that cannot initialise." + puts stdout " bake checks each kit's merged vfs for a tcl library (tcl_library/, lib/tcl./ or" + puts stdout " tcl./) before building it. A kit with none is reported under FAILED KITS and is" + puts stdout " neither built nor deployed, so a previously deployed kit is never replaced by an artifact that" + puts stdout " cannot initialise." } else { puts stdout "boot-precondition gate (G-125): UNAVAILABLE (punkboot::utils vfs_boot_library_report not loadable from bootsupport)" puts stdout " bake will proceed with a NOTE and cannot refuse an unbootable kit - run 'make.tcl modules' then 'make.tcl bootsupport'." diff --git a/src/project_layouts/vendor/punk/project-0.1/src/make.tcl b/src/project_layouts/vendor/punk/project-0.1/src/make.tcl index 4c119425..df240826 100644 --- a/src/project_layouts/vendor/punk/project-0.1/src/make.tcl +++ b/src/project_layouts/vendor/punk/project-0.1/src/make.tcl @@ -2283,7 +2283,7 @@ DIAGRAM 2 - KIT ASSEMBLY DETAIL (the 'make.tcl bake' stage; incl. vfslibs phase) src/_build/.exe.vfs | | boot-precondition gate: merged vfs must supply a tcl - | library (tcl_library/ or lib/tcl./) [K10] + | library (tcl_library/, lib/tcl./, tcl./) [K10] v (gate) --> refused: kit listed under FAILED KITS, nothing | built, nothing deployed, bin/ untouched @@ -2367,9 +2367,11 @@ KEY / NOTES left exactly as it was. This is deliberately not a warning: the deploy step deletes the old kit before copying the new one, so warning-and-proceeding replaced a working shell with one that could not start. The check is - structural (tcl_library/init.tcl or lib/tcl./init.tcl, plus a - companion file so a package's own init.tcl cannot answer for a tcl library) - and runs on the MERGED tree, not on whether extraction ran - a .vfs that + structural - init.tcl in tcl_library/, lib/tcl./ or + tcl./ (that last one for runtimes whose archive mounts at the + executable's own path rather than //zipfs:/app), plus a companion file so a + package's own init.tcl cannot answer for a tcl library - and runs on the + MERGED tree, not on whether extraction ran - a .vfs that supplies its own tcl library builds and deploys as normal. Nothing is executed, so cross-target kits are covered too. Usual cause: the runtime's own payload could not be extracted - see the BUILD-WARNING naming what was @@ -3548,9 +3550,10 @@ if {$::punkboot::command eq "check"} { lassign [::punkboot::get_vfs_boot_library_report [file join $projectroot __punkboot_bootgate_probe__]] _boot_available _boot_report if {$_boot_available} { puts stdout "boot-precondition gate (G-125): ACTIVE" - puts stdout " bake checks each kit's merged vfs for a tcl library (tcl_library/ or lib/tcl./) before" - puts stdout " building it. A kit with none is reported under FAILED KITS and is neither built nor deployed, so a" - puts stdout " previously deployed kit is never replaced by an artifact that cannot initialise." + puts stdout " bake checks each kit's merged vfs for a tcl library (tcl_library/, lib/tcl./ or" + puts stdout " tcl./) before building it. A kit with none is reported under FAILED KITS and is" + puts stdout " neither built nor deployed, so a previously deployed kit is never replaced by an artifact that" + puts stdout " cannot initialise." } else { puts stdout "boot-precondition gate (G-125): UNAVAILABLE (punkboot::utils vfs_boot_library_report not loadable from bootsupport)" puts stdout " bake will proceed with a NOTE and cannot refuse an unbootable kit - run 'make.tcl modules' then 'make.tcl bootsupport'." diff --git a/src/vfs/_vfscommon.vfs/modules/punk/mix/templates-0.2.0.tm b/src/vfs/_vfscommon.vfs/modules/punk/mix/templates-0.2.0.tm index cce8edf2..cdac3694 100644 Binary files a/src/vfs/_vfscommon.vfs/modules/punk/mix/templates-0.2.0.tm and b/src/vfs/_vfscommon.vfs/modules/punk/mix/templates-0.2.0.tm differ diff --git a/src/vfs/_vfscommon.vfs/modules/punkboot/utils-0.3.0.tm b/src/vfs/_vfscommon.vfs/modules/punkboot/utils-0.4.0.tm similarity index 92% rename from src/vfs/_vfscommon.vfs/modules/punkboot/utils-0.3.0.tm rename to src/vfs/_vfscommon.vfs/modules/punkboot/utils-0.4.0.tm index 133378da..45ecbf9e 100644 --- a/src/vfs/_vfscommon.vfs/modules/punkboot/utils-0.3.0.tm +++ b/src/vfs/_vfscommon.vfs/modules/punkboot/utils-0.4.0.tm @@ -7,7 +7,7 @@ # (C) 2023 # # @@ Meta Begin -# Application punkboot::utils 0.3.0 +# Application punkboot::utils 0.4.0 # Meta platform tcl # Meta license BSD # @@ Meta End @@ -247,11 +247,16 @@ namespace eval punkboot::utils { a caller such as make.tcl can run it for every kit on every bake and for a cross-target kit it could never run itself. - Two conventions are recognised, both observed in this project's kits: + Three conventions are recognised, all observed in real runtimes: tcl_library/ zipfs-attached kits (tclZipfs looks for /tcl_library/init.tcl) lib/tcl./ starkit/tclkit-style kits (lib/tcl8.6, lib/tcl9.0) + tcl./ runtimes whose archive mounts at the + executable's own path rather than at + //zipfs:/app, so [info library] is + /tcl8.6 - the androwish/undroidwish + zipfs backport for Tcl 8.6 does this A candidate directory qualifies only when it holds init.tcl AND at least one companion file a real Tcl library carries beside it @@ -275,18 +280,24 @@ namespace eval punkboot::utils { } proc vfs_boot_library_report {vfsfolder} { variable boot_library_companions - set checked [list tcl_library lib/tcl.] + set checked [list tcl_library lib/tcl. tcl.] set report [dict create ok 0 locations {} rejected {} checked $checked reason ""] if {![file isdirectory $vfsfolder]} { dict set report reason "no such directory: $vfsfolder" return $report } - #candidates are the two conventions only - a full tree walk would find every - #package's init.tcl and cost more than the check is worth + #candidates are the three conventions only - a full tree walk would find every + #package's init.tcl and cost more than the check is worth. + #The tcl[0-9]* globs deliberately also match module trees named tcl8/ or tcl9/ + #(both exist in this project's kits); they carry no init.tcl, so the qualification + #test below rejects them without needing a narrower pattern. set candidates [list [file join $vfsfolder tcl_library]] foreach dir [lsort [glob -nocomplain -type d -directory [file join $vfsfolder lib] -- {tcl[0-9]*}]] { lappend candidates $dir } + foreach dir [lsort [glob -nocomplain -type d -directory $vfsfolder -- {tcl[0-9]*}]] { + lappend candidates $dir + } set locations [list] set rejected [list] foreach dir $candidates { @@ -320,7 +331,7 @@ namespace eval punkboot::utils { if {[llength $rejected]} { dict set report reason "no tcl library in [file tail $vfsfolder]: [join $rejected {, }] hold init.tcl but none of the companion files a tcl library carries beside it ([join $boot_library_companions {, }]) nor an encoding/ directory" } else { - dict set report reason "no tcl library in [file tail $vfsfolder]: neither tcl_library/init.tcl nor lib/tcl./init.tcl is present" + dict set report reason "no tcl library in [file tail $vfsfolder]: none of tcl_library/init.tcl, lib/tcl./init.tcl or tcl./init.tcl is present" } return $report } @@ -334,8 +345,8 @@ namespace eval ::punk::args::register { ## Ready package provide punkboot::utils [tcl::namespace::eval punkboot::utils { variable version - #- this version number, exactly 0.3.0, is a literal used in src module folders + #- this version number, exactly 0.4.0, is a literal used in src module folders #- we refer to this sometimes as the magic version number - set version 0.3.0 + set version 0.4.0 }] return