Opened 7 years ago

Closed 7 years ago

#54673 closed defect (fixed)

tk @8.6.7: quartz build broken on 10.7

Reported by: mojca (Mojca Miklavec) Owned by: mojca (Mojca Miklavec)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: kw@…
Port: tk

Description

An upgrade of Tk apparently broke the build on 10.7. The error being thrown:

/tk/work/tk8.6.7/unix/../macosx/tkMacOSXDialog.c:273:36: error: expected method to read array element not found on object of type 'NSMutableArray *'
     NSMutableArray *allowedtypes = filterInfo.fileTypeExtensions[filterInfo.fileTypeIndex];
                                    ^

I didn't test any other platform, but version 8.6.6 build successfully and judging from http://packages.macports.org/tk/ the X11 version works as well.

A likely candidate for the failure could be this commit: https://core.tcl.tk/tk/info/8d7d752e4fe1714a

Log attached.

Attachments (2)

tk-main.log (316.9 KB) - added by mojca (Mojca Miklavec) 7 years ago.
Build log for Tk +quartz on Lion
tkMacOSXDialog.c.diff (3.0 KB) - added by mojca (Mojca Miklavec) 7 years ago.
patch for tkMacOSXDialog.c to make it work on older systems

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by mojca (Mojca Miklavec)

Attachment: tk-main.log added

Build log for Tk +quartz on Lion

comment:1 Changed 7 years ago by mojca (Mojca Miklavec)

Citing the author (Christian Gollwitzer) of the patch that broke compilation:

Googling the error message leads to this:

https://stackoverflow.com/questions/18799826/xcode-compile-error-expected-method-to-read-array-element-not-found-on-object-o

I think I know what is the problem; there are NSMutableArrays which are indexed like

array[index]

and accoridng to StackOverflow this "modern" syntax came with XCode 4.5 + newer SDKs. The older way was

[array objectAtIndex:index]

It seems that you need Xcode 4.5 to compile it, or downgrade to clunky syntax for array access. Not sure that the rest will work, though.

Changed 7 years ago by mojca (Mojca Miklavec)

Attachment: tkMacOSXDialog.c.diff added

patch for tkMacOSXDialog.c to make it work on older systems

comment:2 Changed 7 years ago by mojca (Mojca Miklavec)

Owner: set to mojca
Resolution: fixed
Status: newclosed

In 121be3a4edc428121f660bf619f31e19a45adb51/macports-ports:

tk: fix +quartz build on older systems

Closes: #54673

Note: See TracTickets for help on using tickets.