Tk Source Code

View Ticket
Login
Ticket UUID: aefc556471df7ffb785e62c28e3a440d8165b9f4
Title: Tk Cocoa, error: garbage collection is no longer supported
Type: Bug Version: All
Submitter: hypnotoad Created on: 2014-03-15 23:32:46
Subsystem: 83. Mac OS X Build Assigned To: kevin_walzer
Priority: 8 Severity: Critical
Status: Closed Last Modified: 2014-06-21 00:07:00
Resolution: Fixed Closed By: aku
    Closed on: 2014-06-21 00:07:00
Description:
With Xcode 5.1, Apple has discontinued support for Garbage Collection. After configuring, all attempts to compile Tk (or Tk based extension) dies on the first file with:

error: garbage collection is no longer supported
make[1]: *** [tkStubLib.o] Error 1
make: *** [tcltk] Error 2

Apple recommends transitioning to Automatic Reference Counting (ARC). The process is described at:
https://developer.apple.com/library/mac/releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html#//apple_ref/doc/uid/TP40011226

Essentially the memory access routines that trade in Native Cocoa objects need a rewrite to support the new API. (As do extensions like Canvas3d which also trade in native Cocoa objects.)

The native Tk for Cocoa will not compile on OSX with Xcode 5.1 or above until this is fixed. Already compiled binaries seem not to be affected. Tcl and Tk (using X11 emulation) are not affected.
User Comments: aku added on 2014-06-21 00:07:00:
For clarification:
  das = Daniel Steffen.

kevin_walzer added on 2014-06-20 23:55:23:
I fixed this in trunk and 8-5-main-branch by removing the garbage collection flag from the configure bits. Tk's performance has not been harmed by removing GC; the traditional memory support is the fallback option, as I understand the design by das. I have neither the time nor the skill to rewrite Cocoa-Tk to use ARC and will not do so.

dkf added on 2014-03-18 11:07:46:

Supporting the latest version of the dev tools seems like a good idea. One critical question though: is the new API supported by older versions of the tools or is this Yet Another Break With The Past™? I doubt we've got the effort to support multiple different ways of doing the same thing…