Opened 8 years ago

Closed 7 years ago

#52090 closed defect (fixed)

tk @8.6.6_0 fails building on 10.6.8

Reported by: udbraumann Owned by: dliessi (Davide Liessi)
Priority: Normal Milestone:
Component: ports Version:
Keywords: snowleopard Cc: dliessi (Davide Liessi), ballapete (Peter "Pete" Dyballa), chillin-, macportsraf, mojca (Mojca Miklavec)
Port: tk

Description

While upgrading tk from 8.6.5_0 to 8.6.6_0 building stops at this point:

...
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_x11_tk/tk/work/tk8.6.6/unix/../macosx/tkMacOSXXStubs.c: In function ‘XGetImage’:
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_x11_tk/tk/work/tk8.6.6/unix/../macosx/tkMacOSXXStubs.c:901: warning: ‘NSWindow’ may not respond to ‘-backingScaleFactor’
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_x11_tk/tk/work/tk8.6.6/unix/../macosx/tkMacOSXXStubs.c:901: warning: (Messages without a matching method signature
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_x11_tk/tk/work/tk8.6.6/unix/../macosx/tkMacOSXXStubs.c:901: warning: will be assumed to return ‘id’ and accept
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_x11_tk/tk/work/tk8.6.6/unix/../macosx/tkMacOSXXStubs.c:901: warning: ‘...’ as arguments.)
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_x11_tk/tk/work/tk8.6.6/unix/../macosx/tkMacOSXXStubs.c:901: error: invalid operands to binary == (have ‘id’ and ‘double’)
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_x11_tk/tk/work/tk8.6.6/unix/../macosx/tkMacOSXXStubs.c:893: warning: unused variable ‘macDraw’
:info:build make: *** [tkMacOSXXStubs.o] Error 1
...

Some ideas?

Attachments (3)

main.log.gz (7.0 KB) - added by udbraumann 8 years ago.
patch-macosx-tkMacOSXXStubs_non-Retina.diff (1.0 KB) - added by ballapete (Peter "Pete" Dyballa) 8 years ago.
Patch to make tk @8.6.6_0+quartz build on Non-Retina Snow Leopard
smaller_patch-macosx-tkMacOSXXStubs_non-Retina.diff (599 bytes) - added by ballapete (Peter "Pete" Dyballa) 8 years ago.
Patch to make tk @8.6.6_0+quartz build on Non-Retina Snow Leopard

Download all attachments as: .zip

Change History (28)

Changed 8 years ago by udbraumann

Attachment: main.log.gz added

comment:1 Changed 8 years ago by mf2k (Frank Schima)

Cc: mww@… removed
Owner: changed from macports-tickets@… to mww@…

comment:2 in reply to:  1 Changed 8 years ago by udbraumann

FWIW, I had no problems to build the same tk 8.6.6_0 on 10.5.8 PPC.

comment:3 Changed 8 years ago by dliessi (Davide Liessi)

Cc: davide.liessi@… added

Cc Me!

comment:4 Changed 8 years ago by ballapete (Peter "Pete" Dyballa)

Cc: Peter_Dyballa@… added

Cc Me!

comment:5 Changed 8 years ago by larryv (Lawrence Velázquez)

Cc: chilli.namesake@… added
Keywords: snowleopard added
Version: 2.3.4

Has duplicate #52171.

comment:6 Changed 8 years ago by larryv (Lawrence Velázquez)

Cc: macports@… added

Has duplicate #52504.

comment:7 Changed 8 years ago by ballapete (Peter "Pete" Dyballa)

The C code that leads to the failure has to do with Retina displays. They seem to have -backingScaleFactor times the resolution of X11 horizontally and vertically.

The lines 893–904, 933+934, 971–973 seem to be obsolete for non-Retina displays, 935, 946, 956, 969 need a change for them.

What is an appropriate guard for a #ifdef?

comment:9 Changed 8 years ago by ballapete (Peter "Pete" Dyballa)

I have a minimal patch that lets tk build – and a PerlTk application (tlmgr) that even works with it! (Well, it appears on screen, I can press buttons, it starts to fetch data from the internet, but the input data rate is at a real central European level [100 bytes per second?] that I did not wait until it finished the update job. Well, it's a bit windy outside, great snow flakes come down…)

Changed 8 years ago by ballapete (Peter "Pete" Dyballa)

Patch to make tk @8.6.6_0+quartz build on Non-Retina Snow Leopard

comment:10 Changed 8 years ago by ballapete (Peter "Pete" Dyballa)

Using that smaller patch which Mojca suggested in an eMail produces the warnings below, but tlmgr launches and performs a bit.

/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_x11_tk/tk/work/tk8.6.6/unix/../macosx/tkMacOSXXStubs.c: In function ‘XGetImage’:
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_x11_tk/tk/work/tk8.6.6/unix/../macosx/tkMacOSXXStubs.c:907: warning: ‘NSWindow’ may not respond to ‘-backingScaleFactor’
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_x11_tk/tk/work/tk8.6.6/unix/../macosx/tkMacOSXXStubs.c:907: warning: (Messages without a matching method signature
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_x11_tk/tk/work/tk8.6.6/unix/../macosx/tkMacOSXXStubs.c:907: warning: will be assumed to return ‘id’ and accept
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_x11_tk/tk/work/tk8.6.6/unix/../macosx/tkMacOSXXStubs.c:907: warning: ‘...’ as arguments.)
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_x11_tk/tk/work/tk8.6.6/unix/../macosx/tkMacOSXXStubs.c:893: warning: unused variable ‘macDraw’

Whatever they might mean – except for the last one, which is clear.

Changed 8 years ago by ballapete (Peter "Pete" Dyballa)

Patch to make tk @8.6.6_0+quartz build on Non-Retina Snow Leopard

comment:11 Changed 8 years ago by mf2k (Frank Schima)

Owner: mww@… deleted
Status: newassigned

See #53012.

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

Cc: mojca added

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

Peter, are you really saying that tlmgr gui works for you without X11?

comment:15 Changed 7 years ago by dliessi (Davide Liessi)

I cannot speak for Peter, but I tested his patch, that I uploaded in the referenced pull request, using install-tl from TeX Live. It worked, but in fact it opened X11, although I had installed with +quartz. I'm not sure of what this all means.

Any tests I could do to really check that the +quartz variant is working?

comment:16 in reply to:  15 ; Changed 7 years ago by mojca (Mojca Miklavec)

Maybe xasy? (If you make sure that you run it from MacPorts prefix rather than from external source that uses the system python.) Or any other tk program.

I don't see any reason why it would not work, but I admit that I'm a bit puzzled when I compare your patch with the one from Peter. (That is: I wonder why your shorter patch works correctly if Peter had problems with other bits of code.)

It would also be super useful to report this upstream.

Replying to dliessi:

I cannot speak for Peter, but I tested his patch, that I uploaded in the referenced pull request, using install-tl from TeX Live. It worked, but in fact it opened X11, although I had installed with +quartz. I'm not sure of what this all means.

Just that Perl/Tk needs some love. I opened https://github.com/eserte/perl-tk/issues/24 a while ago, even if I don't expect any answer. Thus I would be really surprised if it worked for Peter.

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

Their tracker is probably here: http://core.tcl.tk/tk/ticket

comment:18 in reply to:  16 Changed 7 years ago by dliessi (Davide Liessi)

Replying to mojca:

I don't see any reason why it would not work, but I admit that I'm a bit puzzled when I compare your patch with the one from Peter. (That is: I wonder why your shorter patch works correctly if Peter had problems with other bits of code.)

Well, my shorter patch is actually a more readable version of Peter's smaller_patch, which is what you had suggested.

If you prefer to get rid of the warnings, I could upload Peter's original patch.

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

comment:20 in reply to:  19 Changed 7 years ago by dliessi (Davide Liessi)

I tested with xasy and it works.

As for the Tk ticket

Replying to mojca:

http://core.tcl.tk/tk/tktview/5f44d4f5ea47cb81c6fa66287cb721be80caedc1

would it be better to suggest Peter's patch (no warnings) or the one I uploaded (harmless warning)?

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

You could submit both and let the upstream developer decide. I also added Kevin (the one who would likely react) to the PR.

As far as MacPorts is concerned: as long as the code compiles and works properly, I don't really care. If upstream makes a change, I would prefer to do exactly the same change and then remove the patch for the next release.

Last edited 7 years ago by mojca (Mojca Miklavec) (previous) (diff)

comment:22 in reply to:  14 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Replying to mojca:

Peter, are you really saying that tlmgr gui works for you without X11?

No. Tlmgr is an X11 application and uses X11. But wish opens a Quartz window.

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

No, tlmgr is a Perl/Tk application and only uses X11 because Perl/Tk doesn't know any better.

comment:24 in reply to:  15 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Replying to dliessi:

Any tests I could do to really check that the +quartz variant is working?

otool -L `which wish`

or simply

wish &

comment:25 Changed 7 years ago by dliessi (Davide Liessi)

Owner: set to dliessi
Resolution: fixed
Status: assignedclosed

In 4efa46456029152e68909f7bcdf683a3e361aa19/macports-ports:

tk: allow building +quartz on non-Retina systems

Building of Tk breaks when building against SDK for 10.6 or older.
This patch hides the code when backingScaleFactor is not known to the API
at the time of the build.

See: http://core.tcl.tk/tk/tktview/5f44d4f5ea47cb81c6fa66287cb721be80caedc1
Closes: #52090

Note: See TracTickets for help on using tickets.