Browse Source

G-087 hygiene: remove dead layout residue (modpod payload, make.tcl old_layout_update_list)

- punk::mix::templates modpod (0.1.4): dead templates/layouts/project payload
  subtree removed - design-generation residue with no reader; layout payloads
  live in src/project_layouts, located via layout_refs.
- src/make.tcl: unused old_layout_update_list (referencing the long-gone
  src/mixtemplates and modules/punk/mix/templates paths) removed; bootsupport
  help text now names src/project_layouts/custom/_project/<layoutname> instead
  of mixtemplates.
- src/project_layouts custom/_project make.tcl copies: punkcheck-managed sync
  outputs refreshed by the verification 'make.tcl modules' run.

Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com
master
Julian Noble 1 week ago
parent
commit
596857c407
  1. 11
      src/make.tcl
  2. 6
      src/modules/punk/mix/#modpod-templates-999999.0a1.0/templates/layouts/project/src/build.tcl
  3. 1083
      src/modules/punk/mix/#modpod-templates-999999.0a1.0/templates/layouts/project/src/make.tcl
  4. 3
      src/modules/punk/mix/templates-buildversion.txt
  5. 76
      src/project_layouts/custom/_project/punk.basic/src/make.tcl
  6. 76
      src/project_layouts/custom/_project/punk.project-0.1/src/make.tcl
  7. 76
      src/project_layouts/custom/_project/punk.shell-0.1/src/make.tcl

11
src/make.tcl

@ -1372,7 +1372,7 @@ proc ::punkboot::punkboot_gethelp {args} {
append h " - build (or copy if build not required) both .tm and pkgIndex.tcl based packages from src to their corresponding locations under <projectdir>" \n append h " - build (or copy if build not required) both .tm and pkgIndex.tcl based packages from src 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
append h " $scriptname bootsupport" \n append h " $scriptname bootsupport" \n
append h " - update the src/bootsupport modules as well as the mixtemplates/layouts/<layoutname>/src/bootsupport modules if the folder exists" \n append h " - update the src/bootsupport modules as well as the src/project_layouts/custom/_project/<layoutname>/src/bootsupport modules if the folder exists" \n
append h " - bootsupport modules are pulled from locations specified in include_modules.config files within each src/bootsupport subdirectory" \n append h " - bootsupport modules are pulled from locations specified in include_modules.config files within each src/bootsupport subdirectory" \n
append h " - This should usually be from modules that have been built and tested in <projectdir>/modules <projectdir>/lib etc." \n append h " - This should usually be from modules that have been built and tested in <projectdir>/modules <projectdir>/lib etc." \n
append h " - bootsupport modules are available to make.tcl" \n \n append h " - bootsupport modules are available to make.tcl" \n \n
@ -3171,14 +3171,7 @@ if {$::punkboot::command in {project packages libs}} {
if {$::punkboot::command in {project packages modules libs}} { if {$::punkboot::command in {project packages modules libs}} {
######################################################## ########################################################
#templates #templates
#e.g The default project layout is mainly folder structure and readme files - but has some scripts developed under the main src that we want to sync #sync scripts developed under the main src (build.tcl, make.tcl) into the project_layouts custom/_project layout copies
#src to src/modules/punk/mix/templates/layouts/project/src
set old_layout_update_list [list {*}{
} [list project $sourcefolder/modules/punk/mix/templates] {*}{
} [list basic $sourcefolder/mixtemplates] {*}{
}
]
set layout_bases [list {*}{ set layout_bases [list {*}{
} $sourcefolder/project_layouts/custom/_project {*}{ } $sourcefolder/project_layouts/custom/_project {*}{
} }

6
src/modules/punk/mix/#modpod-templates-999999.0a1.0/templates/layouts/project/src/build.tcl

@ -1,6 +0,0 @@
#!/bin/sh
# -*- tcl -*- \
# 'build.tcl' name as required by kettle
# Can be run directly - but also using `deck Kettle ...` or `deck KettleShell ...`\
exec ./kettle -f "$0" "${1+$@}"
kettle doc

1083
src/modules/punk/mix/#modpod-templates-999999.0a1.0/templates/layouts/project/src/make.tcl

File diff suppressed because it is too large Load Diff

3
src/modules/punk/mix/templates-buildversion.txt

@ -1,3 +1,4 @@
0.1.3 0.1.4
#First line must be a semantic version number #First line must be a semantic version number
#all other lines are ignored. #all other lines are ignored.
#0.1.4 - removed dead templates/layouts/project payload subtree (design-generation residue: no reader; layout payloads live in src/project_layouts, located via layout_refs - G-087 hygiene)

76
src/project_layouts/custom/_project/punk.basic/src/make.tcl

@ -1372,7 +1372,7 @@ proc ::punkboot::punkboot_gethelp {args} {
append h " - build (or copy if build not required) both .tm and pkgIndex.tcl based packages from src to their corresponding locations under <projectdir>" \n append h " - build (or copy if build not required) both .tm and pkgIndex.tcl based packages from src 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
append h " $scriptname bootsupport" \n append h " $scriptname bootsupport" \n
append h " - update the src/bootsupport modules as well as the mixtemplates/layouts/<layoutname>/src/bootsupport modules if the folder exists" \n append h " - update the src/bootsupport modules as well as the src/project_layouts/custom/_project/<layoutname>/src/bootsupport modules if the folder exists" \n
append h " - bootsupport modules are pulled from locations specified in include_modules.config files within each src/bootsupport subdirectory" \n append h " - bootsupport modules are pulled from locations specified in include_modules.config files within each src/bootsupport subdirectory" \n
append h " - This should usually be from modules that have been built and tested in <projectdir>/modules <projectdir>/lib etc." \n append h " - This should usually be from modules that have been built and tested in <projectdir>/modules <projectdir>/lib etc." \n
append h " - bootsupport modules are available to make.tcl" \n \n append h " - bootsupport modules are available to make.tcl" \n \n
@ -1995,6 +1995,21 @@ proc ::punkboot::print_provenance_warnings {warninglines args} {
} }
flush stderr flush stderr
} }
#General build warnings that must stay noticeable despite chatty build output - same
#column-0 greppable-token + recap-at-exit treatment as provenance warnings above.
set ::punkboot::build_warnings_pending [list]
proc ::punkboot::print_build_warnings {warninglines args} {
global A
if {![array size A]} {punkboot::define_global_ansi}
foreach w $warninglines {
regsub {^WARNING: } $w "" w
puts stderr "BUILD-WARNING: $A(BAD)$w$A(RST)"
if {"-norecap" ni $args} {
lappend ::punkboot::build_warnings_pending $w
}
}
flush stderr
}
#Availability probe + scoped dirty-src check, shared by the build/promotion gate below and the #Availability probe + scoped dirty-src check, shared by the build/promotion gate below and the
#'check' command report. Returns {available warninglist}. #'check' command report. Returns {available warninglist}.
proc ::punkboot::get_src_provenance_warnings {projectroot label} { proc ::punkboot::get_src_provenance_warnings {projectroot label} {
@ -2019,6 +2034,11 @@ if {![llength [info commands ::punkboot::exit_original]]} {
puts stderr "PROVENANCE-WARNING: recap of warning(s) emitted earlier in this run:" puts stderr "PROVENANCE-WARNING: recap of warning(s) emitted earlier in this run:"
::punkboot::print_provenance_warnings $::punkboot::provenance_warnings_pending -norecap ::punkboot::print_provenance_warnings $::punkboot::provenance_warnings_pending -norecap
} }
if {[info exists ::punkboot::build_warnings_pending] && [llength $::punkboot::build_warnings_pending]} {
puts stderr ""
puts stderr "BUILD-WARNING: recap of warning(s) emitted earlier in this run:"
::punkboot::print_build_warnings $::punkboot::build_warnings_pending -norecap
}
::punkboot::exit_original $returnCode ::punkboot::exit_original $returnCode
} }
} }
@ -3151,14 +3171,7 @@ if {$::punkboot::command in {project packages libs}} {
if {$::punkboot::command in {project packages modules libs}} { if {$::punkboot::command in {project packages modules libs}} {
######################################################## ########################################################
#templates #templates
#e.g The default project layout is mainly folder structure and readme files - but has some scripts developed under the main src that we want to sync #sync scripts developed under the main src (build.tcl, make.tcl) into the project_layouts custom/_project layout copies
#src to src/modules/punk/mix/templates/layouts/project/src
set old_layout_update_list [list {*}{
} [list project $sourcefolder/modules/punk/mix/templates] {*}{
} [list basic $sourcefolder/mixtemplates] {*}{
}
]
set layout_bases [list {*}{ set layout_bases [list {*}{
} $sourcefolder/project_layouts/custom/_project {*}{ } $sourcefolder/project_layouts/custom/_project {*}{
} }
@ -3835,6 +3848,43 @@ proc merge_over {sourcedir targetdir {depth 0}} {
$t destroy $t destroy
puts stdout "\n${margin}merge vfs $sourcedir over $targetdir done." puts stdout "\n${margin}merge vfs $sourcedir over $targetdir done."
} }
#Startup-script presence check for a .vfs source folder about to be built into a kit.
#A kit's boot entry is a root-level main.tcl - either an actual file, or a root-level fauxlink
#resolving to the name main.tcl whose target exists and is a .tcl file (materialised into the
#build copy by the merge_over fauxlink handling above).
#Returns an empty string when a startup script is present, otherwise warning text.
#A kit without a startup script is legal (e.g a bare runtime + payload) - callers warn and
#continue rather than aborting.
proc vfs_startup_script_warning {vfsfolder} {
if {[file isfile [file join $vfsfolder main.tcl]]} {
return ""
}
package require fauxlink
set detail ""
foreach link [glob -nocomplain -dir $vfsfolder -types f *.fxlnk *.fauxlink] {
if {[catch {fauxlink::resolve $link} linkinfo]} {
append detail "; unresolvable fauxlink: [file tail $link]"
continue
}
if {[dict get $linkinfo name] ne "main.tcl"} {
continue
}
set linktarget [dict get $linkinfo targetpath]
if {[file pathtype $linktarget] eq "relative"} {
set linktarget [file join $vfsfolder $linktarget]
}
if {[file isfile $linktarget]} {
if {[string tolower [file extension $linktarget]] eq ".tcl"} {
return ""
}
append detail "; main.tcl fauxlink target '$linktarget' is not a .tcl file"
} else {
append detail "; main.tcl fauxlink target '$linktarget' does not exist"
}
}
return "vfs folder $vfsfolder has NO STARTUP SCRIPT: no root main.tcl and no root fauxlink resolving to main.tcl with an existing .tcl target - kits built from it will have no boot script (build proceeding anyway)$detail"
}
set startdir [pwd] set startdir [pwd]
puts stdout "Found [llength $vfs_tails] .vfs folders - checking each for executables that may need to be built" puts stdout "Found [llength $vfs_tails] .vfs folders - checking each for executables that may need to be built"
cd [file dirname $buildfolder] cd [file dirname $buildfolder]
@ -3904,6 +3954,14 @@ foreach vfstail $vfs_tails {
#assert $runtimes is a list of executable names suffixed with .exe if on windows - whether or not specified with .exe in the mapvfs.config #assert $runtimes is a list of executable names suffixed with .exe if on windows - whether or not specified with .exe in the mapvfs.config
puts " vfs: $vfstail runtimes to process ([llength $runtimes]): $runtimes" puts " vfs: $vfstail runtimes to process ([llength $runtimes]): $runtimes"
if {[llength $runtimes]} {
#only check startup script for .vfs folders that will actually be built against a runtime
#(e.g _vfscommon.vfs is a merge overlay with no runtime mapping and legitimately has no main.tcl)
set startup_warning [vfs_startup_script_warning $sourcefolder/vfs/$vfstail]
if {$startup_warning ne ""} {
::punkboot::print_build_warnings [list $startup_warning]
}
}
#todo - non kit based - zipkit? #todo - non kit based - zipkit?
# $runtimes may now include a dash entry "-" (from mapvfs.config file) # $runtimes may now include a dash entry "-" (from mapvfs.config file)
foreach runtime_fullname $runtimes { foreach runtime_fullname $runtimes {

76
src/project_layouts/custom/_project/punk.project-0.1/src/make.tcl

@ -1372,7 +1372,7 @@ proc ::punkboot::punkboot_gethelp {args} {
append h " - build (or copy if build not required) both .tm and pkgIndex.tcl based packages from src to their corresponding locations under <projectdir>" \n append h " - build (or copy if build not required) both .tm and pkgIndex.tcl based packages from src 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
append h " $scriptname bootsupport" \n append h " $scriptname bootsupport" \n
append h " - update the src/bootsupport modules as well as the mixtemplates/layouts/<layoutname>/src/bootsupport modules if the folder exists" \n append h " - update the src/bootsupport modules as well as the src/project_layouts/custom/_project/<layoutname>/src/bootsupport modules if the folder exists" \n
append h " - bootsupport modules are pulled from locations specified in include_modules.config files within each src/bootsupport subdirectory" \n append h " - bootsupport modules are pulled from locations specified in include_modules.config files within each src/bootsupport subdirectory" \n
append h " - This should usually be from modules that have been built and tested in <projectdir>/modules <projectdir>/lib etc." \n append h " - This should usually be from modules that have been built and tested in <projectdir>/modules <projectdir>/lib etc." \n
append h " - bootsupport modules are available to make.tcl" \n \n append h " - bootsupport modules are available to make.tcl" \n \n
@ -1995,6 +1995,21 @@ proc ::punkboot::print_provenance_warnings {warninglines args} {
} }
flush stderr flush stderr
} }
#General build warnings that must stay noticeable despite chatty build output - same
#column-0 greppable-token + recap-at-exit treatment as provenance warnings above.
set ::punkboot::build_warnings_pending [list]
proc ::punkboot::print_build_warnings {warninglines args} {
global A
if {![array size A]} {punkboot::define_global_ansi}
foreach w $warninglines {
regsub {^WARNING: } $w "" w
puts stderr "BUILD-WARNING: $A(BAD)$w$A(RST)"
if {"-norecap" ni $args} {
lappend ::punkboot::build_warnings_pending $w
}
}
flush stderr
}
#Availability probe + scoped dirty-src check, shared by the build/promotion gate below and the #Availability probe + scoped dirty-src check, shared by the build/promotion gate below and the
#'check' command report. Returns {available warninglist}. #'check' command report. Returns {available warninglist}.
proc ::punkboot::get_src_provenance_warnings {projectroot label} { proc ::punkboot::get_src_provenance_warnings {projectroot label} {
@ -2019,6 +2034,11 @@ if {![llength [info commands ::punkboot::exit_original]]} {
puts stderr "PROVENANCE-WARNING: recap of warning(s) emitted earlier in this run:" puts stderr "PROVENANCE-WARNING: recap of warning(s) emitted earlier in this run:"
::punkboot::print_provenance_warnings $::punkboot::provenance_warnings_pending -norecap ::punkboot::print_provenance_warnings $::punkboot::provenance_warnings_pending -norecap
} }
if {[info exists ::punkboot::build_warnings_pending] && [llength $::punkboot::build_warnings_pending]} {
puts stderr ""
puts stderr "BUILD-WARNING: recap of warning(s) emitted earlier in this run:"
::punkboot::print_build_warnings $::punkboot::build_warnings_pending -norecap
}
::punkboot::exit_original $returnCode ::punkboot::exit_original $returnCode
} }
} }
@ -3151,14 +3171,7 @@ if {$::punkboot::command in {project packages libs}} {
if {$::punkboot::command in {project packages modules libs}} { if {$::punkboot::command in {project packages modules libs}} {
######################################################## ########################################################
#templates #templates
#e.g The default project layout is mainly folder structure and readme files - but has some scripts developed under the main src that we want to sync #sync scripts developed under the main src (build.tcl, make.tcl) into the project_layouts custom/_project layout copies
#src to src/modules/punk/mix/templates/layouts/project/src
set old_layout_update_list [list {*}{
} [list project $sourcefolder/modules/punk/mix/templates] {*}{
} [list basic $sourcefolder/mixtemplates] {*}{
}
]
set layout_bases [list {*}{ set layout_bases [list {*}{
} $sourcefolder/project_layouts/custom/_project {*}{ } $sourcefolder/project_layouts/custom/_project {*}{
} }
@ -3835,6 +3848,43 @@ proc merge_over {sourcedir targetdir {depth 0}} {
$t destroy $t destroy
puts stdout "\n${margin}merge vfs $sourcedir over $targetdir done." puts stdout "\n${margin}merge vfs $sourcedir over $targetdir done."
} }
#Startup-script presence check for a .vfs source folder about to be built into a kit.
#A kit's boot entry is a root-level main.tcl - either an actual file, or a root-level fauxlink
#resolving to the name main.tcl whose target exists and is a .tcl file (materialised into the
#build copy by the merge_over fauxlink handling above).
#Returns an empty string when a startup script is present, otherwise warning text.
#A kit without a startup script is legal (e.g a bare runtime + payload) - callers warn and
#continue rather than aborting.
proc vfs_startup_script_warning {vfsfolder} {
if {[file isfile [file join $vfsfolder main.tcl]]} {
return ""
}
package require fauxlink
set detail ""
foreach link [glob -nocomplain -dir $vfsfolder -types f *.fxlnk *.fauxlink] {
if {[catch {fauxlink::resolve $link} linkinfo]} {
append detail "; unresolvable fauxlink: [file tail $link]"
continue
}
if {[dict get $linkinfo name] ne "main.tcl"} {
continue
}
set linktarget [dict get $linkinfo targetpath]
if {[file pathtype $linktarget] eq "relative"} {
set linktarget [file join $vfsfolder $linktarget]
}
if {[file isfile $linktarget]} {
if {[string tolower [file extension $linktarget]] eq ".tcl"} {
return ""
}
append detail "; main.tcl fauxlink target '$linktarget' is not a .tcl file"
} else {
append detail "; main.tcl fauxlink target '$linktarget' does not exist"
}
}
return "vfs folder $vfsfolder has NO STARTUP SCRIPT: no root main.tcl and no root fauxlink resolving to main.tcl with an existing .tcl target - kits built from it will have no boot script (build proceeding anyway)$detail"
}
set startdir [pwd] set startdir [pwd]
puts stdout "Found [llength $vfs_tails] .vfs folders - checking each for executables that may need to be built" puts stdout "Found [llength $vfs_tails] .vfs folders - checking each for executables that may need to be built"
cd [file dirname $buildfolder] cd [file dirname $buildfolder]
@ -3904,6 +3954,14 @@ foreach vfstail $vfs_tails {
#assert $runtimes is a list of executable names suffixed with .exe if on windows - whether or not specified with .exe in the mapvfs.config #assert $runtimes is a list of executable names suffixed with .exe if on windows - whether or not specified with .exe in the mapvfs.config
puts " vfs: $vfstail runtimes to process ([llength $runtimes]): $runtimes" puts " vfs: $vfstail runtimes to process ([llength $runtimes]): $runtimes"
if {[llength $runtimes]} {
#only check startup script for .vfs folders that will actually be built against a runtime
#(e.g _vfscommon.vfs is a merge overlay with no runtime mapping and legitimately has no main.tcl)
set startup_warning [vfs_startup_script_warning $sourcefolder/vfs/$vfstail]
if {$startup_warning ne ""} {
::punkboot::print_build_warnings [list $startup_warning]
}
}
#todo - non kit based - zipkit? #todo - non kit based - zipkit?
# $runtimes may now include a dash entry "-" (from mapvfs.config file) # $runtimes may now include a dash entry "-" (from mapvfs.config file)
foreach runtime_fullname $runtimes { foreach runtime_fullname $runtimes {

76
src/project_layouts/custom/_project/punk.shell-0.1/src/make.tcl

@ -1372,7 +1372,7 @@ proc ::punkboot::punkboot_gethelp {args} {
append h " - build (or copy if build not required) both .tm and pkgIndex.tcl based packages from src to their corresponding locations under <projectdir>" \n append h " - build (or copy if build not required) both .tm and pkgIndex.tcl based packages from src 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
append h " $scriptname bootsupport" \n append h " $scriptname bootsupport" \n
append h " - update the src/bootsupport modules as well as the mixtemplates/layouts/<layoutname>/src/bootsupport modules if the folder exists" \n append h " - update the src/bootsupport modules as well as the src/project_layouts/custom/_project/<layoutname>/src/bootsupport modules if the folder exists" \n
append h " - bootsupport modules are pulled from locations specified in include_modules.config files within each src/bootsupport subdirectory" \n append h " - bootsupport modules are pulled from locations specified in include_modules.config files within each src/bootsupport subdirectory" \n
append h " - This should usually be from modules that have been built and tested in <projectdir>/modules <projectdir>/lib etc." \n append h " - This should usually be from modules that have been built and tested in <projectdir>/modules <projectdir>/lib etc." \n
append h " - bootsupport modules are available to make.tcl" \n \n append h " - bootsupport modules are available to make.tcl" \n \n
@ -1995,6 +1995,21 @@ proc ::punkboot::print_provenance_warnings {warninglines args} {
} }
flush stderr flush stderr
} }
#General build warnings that must stay noticeable despite chatty build output - same
#column-0 greppable-token + recap-at-exit treatment as provenance warnings above.
set ::punkboot::build_warnings_pending [list]
proc ::punkboot::print_build_warnings {warninglines args} {
global A
if {![array size A]} {punkboot::define_global_ansi}
foreach w $warninglines {
regsub {^WARNING: } $w "" w
puts stderr "BUILD-WARNING: $A(BAD)$w$A(RST)"
if {"-norecap" ni $args} {
lappend ::punkboot::build_warnings_pending $w
}
}
flush stderr
}
#Availability probe + scoped dirty-src check, shared by the build/promotion gate below and the #Availability probe + scoped dirty-src check, shared by the build/promotion gate below and the
#'check' command report. Returns {available warninglist}. #'check' command report. Returns {available warninglist}.
proc ::punkboot::get_src_provenance_warnings {projectroot label} { proc ::punkboot::get_src_provenance_warnings {projectroot label} {
@ -2019,6 +2034,11 @@ if {![llength [info commands ::punkboot::exit_original]]} {
puts stderr "PROVENANCE-WARNING: recap of warning(s) emitted earlier in this run:" puts stderr "PROVENANCE-WARNING: recap of warning(s) emitted earlier in this run:"
::punkboot::print_provenance_warnings $::punkboot::provenance_warnings_pending -norecap ::punkboot::print_provenance_warnings $::punkboot::provenance_warnings_pending -norecap
} }
if {[info exists ::punkboot::build_warnings_pending] && [llength $::punkboot::build_warnings_pending]} {
puts stderr ""
puts stderr "BUILD-WARNING: recap of warning(s) emitted earlier in this run:"
::punkboot::print_build_warnings $::punkboot::build_warnings_pending -norecap
}
::punkboot::exit_original $returnCode ::punkboot::exit_original $returnCode
} }
} }
@ -3151,14 +3171,7 @@ if {$::punkboot::command in {project packages libs}} {
if {$::punkboot::command in {project packages modules libs}} { if {$::punkboot::command in {project packages modules libs}} {
######################################################## ########################################################
#templates #templates
#e.g The default project layout is mainly folder structure and readme files - but has some scripts developed under the main src that we want to sync #sync scripts developed under the main src (build.tcl, make.tcl) into the project_layouts custom/_project layout copies
#src to src/modules/punk/mix/templates/layouts/project/src
set old_layout_update_list [list {*}{
} [list project $sourcefolder/modules/punk/mix/templates] {*}{
} [list basic $sourcefolder/mixtemplates] {*}{
}
]
set layout_bases [list {*}{ set layout_bases [list {*}{
} $sourcefolder/project_layouts/custom/_project {*}{ } $sourcefolder/project_layouts/custom/_project {*}{
} }
@ -3835,6 +3848,43 @@ proc merge_over {sourcedir targetdir {depth 0}} {
$t destroy $t destroy
puts stdout "\n${margin}merge vfs $sourcedir over $targetdir done." puts stdout "\n${margin}merge vfs $sourcedir over $targetdir done."
} }
#Startup-script presence check for a .vfs source folder about to be built into a kit.
#A kit's boot entry is a root-level main.tcl - either an actual file, or a root-level fauxlink
#resolving to the name main.tcl whose target exists and is a .tcl file (materialised into the
#build copy by the merge_over fauxlink handling above).
#Returns an empty string when a startup script is present, otherwise warning text.
#A kit without a startup script is legal (e.g a bare runtime + payload) - callers warn and
#continue rather than aborting.
proc vfs_startup_script_warning {vfsfolder} {
if {[file isfile [file join $vfsfolder main.tcl]]} {
return ""
}
package require fauxlink
set detail ""
foreach link [glob -nocomplain -dir $vfsfolder -types f *.fxlnk *.fauxlink] {
if {[catch {fauxlink::resolve $link} linkinfo]} {
append detail "; unresolvable fauxlink: [file tail $link]"
continue
}
if {[dict get $linkinfo name] ne "main.tcl"} {
continue
}
set linktarget [dict get $linkinfo targetpath]
if {[file pathtype $linktarget] eq "relative"} {
set linktarget [file join $vfsfolder $linktarget]
}
if {[file isfile $linktarget]} {
if {[string tolower [file extension $linktarget]] eq ".tcl"} {
return ""
}
append detail "; main.tcl fauxlink target '$linktarget' is not a .tcl file"
} else {
append detail "; main.tcl fauxlink target '$linktarget' does not exist"
}
}
return "vfs folder $vfsfolder has NO STARTUP SCRIPT: no root main.tcl and no root fauxlink resolving to main.tcl with an existing .tcl target - kits built from it will have no boot script (build proceeding anyway)$detail"
}
set startdir [pwd] set startdir [pwd]
puts stdout "Found [llength $vfs_tails] .vfs folders - checking each for executables that may need to be built" puts stdout "Found [llength $vfs_tails] .vfs folders - checking each for executables that may need to be built"
cd [file dirname $buildfolder] cd [file dirname $buildfolder]
@ -3904,6 +3954,14 @@ foreach vfstail $vfs_tails {
#assert $runtimes is a list of executable names suffixed with .exe if on windows - whether or not specified with .exe in the mapvfs.config #assert $runtimes is a list of executable names suffixed with .exe if on windows - whether or not specified with .exe in the mapvfs.config
puts " vfs: $vfstail runtimes to process ([llength $runtimes]): $runtimes" puts " vfs: $vfstail runtimes to process ([llength $runtimes]): $runtimes"
if {[llength $runtimes]} {
#only check startup script for .vfs folders that will actually be built against a runtime
#(e.g _vfscommon.vfs is a merge overlay with no runtime mapping and legitimately has no main.tcl)
set startup_warning [vfs_startup_script_warning $sourcefolder/vfs/$vfstail]
if {$startup_warning ne ""} {
::punkboot::print_build_warnings [list $startup_warning]
}
}
#todo - non kit based - zipkit? #todo - non kit based - zipkit?
# $runtimes may now include a dash entry "-" (from mapvfs.config file) # $runtimes may now include a dash entry "-" (from mapvfs.config file)
foreach runtime_fullname $runtimes { foreach runtime_fullname $runtimes {

Loading…
Cancel
Save