Browse Source

layouts make.tcl: platform_punk boot helper - canonical platform-dir names

Add punkboot::lib::platform_punk to the three layout make.tcl copies
(basic, project-0.1, and the modpod-template mirror): an inline copy of
punk::platform::normalize (the boot stage cannot package require) that
folds platform_generic's version-dependent cpu/os aliases
(amd64->x86_64, aarch64->arm64, macos->macosx, macosx arm->arm64) into
the canonical punkshell platform-dir names. The bootsupport/library
path wiring now uses it, so platform-suffixed dirs match the punkbin /
punk::platform canon documented in 'help platforms'.

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

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

@ -278,6 +278,23 @@ namespace eval ::punkboot::lib {
return "${plat}-${cpu}"
}
proc platform_punk {} {
#canonical punkshell platform-dir name: platform_generic normalized.
#INLINE COPY of punk::platform::normalize (src/modules/punk/platform-*.tm;
#'help platforms' documents the canon) - the boot stage cannot package
#require, so keep this mapping in sync with that module:
#amd64->x86_64, aarch64->arm64, macos->macosx, macosx arm->arm64.
set parts [split [platform_generic] -]
set cpu [lindex $parts end]
set os [join [lrange $parts 0 end-1] -]
if {$os eq "macos"} {set os macosx}
switch -- $cpu {
amd64 {set cpu x86_64}
aarch64 {set cpu arm64}
arm {if {$os eq "macosx"} {set cpu arm64}}
}
return "${os}-${cpu}"
}
}
@ -370,7 +387,7 @@ set startdir [pwd]
# -------------------------------------------------------------------------------------
set bootsupport_module_paths [list]
set bootsupport_library_paths [list]
set this_platform_generic [punkboot::lib::platform_generic]
set this_platform_generic [punkboot::lib::platform_punk] ;#normalized punkshell platform-dir name (punk::platform canon)
#we always create these lists in order of desired precedence.
# - this is the same order when adding to auto_path - but will need to be reversed when using tcl:tm::add
if {[file exists [file join $::punkboot::scriptfolder bootsupport]]} {

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

@ -278,6 +278,23 @@ namespace eval ::punkboot::lib {
return "${plat}-${cpu}"
}
proc platform_punk {} {
#canonical punkshell platform-dir name: platform_generic normalized.
#INLINE COPY of punk::platform::normalize (src/modules/punk/platform-*.tm;
#'help platforms' documents the canon) - the boot stage cannot package
#require, so keep this mapping in sync with that module:
#amd64->x86_64, aarch64->arm64, macos->macosx, macosx arm->arm64.
set parts [split [platform_generic] -]
set cpu [lindex $parts end]
set os [join [lrange $parts 0 end-1] -]
if {$os eq "macos"} {set os macosx}
switch -- $cpu {
amd64 {set cpu x86_64}
aarch64 {set cpu arm64}
arm {if {$os eq "macosx"} {set cpu arm64}}
}
return "${os}-${cpu}"
}
}
@ -370,7 +387,7 @@ set startdir [pwd]
# -------------------------------------------------------------------------------------
set bootsupport_module_paths [list]
set bootsupport_library_paths [list]
set this_platform_generic [punkboot::lib::platform_generic]
set this_platform_generic [punkboot::lib::platform_punk] ;#normalized punkshell platform-dir name (punk::platform canon)
#we always create these lists in order of desired precedence.
# - this is the same order when adding to auto_path - but will need to be reversed when using tcl:tm::add
if {[file exists [file join $::punkboot::scriptfolder bootsupport]]} {

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

@ -278,6 +278,23 @@ namespace eval ::punkboot::lib {
return "${plat}-${cpu}"
}
proc platform_punk {} {
#canonical punkshell platform-dir name: platform_generic normalized.
#INLINE COPY of punk::platform::normalize (src/modules/punk/platform-*.tm;
#'help platforms' documents the canon) - the boot stage cannot package
#require, so keep this mapping in sync with that module:
#amd64->x86_64, aarch64->arm64, macos->macosx, macosx arm->arm64.
set parts [split [platform_generic] -]
set cpu [lindex $parts end]
set os [join [lrange $parts 0 end-1] -]
if {$os eq "macos"} {set os macosx}
switch -- $cpu {
amd64 {set cpu x86_64}
aarch64 {set cpu arm64}
arm {if {$os eq "macosx"} {set cpu arm64}}
}
return "${os}-${cpu}"
}
}
@ -370,7 +387,7 @@ set startdir [pwd]
# -------------------------------------------------------------------------------------
set bootsupport_module_paths [list]
set bootsupport_library_paths [list]
set this_platform_generic [punkboot::lib::platform_generic]
set this_platform_generic [punkboot::lib::platform_punk] ;#normalized punkshell platform-dir name (punk::platform canon)
#we always create these lists in order of desired precedence.
# - this is the same order when adding to auto_path - but will need to be reversed when using tcl:tm::add
if {[file exists [file join $::punkboot::scriptfolder bootsupport]]} {

Loading…
Cancel
Save