diff --git a/src/make.tcl b/src/make.tcl index 56f2608a..8247343f 100644 --- a/src/make.tcl +++ b/src/make.tcl @@ -2458,17 +2458,21 @@ proc ::punkboot::lib::runtime_buildcopyname {runtime} { } set runtimes [list] -if {[file dirname [info nameofexecutable]] eq $rtfolder} { +if {[file dirname [info nameofexecutable]] eq $rtfolder && [file isdirectory [info nameofexecutable]]} { + #info name will only appear to be a directory when the runtime is a tclkit that is mounted at the same path as the physical file. + #This is not a problem for zip based kits. #fix so that we can find and use a runtime tclkit that is currently in use as the runtime that is running this script. # - when the current runtime is using a runtime in the rtfolder that is a tclkit, it is mounted at the same path as the physical file and so appears to Tcl as if it's a directory. # - use external filesystem tools to make a copy of the file if {$::tcl_platform(platform) eq "windows"} { #exec cmd /c copy [info nameofexecutable] $rtfolder/[file rootname [file tail [info nameofexecutable]]]_BUILDCOPY.exe - exec cmd /c copy [info nameofexecutable] $rtfolder/[punkboot::lib::runtime_buildcopyname [info nameofexecutable]] + exec cmd /c copy [file nativename [info nameofexecutable]] [file nativename $rtfolder/[punkboot::lib::runtime_buildcopyname [info nameofexecutable]]] } else { #exec cp [info nameofexecutable] $rtfolder/[file tail [info nameofexecutable]]_BUILDCOPY exec cp [info nameofexecutable] $rtfolder/[punkboot::lib::runtime_buildcopyname [info nameofexecutable]] } + #we need to add the base name of the current exe to the runtimes list because the next section will look for files in the runtime folder + #and won't find the mounted runtime since it's mounted as a directory. lappend runtimes [file tail [info nameofexecutable]] } @@ -2627,7 +2631,7 @@ foreach runtime [dict keys $runtime_vfs_map] { #invoke can fail if runtime not an executable file for the current platform if {[file type $rtfolder/$runtime] eq "directory"} { - #assume it's a mounted tclkit (because tcl kits mount in same place as their underlying path and mask the executable) + #assume it's a mounted tclkit (because tcl kits mount in same place as their underlying path and mask the executable as a directory) #use the BUILDCOPY created above - REVIEW if {$::tcl_platform(platform) eq "windows"} { set useruntime [file rootname $runtime]_BUILDCOPY.exe diff --git a/src/project_layouts/custom/_project/punk.basic/src/make.tcl b/src/project_layouts/custom/_project/punk.basic/src/make.tcl index 56f2608a..1a35d8a5 100644 --- a/src/project_layouts/custom/_project/punk.basic/src/make.tcl +++ b/src/project_layouts/custom/_project/punk.basic/src/make.tcl @@ -2458,13 +2458,15 @@ proc ::punkboot::lib::runtime_buildcopyname {runtime} { } set runtimes [list] -if {[file dirname [info nameofexecutable]] eq $rtfolder} { +if {[file dirname [info nameofexecutable]] eq $rtfolder && [file isdirectory [info nameofexecutable]]} { + #info name will only appear to be a directory when the runtime is a tclkit that is mounted at the same path as the physical file. + #This is not a problem for zip based kits. #fix so that we can find and use a runtime tclkit that is currently in use as the runtime that is running this script. # - when the current runtime is using a runtime in the rtfolder that is a tclkit, it is mounted at the same path as the physical file and so appears to Tcl as if it's a directory. # - use external filesystem tools to make a copy of the file if {$::tcl_platform(platform) eq "windows"} { #exec cmd /c copy [info nameofexecutable] $rtfolder/[file rootname [file tail [info nameofexecutable]]]_BUILDCOPY.exe - exec cmd /c copy [info nameofexecutable] $rtfolder/[punkboot::lib::runtime_buildcopyname [info nameofexecutable]] + exec cmd /c copy [file nativename [info nameofexecutable]] [file nativename $rtfolder/[punkboot::lib::runtime_buildcopyname [info nameofexecutable]]] } else { #exec cp [info nameofexecutable] $rtfolder/[file tail [info nameofexecutable]]_BUILDCOPY exec cp [info nameofexecutable] $rtfolder/[punkboot::lib::runtime_buildcopyname [info nameofexecutable]] @@ -2627,7 +2629,7 @@ foreach runtime [dict keys $runtime_vfs_map] { #invoke can fail if runtime not an executable file for the current platform if {[file type $rtfolder/$runtime] eq "directory"} { - #assume it's a mounted tclkit (because tcl kits mount in same place as their underlying path and mask the executable) + #assume it's a mounted tclkit (because tcl kits mount in same place as their underlying path and mask the executable as a directory) #use the BUILDCOPY created above - REVIEW if {$::tcl_platform(platform) eq "windows"} { set useruntime [file rootname $runtime]_BUILDCOPY.exe diff --git a/src/project_layouts/custom/_project/punk.project-0.1/src/make.tcl b/src/project_layouts/custom/_project/punk.project-0.1/src/make.tcl index 56f2608a..1a35d8a5 100644 --- a/src/project_layouts/custom/_project/punk.project-0.1/src/make.tcl +++ b/src/project_layouts/custom/_project/punk.project-0.1/src/make.tcl @@ -2458,13 +2458,15 @@ proc ::punkboot::lib::runtime_buildcopyname {runtime} { } set runtimes [list] -if {[file dirname [info nameofexecutable]] eq $rtfolder} { +if {[file dirname [info nameofexecutable]] eq $rtfolder && [file isdirectory [info nameofexecutable]]} { + #info name will only appear to be a directory when the runtime is a tclkit that is mounted at the same path as the physical file. + #This is not a problem for zip based kits. #fix so that we can find and use a runtime tclkit that is currently in use as the runtime that is running this script. # - when the current runtime is using a runtime in the rtfolder that is a tclkit, it is mounted at the same path as the physical file and so appears to Tcl as if it's a directory. # - use external filesystem tools to make a copy of the file if {$::tcl_platform(platform) eq "windows"} { #exec cmd /c copy [info nameofexecutable] $rtfolder/[file rootname [file tail [info nameofexecutable]]]_BUILDCOPY.exe - exec cmd /c copy [info nameofexecutable] $rtfolder/[punkboot::lib::runtime_buildcopyname [info nameofexecutable]] + exec cmd /c copy [file nativename [info nameofexecutable]] [file nativename $rtfolder/[punkboot::lib::runtime_buildcopyname [info nameofexecutable]]] } else { #exec cp [info nameofexecutable] $rtfolder/[file tail [info nameofexecutable]]_BUILDCOPY exec cp [info nameofexecutable] $rtfolder/[punkboot::lib::runtime_buildcopyname [info nameofexecutable]] @@ -2627,7 +2629,7 @@ foreach runtime [dict keys $runtime_vfs_map] { #invoke can fail if runtime not an executable file for the current platform if {[file type $rtfolder/$runtime] eq "directory"} { - #assume it's a mounted tclkit (because tcl kits mount in same place as their underlying path and mask the executable) + #assume it's a mounted tclkit (because tcl kits mount in same place as their underlying path and mask the executable as a directory) #use the BUILDCOPY created above - REVIEW if {$::tcl_platform(platform) eq "windows"} { set useruntime [file rootname $runtime]_BUILDCOPY.exe diff --git a/src/project_layouts/custom/_project/punk.shell-0.1/src/make.tcl b/src/project_layouts/custom/_project/punk.shell-0.1/src/make.tcl index 56f2608a..1a35d8a5 100644 --- a/src/project_layouts/custom/_project/punk.shell-0.1/src/make.tcl +++ b/src/project_layouts/custom/_project/punk.shell-0.1/src/make.tcl @@ -2458,13 +2458,15 @@ proc ::punkboot::lib::runtime_buildcopyname {runtime} { } set runtimes [list] -if {[file dirname [info nameofexecutable]] eq $rtfolder} { +if {[file dirname [info nameofexecutable]] eq $rtfolder && [file isdirectory [info nameofexecutable]]} { + #info name will only appear to be a directory when the runtime is a tclkit that is mounted at the same path as the physical file. + #This is not a problem for zip based kits. #fix so that we can find and use a runtime tclkit that is currently in use as the runtime that is running this script. # - when the current runtime is using a runtime in the rtfolder that is a tclkit, it is mounted at the same path as the physical file and so appears to Tcl as if it's a directory. # - use external filesystem tools to make a copy of the file if {$::tcl_platform(platform) eq "windows"} { #exec cmd /c copy [info nameofexecutable] $rtfolder/[file rootname [file tail [info nameofexecutable]]]_BUILDCOPY.exe - exec cmd /c copy [info nameofexecutable] $rtfolder/[punkboot::lib::runtime_buildcopyname [info nameofexecutable]] + exec cmd /c copy [file nativename [info nameofexecutable]] [file nativename $rtfolder/[punkboot::lib::runtime_buildcopyname [info nameofexecutable]]] } else { #exec cp [info nameofexecutable] $rtfolder/[file tail [info nameofexecutable]]_BUILDCOPY exec cp [info nameofexecutable] $rtfolder/[punkboot::lib::runtime_buildcopyname [info nameofexecutable]] @@ -2627,7 +2629,7 @@ foreach runtime [dict keys $runtime_vfs_map] { #invoke can fail if runtime not an executable file for the current platform if {[file type $rtfolder/$runtime] eq "directory"} { - #assume it's a mounted tclkit (because tcl kits mount in same place as their underlying path and mask the executable) + #assume it's a mounted tclkit (because tcl kits mount in same place as their underlying path and mask the executable as a directory) #use the BUILDCOPY created above - REVIEW if {$::tcl_platform(platform) eq "windows"} { set useruntime [file rootname $runtime]_BUILDCOPY.exe