From 4478afff2aa58272cd2300927f054c710c4cc1c1 Mon Sep 17 00:00:00 2001 From: sebres Date: Mon, 25 Aug 2025 22:55:02 +0000 Subject: fixes too earlier search for tcl-library (TclZipfsLocateTclLibrary shall be invoked after zipfs mount). --- generic/tclZipfs.c | 52 +++++++++++++++++----------------------------------- 1 file changed, 17 insertions(+), 35 deletions(-) diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index bb27ae9..cd17306 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -6411,7 +6411,7 @@ ZipfsAppHookFindTclInit( if (zipfs_literal_tcl_library) { return TCL_ERROR; } - if (TclZipfs_Mount(NULL, archive, ZIPFS_ZIP_MOUNT, NULL)) { + if (TclZipfs_Mount(NULL, archive, ZIPFS_ZIP_MOUNT, NULL) != TCL_OK) { /* Either the file doesn't exist or it is not a zip archive */ return TCL_ERROR; } @@ -6553,17 +6553,19 @@ TclZipfs_AppHook( archive = Tcl_GetNameOfExecutable(); TclZipfs_Init(NULL); /* - * Look for init.tcl in one of the locations mounted later in this - * function. Errors ignored as other locations may be available. + * After mount, we'll look for init.tcl in one of the mounted locations. + * Thereby errors ignored as other locations may be available. */ - if (TclZipfsLocateTclLibrary() == TCL_OK) { - (void) TclZipfsInitEncodingDirs(); - } - if (!TclZipfs_Mount(NULL, archive, ZIPFS_APP_MOUNT, NULL)) { - int found; + if (TclZipfs_Mount(NULL, archive, ZIPFS_APP_MOUNT, NULL) == TCL_OK) { Tcl_Obj *vfsInitScript; + if (!zipfs_literal_tcl_library) { + if (TclZipfsLocateTclLibrary() == TCL_OK) { + (void) TclZipfsInitEncodingDirs(); + } + } + TclNewLiteralStringObj(vfsInitScript, ZIPFS_APP_MOUNT "/main.tcl"); Tcl_IncrRefCount(vfsInitScript); if (Tcl_FSAccess(vfsInitScript, F_OK) == 0) { @@ -6576,21 +6578,6 @@ TclZipfs_AppHook( Tcl_DecrRefCount(vfsInitScript); } - /* - * Set Tcl Encodings - */ - - if (!zipfs_literal_tcl_library) { - TclNewLiteralStringObj(vfsInitScript, - ZIPFS_APP_MOUNT "/tcl_library/init.tcl"); - Tcl_IncrRefCount(vfsInitScript); - found = Tcl_FSAccess(vfsInitScript, F_OK); - Tcl_DecrRefCount(vfsInitScript); - if (found == TCL_OK) { - zipfs_literal_tcl_library = ZIPFS_APP_MOUNT "/tcl_library"; - return result; - } - } #ifdef SUPPORT_BUILTIN_ZIP_INSTALL } else if (*argcPtr > 1) { /* @@ -6622,10 +6609,15 @@ TclZipfs_AppHook( Tcl_SetStartupScript(vfsInitScript, NULL); } return result; - } else if (!TclZipfs_Mount(NULL, archive, ZIPFS_APP_MOUNT, NULL)) { - int found; + } else if (TclZipfs_Mount(NULL, archive, ZIPFS_APP_MOUNT, NULL) == TCL_OK) { Tcl_Obj *vfsInitScript; + if (!zipfs_literal_tcl_library) { + if (TclZipfsLocateTclLibrary() == TCL_OK) { + (void) TclZipfsInitEncodingDirs(); + } + } + TclNewLiteralStringObj(vfsInitScript, ZIPFS_APP_MOUNT "/main.tcl"); Tcl_IncrRefCount(vfsInitScript); if (Tcl_FSAccess(vfsInitScript, F_OK) == 0) { @@ -6637,16 +6629,6 @@ TclZipfs_AppHook( } else { Tcl_DecrRefCount(vfsInitScript); } - /* Set Tcl Encodings */ - TclNewLiteralStringObj(vfsInitScript, - ZIPFS_APP_MOUNT "/tcl_library/init.tcl"); - Tcl_IncrRefCount(vfsInitScript); - found = Tcl_FSAccess(vfsInitScript, F_OK); - Tcl_DecrRefCount(vfsInitScript); - if (found == TCL_OK) { - zipfs_literal_tcl_library = ZIPFS_APP_MOUNT "/tcl_library"; - return result; - } } #ifdef _WIN32 Tcl_DStringFree(&ds); -- cgit v0.12 From 7de3da420f39cd961abdcf097434e66a9b9ea75d Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 27 Aug 2025 09:37:29 +0000 Subject: 32-bit MacOS builds are no longer supported, starting with Tcl 9.0. --- library/platform/platform.tcl | 2 +- tests/platform.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library/platform/platform.tcl b/library/platform/platform.tcl index bd175cd..81a6b15 100644 --- a/library/platform/platform.tcl +++ b/library/platform/platform.tcl @@ -385,7 +385,7 @@ proc ::platform::patterns {id} { if {$cpu ne "arm"} { lappend res macosx${major}.${j}-${cpu} } - if {($cpu eq "x86_64") && ($j == 14)} { + if {($cpu eq "x86_64") && ($j == 14) && ![package vsatisfies [package provide Tcl] 9.0-]} { set alt i386-x86_64 } foreach a $alt { diff --git a/tests/platform.test b/tests/platform.test index 5833a9f..67936f0 100644 --- a/tests/platform.test +++ b/tests/platform.test @@ -99,7 +99,7 @@ test platform-5.0 {format of platform::generic result} -setup { } -result {macos11-arm 1 macos12-arm 1 macos13-arm 1 macos14-arm 1 macos15-arm 1 macos26-arm 1 macos27-arm 1} test platform-5.1 {format of platform::patterns macos26-x86_64} -body { platform::patterns macos26-x86_64 -} -result {macos26-x86_64 macos15-x86_64 macos14-x86_64 macos13-x86_64 macos12-x86_64 macos11-x86_64 macosx10.15-x86_64 macosx10.14-x86_64 macosx10.14-i386-x86_64 macosx10.13-x86_64 macosx10.13-i386-x86_64 macosx10.12-x86_64 macosx10.12-i386-x86_64 macosx10.11-x86_64 macosx10.11-i386-x86_64 macosx10.10-x86_64 macosx10.10-i386-x86_64 macosx10.9-x86_64 macosx10.9-i386-x86_64 tcl} +} -result {macos26-x86_64 macos15-x86_64 macos14-x86_64 macos13-x86_64 macos12-x86_64 macos11-x86_64 macosx10.15-x86_64 macosx10.14-x86_64 macosx10.13-x86_64 macosx10.12-x86_64 macosx10.11-x86_64 macosx10.10-x86_64 macosx10.9-x86_64 tcl} test platform-5.2 {format of platform::patterns macos26-arm} -body { platform::patterns macos26-arm } -result {macos26-arm macos26-x86_64 macos15-arm macos15-x86_64 macos14-arm macos14-x86_64 macos13-arm macos13-x86_64 macos12-arm macos12-x86_64 macos11-arm macos11-x86_64 macosx10.15-x86_64 macosx10.14-x86_64 macosx10.13-x86_64 macosx10.12-x86_64 macosx10.11-x86_64 macosx10.10-x86_64 macosx10.9-x86_64 tcl} -- cgit v0.12