Tk Source Code

View Ticket
Bounty program for improvements to Tcl and certain Tcl packages.
10:05 Closed ticket [1d37c3e1]: Cocoa Tk built for OS X 10.10 fails with "Mac OS X 10.10000 or later required " plus 6 other changes artifact: 92d54ebe user: kevin_walzer
13:58 Ticket [1d37c3e1]: 3 changes artifact: 5524e98d user: kevin_walzer
00:18 New ticket [1d37c3e1]. artifact: 855d4d23 user: ned.deily

Ticket UUID: 1d37c3e16616a0e6283ef390272f0cf483b74b5
Title: Cocoa Tk built for OS X 10.10 fails with "Mac OS X 10.10000 or later required "
Type: Bug Version: 8.6.2
Submitter: ned.deily Created on: 2014-10-20 00:18:06
Subsystem: 83. Mac OS X Build Assigned To: kevin_walzer
Priority: 5 Medium Severity: Critical
Status: Closed Last Modified: 2014-10-22 10:05:47
Resolution: Fixed Closed By: kevin_walzer
    Closed on: 2014-10-22 10:05:47

When built on OS X 10.10 (Yosemite) or with a MACOSX_DEPLOYMENT_TARGET of 10.10, Cocoa Tk aborts during initialization due to a faulty version check. Because the minor version number (the y of x.y.z) has now reached two digits for 10.10.x, Apple has had to incompatibility change the version numbering scheme used in its AvailabilityMacros.h which are used by Cocoa Tk.

The following test program which duplicates the relevant code from macosx/tkMacOSXInit.c illustrates the problem:

#include <stdio.h>
#include <stdlib.h>
#include <sys/utsname.h>
#include <AvailabilityMacros.h>

int main() { 
    struct utsname name;
    long tkMacOSXMacOSXVersion = 0;

    printf("uname release = %s\n", name.release);
    tkMacOSXMacOSXVersion = (strtod(name.release, NULL) + 96) * 10;
	printf("tkMacOSXMacOSXVersion = %li\n", tkMacOSXMacOSXVersion);
	return 0;

On OS X 10.8.5, the results are:

uname release = 12.5.0
tkMacOSXMacOSXVersion = 1085

But on OS X 10.10, the results are:

uname release = 14.0.0
tkMacOSXMacOSXVersion = 1100

Note the difference in format of MAC_OS_X_VERSION_MIN_REQUIRED.

This causes the test at line 239 in TkpInit to fail on 10.10 with the resulting abort message referenced in the title.

There are obviously various ways to fix this for 8.6.x and 8.5.x. It might be best to find out how Apple presumably fixed their copy of 8.5 for the 10.10 release. As of now, has not yet been updated with 10.10 sources.

User Comments: kevin_walzer added on 2014-10-22 10:05:47:
Patch committed that fixes the problem; thanks for the helpful and detailed bug report and diagnosis.