Changes On Branch apn-missing-shlib-zipfs-check
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch apn-missing-shlib-zipfs-check Excluding Merge-Ins

This is equivalent to a diff from 9338fcde50 to 7b6f0410ce

2025-08-27
11:57
Follow-up to [66cd465323]: For Tcl 9.0+, building on 32-bit MacOS is no longer supported check-in: 052f571967 user: jan.nijtmans tags: core-9-0-branch
05:41
Create new branch named "apn-early-zipfs-mounts" check-in: f0a81579c5 user: apnadkarni tags: apn-early-zipfs-mounts
2025-08-26
08:14
Merge 9.0 check-in: f89e6b2307 user: jan.nijtmans tags: trunk, main
05:53
Oops. Fix inverted compare. Closed-Leaf check-in: 7b6f0410ce user: apnadkarni tags: apn-missing-shlib-zipfs-check
05:22
Fix for missing shared lib zipfs check broken in [9ade301dd7]. check-in: 271ee37dc6 user: apnadkarni tags: apn-missing-shlib-zipfs-check
2025-08-25
22:55
fixes too earlier search for tcl-library (TclZipfsLocateTclLibrary shall be invoked after zipfs moun... check-in: 9ade301dd7 user: sebres tags: apn-missing-shlib-zipfs-check
16:42
amend to [0433b67adc] (ticket [87b69745be]): don't return with OK (swallow the error) if encoding ca... check-in: 9338fcde50 user: sebres tags: core-9-0-branch
15:32
[66cd465323] Platform package simplifications for MacOS >= 11. Platform => 1.1.0 check-in: ee7c3ae49b user: jan.nijtmans tags: core-9-0-branch

Changes to generic/tclZipfs.c.
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
{
    Tcl_Obj *vfsInitScript;
    int found;

    if (zipfs_literal_tcl_library) {
	return TCL_ERROR;
    }
    if (TclZipfs_Mount(NULL, archive, ZIPFS_ZIP_MOUNT, NULL)) {
	/* Either the file doesn't exist or it is not a zip archive */
	return TCL_ERROR;
    }

    TclNewLiteralStringObj(vfsInitScript, ZIPFS_ZIP_MOUNT "/init.tcl");
    Tcl_IncrRefCount(vfsInitScript);
    found = Tcl_FSAccess(vfsInitScript, F_OK);







|







6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
{
    Tcl_Obj *vfsInitScript;
    int found;

    if (zipfs_literal_tcl_library) {
	return TCL_ERROR;
    }
    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;
    }

    TclNewLiteralStringObj(vfsInitScript, ZIPFS_ZIP_MOUNT "/init.tcl");
    Tcl_IncrRefCount(vfsInitScript);
    found = Tcl_FSAccess(vfsInitScript, F_OK);
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558





6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
    result = Tcl_FindExecutable(NULL);
#else
    result = Tcl_FindExecutable((*argvPtr)[0]);
#endif
    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.
     */





    if (TclZipfsLocateTclLibrary() == TCL_OK) {
	(void) TclZipfsInitEncodingDirs();
    }

    if (!TclZipfs_Mount(NULL, archive, ZIPFS_APP_MOUNT, NULL)) {
	int found;
	Tcl_Obj *vfsInitScript;

	TclNewLiteralStringObj(vfsInitScript, ZIPFS_APP_MOUNT "/main.tcl");
	Tcl_IncrRefCount(vfsInitScript);
	if (Tcl_FSAccess(vfsInitScript, F_OK) == 0) {
	    /*
	     * Startup script should be set before calling Tcl_AppInit
	     */

	    Tcl_SetStartupScript(vfsInitScript, NULL);
	} else {
	    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) {
	/*
	 * If the first argument is "install", run the supplied installer
	 * script.
	 */








|
|

>
>
>
>
>
|
|
|
|
<
<
<













<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567



6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580















6581
6582
6583
6584
6585
6586
6587
    result = Tcl_FindExecutable(NULL);
#else
    result = Tcl_FindExecutable((*argvPtr)[0]);
#endif
    archive = Tcl_GetNameOfExecutable();
    TclZipfs_Init(NULL);
    /*
     * After mount, we'll look for init.tcl in one of the mounted locations.
     * Thereby errors ignored as other locations may be available.
     */

    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) {
	    /*
	     * Startup script should be set before calling Tcl_AppInit
	     */

	    Tcl_SetStartupScript(vfsInitScript, NULL);
	} else {
	    Tcl_DecrRefCount(vfsInitScript);
	}
















#ifdef SUPPORT_BUILTIN_ZIP_INSTALL
    } else if (*argcPtr > 1) {
	/*
	 * If the first argument is "install", run the supplied installer
	 * script.
	 */

6618
6619
6620
6621
6622
6623
6624
6625
6626
6627






6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655











6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
	    TclNewLiteralStringObj(vfsInitScript,
		    ZIPFS_ZIP_MOUNT "/tcl_library/install.tcl");
	    Tcl_IncrRefCount(vfsInitScript);
	    if (Tcl_FSAccess(vfsInitScript, F_OK) == 0) {
		Tcl_SetStartupScript(vfsInitScript, NULL);
	    }
	    return result;
	} else if (!TclZipfs_Mount(NULL, archive, ZIPFS_APP_MOUNT, NULL)) {
	    int found;
	    Tcl_Obj *vfsInitScript;







	    TclNewLiteralStringObj(vfsInitScript, ZIPFS_APP_MOUNT "/main.tcl");
	    Tcl_IncrRefCount(vfsInitScript);
	    if (Tcl_FSAccess(vfsInitScript, F_OK) == 0) {
		/*
		 * Startup script should be set before calling Tcl_AppInit
		 */

		Tcl_SetStartupScript(vfsInitScript, NULL);
	    } 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);
#endif /* _WIN32 */
#endif /* SUPPORT_BUILTIN_ZIP_INSTALL */
    }











    return result;
}

/*
 * Local Variables:
 * mode: c
 * c-basic-offset: 4
 * fill-column: 78
 * End:
 */







|
<

>
>
>
>
>
>












<
<
<
<
<
<
<
<
<
<






>
>
>
>
>
>
>
>
>
>
>










6605
6606
6607
6608
6609
6610
6611
6612

6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631










6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
	    TclNewLiteralStringObj(vfsInitScript,
		    ZIPFS_ZIP_MOUNT "/tcl_library/install.tcl");
	    Tcl_IncrRefCount(vfsInitScript);
	    if (Tcl_FSAccess(vfsInitScript, F_OK) == 0) {
		Tcl_SetStartupScript(vfsInitScript, NULL);
	    }
	    return result;
	} 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) {
		/*
		 * Startup script should be set before calling Tcl_AppInit
		 */

		Tcl_SetStartupScript(vfsInitScript, NULL);
	    } else {
		Tcl_DecrRefCount(vfsInitScript);
	    }










	}
#ifdef _WIN32
	Tcl_DStringFree(&ds);
#endif /* _WIN32 */
#endif /* SUPPORT_BUILTIN_ZIP_INSTALL */
    }

#if !defined(STATIC_BUILD)
    /* If tcl_library not found in application archive, check shared library */
    if (!zipfs_literal_tcl_library) {
	/* TclZipfsLocateTclLibrary will mount shared lib archive */
	if (TclZipfsLocateTclLibrary() == TCL_OK) {
	    (void)TclZipfsInitEncodingDirs();
	}
    }
#endif

    return result;
}

/*
 * Local Variables:
 * mode: c
 * c-basic-offset: 4
 * fill-column: 78
 * End:
 */