Tk Source Code

View Ticket
Login
Ticket UUID: 3532186
Title: pkgIndex.tcl file complexity that's unwarranted
Type: Bug Version: obsolete: 8.5.11
Submitter: dgp Created on: 2012-06-05 14:39:27
Subsystem: 84. Unix Build Assigned To: jan.nijtmans
Priority: 9 Immediate Severity:
Status: Closed Last Modified: 2014-03-13 08:57:20
Resolution: Fixed Closed By: nijtmans
    Closed on: 2012-06-22 13:03:45
Description:
On the 8.5 and trunk branches, the pkgIndex.tcl file
for Tk just grew much more complex, and the need for
it is not apparent to me.

There is no need for the installed pkgIndex.tcl file to
account for all the possible DLLs and installation conventions
that might have been used.  At the time you install a
pkgIndex.tcl file, you know which kind of DLL you installed,
and where you're putting it, so you should install just the
right simple pkgIndex.tcl file that matches what you've done.
There should be no need to sort these things out again at
run time.
User Comments: nijtmans added on 2012-07-08 15:20:55:
Sorry, I had to compilcate it a bit more: It turns out that pkgIndex.tcl
files are sometimes read from a slave interpreter, which doesn't
have the $argv variable, so we have to test for existance of
this variable first before using it.

Fixed in core-8-4-branc, core-8-5-branch and trunk

nijtmans added on 2012-06-22 20:03:45:

allow_comments - 1

nijtmans added on 2012-06-15 12:45:06:
Backported fix to Tk 8.5 as well.

Thanks, Andreas!

Everything OK now?

andreas_kupries added on 2012-06-14 23:56:34:
=== 2012-06-14 ===
16:53:03 [e8136cdc7e] *CURRENT* Re-added PATCH_LEVEL to Tk's unix
         pkgIndex.tcl, lost by [60bd3f4fc5]. (user: andreask tags: trunk)

andreas_kupries added on 2012-06-14 23:48:23:
Confirmed that adding back the $(PATCH_LEVEL) is a fix.
Will commit that fix shortly.

dgp added on 2012-06-14 23:29:31:
See patch 60bd3f4fc5 to see where things went off.

http://core.tcl.tk/tk/ci/60bd3f4fc5d8b1a53887da3f22d60ca441c12bb6

dgp added on 2012-06-14 23:28:02:
Appears to be a simple copying error and not something
trickier.  the $(PATCH_LEVEL) didn't get copied in the
unix/Makefile.in.

dgp added on 2012-06-14 23:23:30:
These pkgIndex.tcl files are broken.  Reportedly
they cause the error:

"attempt to provide package Tk 8.6 failed: package Tk 8.6b2 provided instead"

nijtmans added on 2012-06-06 16:13:17:
On the Tk 8.4 branch, I already simplified it, but this
version was not promoted to 8.5 and 8.6 yet. Done
now. The original problem was that the cygwin dll was
installed in the ../bin directory, so a special pkgIndex
file for cygwin was needed anyway.

The use-case for the need for run-time distinction,
is when the cygwin build and the win32 build are
installed in the same directory. This is now possible
and very handy, because both tcl ports share the
same stub tables. This means that the win32 version
of Tk can be loaded in the cygwin version of Tcl, and
reverse (in theory, I don't know why anyone would want
the latter). Then there are two dll's (libtk8.6.dll and
libtk86.dll) available, which, in theory can be used
by both Cygwin and win32. When doing
"package require Tk" from cygwin, it depends on the
presence of the X11 environment which of the two
dll's are loaded, and that can be determined by the
presence of env(DISPLAY) or the presence of
the command line option "-display".

So, runtime determination of the presence of
cygwin X11 is the only option I see to make
this all possible.

B.T.W: This is meant for cygwin and win32
only, on other platforms everything is now
as before.

Is this acceptable to you?

Regards,
           Jan Nijtmans

andreas_kupries added on 2012-06-06 00:35:12:
Actually checkin db6c270430 the day before, on 8.4 branch.

And I agree with Don, the generated pkgIndex.tcl should be as simple as possible, i.e. simply match what is installed. If there are variants, sort them out at build time.

dgp added on 2012-06-05 22:13:50:
checkin 0cb2832ca4 2012-04-18 04:40:23
started this unwelcome change.