Artifacts Associated With Ticket 3508771fffffffff
Ticket change [c40cd30b32] (rid 111780) by nijtmans on 2012-03-19 15:35:20:
- assignee initialized to: "nijtmans"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Using the stubs mechanism, it should be possible to load tclreg.dll (compiled with mingw or vc++) in a tclsh compiled with cygwin. I tried it, and it almost works, but not quite..... tclreg.dll calls the function TclWinGetPlatformId(), inits init function: if (TclWinGetPlatformId() == VER_PLATFORM_WIN32_NT) { regWinProcs = &unicodeProcs; } else { regWinProcs = &asciiProcs; } which resides in slot 9 of tclIntPlatStubs. But cygwin uses the UNIX stubs, which has TclpCreateTempFile() in slot 9. So, everything seems to work, but in fact a temporary file is created, and a handle to it is returned. This handle is != VER_PLATFORM_WIN32_NT, so this instructs tclreg.dll to use the ASCII variants of the registry functions. Solution: move TclpCreateTempFile from slot 9 to slot 22, and put TclWinGetPlatformId in slot 9. On UNIX, TclWinGetPlatformId does not exist, so use some #define to map it back to TclpCreateTempFile on non-cygwin. The same potential problem exists with the functions Tcl_WinUtfToTChar and Tcl_WinTCharToUtf, which are in the public API. TclWinGetPlatformId is not public, but because it is used in tclreg.dll I would like to make an exception for that. - foundin initialized to: "obsolete: 8.5.11"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nijtmans"
- subsystem initialized to: "52. Portability Support"
- title initialized to: "load tclreg.dll in cygwin tclsh"
- type initialized to: "Bug"
Ticket change [cf232d367c] (rid 112915) by nijtmans on 2012-03-20 17:54:27:
- icomment:
Implementation for TclWinGetPlatformId, Tcl_WinUtfToTChar and Tcl_WinTCharToUtf done and committed to core-8-4-branch, core-8-5-branch and trunk. (Since cygwin now switched to tcl 8.5, it would not have been necessary to do it for Tcl 8.4, but it worked, so why not....) Added a dummy TclWinCPUID too, because this function is in slot 29, the last win32 slot. win32 has more slots than unix, and this way all unused slots will be set to NULL in stead of some random value. And... TclWinCPUID is intel-specific, not Windows-specific: it can be implemented on UNIX and cygwin as well, the only requirement is that it has an Intel (or AMD) processor. The default implementation simply returns TCL_ERROR. The functions Tcl_WinUtfToTChar and Tcl_WinTCharToUtf had the problem that MAC_OSX has all UNIX functions as well, plus its own. Adding UNIX stub entries would mean that the two functions Tcl_MacOSXOpenBundleResources and Tcl_MacOSXOpenVersionedBundleResources would shift up!! So I used the trick to put the two new functions in the place of the max functions. Tricky, but it works. So the Tcl_MacOSXOpenBundleResources stub entry has its own function on OSX, it contains the function Tcl_WinUtfToTChar on cygwin, and it has NULL for other UNIXes. This makes the function Tcl_WinUtfToTChar effectively hidden from Cygwin, but - hey - that's exactly what we want because it should only be callable by win32 extensions. Keeping open, because tclInt.decls contains more functions that could be called by win32 extensions.
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [3570e4020c] (rid 106933) by nijtmans on 2012-03-20 17:54:38:
- resolution changed to: "Fixed"
Ticket change [81851ae747] (rid 117051) by dkf on 2012-03-22 16:26:11:
- icomment:
Note that this BROKE THE OSX BUILD on all the primary branches. Bumping prio until either this is rolled back (/shuffled off onto side branch) or fixed so that in appropriate leakage between platform-specific APIs no longer happens. (The name of the symbol is also inappropriate for a Unix API.) Undefined symbols: "_TclWinGetPlatformId", referenced from: _tclIntPlatStubs in tclStubInit.o ld: symbol(s) not found - login: "dkf"
- mimetype: "text/plain"
- priority changed to: "9 Immediate"
- resolution changed to: "None"
- username: "dkf"
- icomment:
Ticket change [520f3b94eb] (rid 126244) by nijtmans on 2012-03-22 16:39:20:
- icomment:
OK, having a look.
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [5684322273] (rid 94334) by nijtmans on 2012-03-22 17:05:57:
- icomment:
Unfortunately, Cygwin is UNIX, but it must have some Windows API's as well in order to be able to load win32 extensions. So, yes, TclWinGetPlatformId is appropriate. Cygwin is the only platform where this is actually implemented, for all other platforms the stub entry for TclpCreateTempFile is in this slot. Should be fixed now. Thanks!
- login: "nijtmans"
- mimetype: "text/plain"
- priority changed to: "5 Medium"
- resolution changed to: "Fixed"
- username: "nijtmans"
- icomment:
Ticket change [73502065e1] (rid 105026) by nijtmans on 2012-03-22 17:06:56:
- closedate changed to: "2012-03-22T10:06:56"
- closer changed to: "nijtmans"
- status changed to: "Pending"
Ticket change [302f6891cc] (rid 93204) by dkf on 2012-03-22 17:19:20:
- icomment:
Trunk compiles fine now. Thanks
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [4a21b6f543] (rid 126484) by nijtmans on 2012-04-25 20:33:51:
- icomment:
For Tcl, all win32 stub functions are implemented now for cygwin. Doing the same for the most important ones for Tk now (in the bug-3508771) branch
- login: "nijtmans"
- mimetype: "text/plain"
- status changed to: "Open"
- username: "nijtmans"
- icomment:
Ticket change [786c448ed3] (rid 89960) by wordtech on 2012-04-26 07:57:03:
- icomment:
Bumping the priority of this bug to 9 and changing resolution to "none" because the recent changes to tclStubInit.c cause a segfault on Wish on OS X from trunk, and (according to dkf) on 8.5 as well. Wish segfaults on startup when trying to run TclMacOSXNotifierAddRunLoopMode in the notifier. I've confirmed that the changes in this bug report are the culprit because when I back them out of tclStubInit.c and revert it to its 2011 version, Wish starts up fine. I'm reluctant to patch tclStubInit.c because the changes are so extensive and I don't fully understand them, and I don't want to undo all the work you've put in here--but PLEASE take another look and ensure that these changes don't crash Wish on OS X. I will be glad to test any changes you make.
- login: "wordtech"
- mimetype: "text/plain"
- priority changed to: "9 Immediate"
- resolution changed to: "None"
- username: "wordtech"
- icomment:
Ticket change [1a1b0cc81f] (rid 122918) by dkf on 2012-04-26 17:36:30:
- icomment:
Context: https://core.tcl.tk/tcl/annotate?checkin=3caedf05df5f633f&filename=generic/tclStubInit.c There's a lot of churn in the OSX part, which is weird as OSX is definitely disjoint from Cygwin. (There's no reason for *ever* calling TclWinConvertError on OSX!)
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [cf6bc8f03f] (rid 112974) by nijtmans on 2012-04-26 17:38:43:
- icomment:
OK, I'll have a look
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [7bca7aa7d1] (rid 96964) by dkf on 2012-04-26 17:40:45:
- icomment:
The simplest fix is to just roll the changes to tclInt.decls back and rebuild. After all, OSX is a supported platform that was broken by this, and Cygwin is not a supported platform (especially if trying to do a mixed build).
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [cde3b6c423] (rid 95963) by nijtmans on 2012-04-26 17:47:15:
- icomment:
Should be fixed now. > Cygwin is not a supported That's what I'm trying to change, and I must say that it already is working quite well: 99%
- login: "nijtmans"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- username: "nijtmans"
- icomment:
Ticket change [41928981c2] (rid 116215) by nijtmans on 2012-04-26 17:47:34:
- closedate changed to: "2012-04-26T10:47:34"
- closer changed to: "nijtmans"
- status changed to: "Pending"
Ticket change [fa5dfbe7ac] (rid 91857) by dkf on 2012-04-26 19:19:12:
- icomment:
That fixed it for tk-cocoa-8-5-backport branch. Main Tk core-8-5-branch doesn't work currently; it's missing definitions for all those Win functions you've just added. :-) Not tested the 8.6 code yet; that's next...
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "None"
- status changed to: "Open"
- username: "dkf"
- icomment:
Ticket change [17d9c82d71] (rid 122566) by dkf on 2012-04-26 19:35:05:
- closedate changed to: "2012-04-26T12:35:05"
- closer changed to: "dkf"
- icomment:
allow_comments - 1 Works with Tk 8.6 too, provided I comment out the current unix entries for the tkPlat interface in tk.decls and run 'make genstubs' first. That is, it's the same problem as is on the 8.5 branch and it should be simple to fix (compat functions that Tcl_Panic would be step 1...) For future reference, adding stuff to (or rearranging!) a platform API when you can't build and test on that platform is a good way to get into trouble. Some things are *incredibly* finicky...
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "dkf"
Ticket change [2e95b6bc13] (rid 92921) by nijtmans on 2012-04-26 19:48:46:
- icomment:
Should be fixed now. > For future reference, adding stuff to (or rearranging!) a platform API when > you can't build and test on that platform is a good way to get into > trouble. Some things are *incredibly* finicky... Yes, I know. But I simply don't have access to OSX, so I don't know what to do about that, other than being very carefull. Apparently I am not carefull enough. The trouble comes from the fact that each platform has its own stub table which is organized differently. It would be much easier if there was only one stub table without that many modifications per platform, but it's not easy to change that. At least CYGWIN shows this pain, which I solved by combining the windows and UNIX stub tables into one. Making a separate table for CYGWIN would only compicate things more ;-( Anyway, I hope it works now, otherwise please let me know!
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [e675c42bba] (rid 104297) by nijtmans on 2012-04-26 19:48:47:
- closedate changed to: "2012-04-26T12:48:47"
- closer changed to: "nijtmans"
- icomment:
allow_comments - 0
- login: "nijtmans"
- mimetype: "text/plain"
- status changed to: "Pending"
- username: "nijtmans"
Ticket change [3bd568625a] (rid 112814) by dgp on 2012-04-26 19:54:14:
- icomment:
Tcl build is broken on unix on 8.5 and trunk. gcc -O2 -pipe -Wl,--export-dynamic tclAppInit.o -L/home/dgp/fossil/tcl8.5/unix -ltcl8.5 -ldl -lieee -lm \ -Wl,-rpath,/home/dgp/x86_64/linuxoldld/lib -o tclsh /home/dgp/fossil/tcl8.5/unix/libtcl8.5.a(tclStubInit.o):(.data.rel+0x8a8): undefined reference to `TclMacOSXGetFileAttribute' /home/dgp/fossil/tcl8.5/unix/libtcl8.5.a(tclStubInit.o):(.data.rel+0x8c0): undefined reference to `TclMacOSXMatchType' /home/dgp/fossil/tcl8.5/unix/libtcl8.5.a(tclStubInit.o):(.data.rel+0x8c8): undefined reference to `TclMacOSXNotifierAddRunLoopMode' collect2: ld returned 1 exit status NULLing out the undefined routines appears to be an effective fix, but I have no confidence poking around here without a lot more review. - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [7fd1db16fd] (rid 97625) by nijtmans on 2012-04-26 20:01:32:
- icomment:
Thanks! This should be fixed now.
- login: "nijtmans"
- mimetype: "text/plain"
- status changed to: "Open"
- username: "nijtmans"
- icomment:
Ticket change [4e87c8559d] (rid 125657) by wordtech on 2012-04-26 21:17:33:
- icomment:
Still can't build trunk on OS X: /Users/kevin/tcl-tk-fossil/tcl/generic/tclStubInit.c:1349: error: ‘Tcl_ZlibStreamGetZstreamp’ undeclared here (not in a function)
- login: "wordtech"
- mimetype: "text/plain"
- username: "wordtech"
- icomment:
Ticket change [4f96d7150a] (rid 125852) by dgp on 2012-04-26 21:27:50:
- icomment:
trunk checkins after 2e12143e3906901f7fe9 have introduced a segfault in test event-13.1 in a --enable-symbols=mem build of Tcl.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [67f624b9d7] (rid 102984) by dgp on 2012-04-26 21:35:28:
- icomment:
Hold on that claim.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [3b560374ae] (rid 112723) by dgp on 2012-04-26 21:37:44:
- icomment:
After bisecting, I can't repro it anymore. Can only guess I didn't have a fully clean build.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [4854f0fcde] (rid 99864) by dgp on 2012-04-26 21:47:50:
- icomment:
Remaining problem is just a compiler warning (this one from 8.5 branch tip): tclStubInit.c:513: warning: initialization from incompatible pointer type
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [b7c6bf50fd] (rid 128854) by wordtech on 2012-04-26 21:57:36:
- icomment:
A fresh checkout of trunk builds and runs cleanly on OS X--sorry for the false alarm. Must have been an issue with my setup. Thanks for the fixes.
- login: "wordtech"
- mimetype: "text/plain"
- username: "wordtech"
- icomment:
Ticket change [b18b1fcd55] (rid 98165) by nijtmans on 2012-04-26 22:01:56:
- closedate changed to: "2012-04-26T15:01:56"
- closer changed to: "nijtmans"
- icomment:
>tclStubInit.c:513: warning: initialization from incompatible pointer type Should be fixed now as well. Please confirm that everything is fixed now.
- login: "nijtmans"
- mimetype: "text/plain"
- status changed to: "Pending"
- username: "nijtmans"
Ticket change [067e3ef7e7] (rid 89236) by dgp on 2012-04-26 22:12:13:
- closedate changed to: "2012-04-26T15:12:13"
- closer changed to: "dgp"
- icomment:
allow_comments - 1 Appears good now.
- login: "dgp"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "dgp"
Ticket change [b1023ea033] (rid 98073) by nijtmans on 2012-04-26 22:14:07:
- icomment:
Many thanks to all!
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [95d76ae7bd] (rid 106222) by nijtmans on 2012-06-13 21:53:04:
- icomment:
It turns out that loading dde.dll in cygwin still doesn't work completely. As dde client there are no problems, but as dde server no events are handled at all. The reason is clear: the cygwin (unix) event loop doesn't handle win32 events, simply because it doesn't know anything about it. So, let's extend the cygwin notifier to do that First attempt committed in bug-3508771 branch. Still incomplete.
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [64e3b8b3f8] (rid 92850) by nijtmans on 2012-06-13 21:53:06:
- icomment:
allow_comments - 0
- login: "nijtmans"
- mimetype: "text/plain"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- username: "nijtmans"
- icomment:
Ticket change [3726fc6649] (rid 107227) by nijtmans on 2012-06-22 15:33:36:
- icomment:
First working version committed of Cygwin notifier (branch bug-3508771), which can handle both Windows and UNIX event.s.
- login: "nijtmans"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- username: "nijtmans"
- icomment:
Ticket change [4b0b192dc4] (rid 126631) by nijtmans on 2012-06-23 14:33:15:
- closedate changed to: "2012-06-23T07:33:15"
- closer changed to: "nijtmans"
- icomment:
allow_comments - 1 Notifier modifications now committed to all open branches. So, the Cygwin port can now handle win32 events, when compiled with --enable-threads
- login: "nijtmans"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "nijtmans"