From 66d5a767a7d338c52724bf31bfddcf25c6ff0dfb Mon Sep 17 00:00:00 2001 From: Julian Noble Date: Mon, 23 Feb 2026 02:57:39 +1100 Subject: [PATCH] move test for have_sdx til after runtimes examined --- src/make.tcl | 102 ++++++++++++++++++++++++++------------------------- 1 file changed, 52 insertions(+), 50 deletions(-) diff --git a/src/make.tcl b/src/make.tcl index 9d82fb0f..4769fe32 100644 --- a/src/make.tcl +++ b/src/make.tcl @@ -2494,56 +2494,7 @@ if {![llength $runtimes]} { exit 0 } -set have_sdx 1 -set sdxpath [auto_execok $binfolder/sdx] -if {$sdxpath eq ""} { - set sdxpath [auto_execok [file dirname [info nameofexecutable]]/sdx] - if {$sdxpath eq ""} { - #last resort - look on path - set sdxpath [auto_execok sdx] - } - if {$sdxpath eq ""} { - #last resorts - a tclkit and sdx.kit file - if {[file exists $binfolder/sdx.kit]} { - set tclkitpath [auto_execok $binfolder/tclkit] - if {$tclkitpath eq ""} { - set tclkitpath [auto_execok tclkit] - } - if {$tclkitpath ne ""} { - set sdxpath [list {*}$tclkitpath $binfolder/sdx.kit] - } else { - #see if the runtime (or any runtime *for current platform*) has tclkit in the name or has_starkit(?) and use that - #todo - review - #picking first found for now - fix - dict for {rtname rtprops} $runtime_caps { - if {[dict exists $rtprops has_starkit] && [dict get $rtprops has_starkit]} { - set testpath $rtfolder/$rtname - if {[file exists $testpath]} { - if {[file type $testpath] eq "directory"} { - set tclkitpath $rtfolder/[punk::lib::runtime_buildcopyname $testpath] - } else { - set tclkitpath $testpath - } - if {$tclkitpath ne "" && [file exists $tclkitpath]} { - break - } - } - } - } - } - } - } - - if {$sdxpath eq "" || [catch {exec {*}$sdxpath help} errM]} { - puts stderr "FAILED to find usable sdx command or tclkit executable with sdx.bat" - puts stderr "If tclkit-based runtimes are required - check that sdx executable is in bin folder of project or in same folder as tcl/punk executable or on path" - puts stderr "This is not a problem if tcl8.7/tcl9+ kits using the preferred method 'zipfs' are to be used, or if cookfs based kits are to be used." - puts stderr "err: $errM" - #exit 1 - set have_sdx 0 - } -} - +#previous have_sdx test location # -- --- --- --- --- --- --- --- --- --- #load mapvfs.config file (if any) in runtime folder to map runtimes to vfs folders. #build a dict keyed on runtime executable name. @@ -2788,6 +2739,57 @@ foreach runtimefile $runtimes { } # -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- +set have_sdx 1 +set sdxpath [auto_execok $binfolder/sdx] +if {$sdxpath eq ""} { + set sdxpath [auto_execok [file dirname [info nameofexecutable]]/sdx] + if {$sdxpath eq ""} { + #last resort - look on path + set sdxpath [auto_execok sdx] + } + if {$sdxpath eq ""} { + #last resorts - a tclkit and sdx.kit file + if {[file exists $binfolder/sdx.kit]} { + set tclkitpath [auto_execok $binfolder/tclkit] + if {$tclkitpath eq ""} { + set tclkitpath [auto_execok tclkit] + } + if {$tclkitpath ne ""} { + set sdxpath [list {*}$tclkitpath $binfolder/sdx.kit] + } else { + #see if the runtime (or any runtime *for current platform*) has tclkit in the name or has_starkit(?) and use that + #todo - review + #picking first found for now - fix + dict for {rtname rtprops} $runtime_caps { + if {[dict exists $rtprops has_starkit] && [dict get $rtprops has_starkit]} { + set testpath $rtfolder/$rtname + if {[file exists $testpath]} { + if {[file type $testpath] eq "directory"} { + set tclkitpath $rtfolder/[punk::lib::runtime_buildcopyname $testpath] + } else { + set tclkitpath $testpath + } + if {$tclkitpath ne "" && [file exists $tclkitpath]} { + break + } + } + } + } + } + } + } + + if {$sdxpath eq "" || [catch {exec {*}$sdxpath help} errM]} { + puts stderr "FAILED to find usable sdx command or tclkit executable with sdx.bat" + puts stderr "If tclkit-based runtimes are required - check that sdx executable is in bin folder of project or in same folder as tcl/punk executable or on path" + puts stderr "This is not a problem if tcl8.7/tcl9+ kits using the preferred method 'zipfs' are to be used, or if cookfs based kits are to be used." + puts stderr "err: $errM" + #exit 1 + set have_sdx 0 + } +} +# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + set failed_kits [list] set installed_kits [list] set skipped_kits [list]