Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2007-06-19
04:26 • Ticket [1738975fff] interp fails loading Tk status still Closed with 4 other... artifact: 641042bd6a user: dgp
04:20 • Ticket [1738975fff]: 4 changes artifact: 28760d5bed user: nobody
04:01 • Ticket [1738975fff]: 4 changes artifact: d60688fc8b user: andreas_kupries
2007-06-18
22:37 • Ticket [1738975fff]: 4 changes artifact: 8b8884a181 user: ctasada
22:30 • Closed ticket [1738975fff]. artifact: 6f761a2530 user: dgp
22:25 • Ticket [1738975fff]: 4 changes artifact: dc482598f4 user: ctasada
22:19 • Ticket [1738975fff]: 4 changes artifact: a3e4300776 user: dgp
22:09 • Open ticket [1738975fff]. artifact: 5ff12490b7 user: ctasada
22:01 • Pending ticket [1738975fff]. artifact: 44e3fdf990 user: dgp
17:42 • Ticket [1738975fff]: 2 changes artifact: 39984cee31 user: dkf
10:27 • New ticket [1738975fff]. artifact: 3eb08fe6f9 user: ctasada

interp fails loading Tk

Closed / Invalid1738975fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2007-06-18 10:27:40
When inside an interp we want to load Tk, we get an error

%interp create "myinterp"
myterp
% myinterp eval "package require Tk"
attempt to provide package Tk 8.5 failed: package Tk 8.5a6 provided instead

It's not a big problem, because I can catch it, but it's annoying.
dkf Ticket [1738975fff]: 2 changes [History diff]2007-06-18 17:42:02
dgpplain2007-06-18 22:01:32
Logged In: YES 
user_id=80530
Originator: NO


I cannot reproduce this with the
released versions of Tcl/Tk 8.5a6.

The symptom presented indicates
a bug in Tk's [package ifneeded] command.

A possibility is that you have an out
of date Tk installed (possibly in addition
to the one you think you are testing?)

After the error message appears,
what does

myinterp eval {package verions Tk}

return?
ctasadaplain2007-06-18 22:09:00
Logged In: YES 
user_id=340696
Originator: YES

% myinterp eval {package versions Tk}
8.5

I'm running "base-tk-thread-win32-ix86.exe" from ActiveTcl 8.5b7. The exe file ProductVersion sais 8.5a6.

Also, if I run a second time the command, I get:
% myinterp eval {package require Tk}
attempt to provide package Tk 8.5 failed: no version of package Tk provided
dgpplain2007-06-18 22:19:58
Logged In: YES 
user_id=80530
Originator: NO


um, the ActiveTcl distibutions don't
precisely match any release of Tcl.
They're development snapshot releases.
It's likely they're based on a state
of development before the real 8.5a6
release.
Is there a newer one you can upgrade
to that might clear the problem?

That said, it's still surprising that
Tcl and Tk would not work together
because the snapshots are taken at the
same time, I think.

Continuing the analysis, what does

myinterp eval {package ifneeded Tk 8.5}

return?
ctasadaplain2007-06-18 22:25:36
Logged In: YES 
user_id=340696
Originator: YES

% myinterp eval {package ifneeded Tk 8.5}

if [catch {load "" Tk}] {load C:/fw4_dev/make/buildexe/base-tk-thread-win32-ix86.exe/lib/tk8.5/libtk8.5.so Tk}

And reading the C:/fw4_dev/make/buildexe/base-tk-thread-win32-ix86.exe/lib/tk8.5/pkgIndex.tcl I get:
package ifneeded Tk 8.5 [format {
if [catch {load "" Tk}] {load %s Tk}
    } [list [file join $dir libtk8.5.so]]]

By the way, I'm running in Windows XP.

That really looks weird.
dgpplain2007-06-18 22:30:42
Logged In: YES 
user_id=80530
Originator: NO


Ok, we've tracked down the bug then.
In that [package ifneeded] command,
the first argument needs to be 8.5a6,
and not 8.5.

Tk's own index script doesn't look
like that.

This incorrect code appears to be
in some extra interface code that's
part of the Tk basekit, so the bug should
be reported to its developers.
ctasadaplain2007-06-18 22:37:22
Logged In: YES 
user_id=340696
Originator: YES

I'll, thanks.
andreas_kupriesplain2007-06-19 04:01:41
Logged In: YES 
user_id=75003
Originator: NO

Note: On Windows Tk is linked statically into the AS base-tk kit. The pkgIndex.tcl is quite bogus, true, it also not used.
nobodyplain2007-06-19 04:20:43
Logged In: NO 


It appears to still be used
when [package require Tk] is
in a slave interp.

If that's not how it's supposed
to work, then how is the
[package ifneeded] command for
Tk supposed to run in the slave
interp?
dgpplain2007-06-19 04:26:53
Logged In: YES 
user_id=80530
Originator: NO


another thing to consider is
that even if Tk is provided
statically, or if a correct
initial [package ifneeded]
command is put into place
referring to the static Tk
in the application, if the
broken pkgIndex.tcl remains
somewhere on the auto_path,
then it's available for
[source]-ing, and once its
[source]d any later 
[package require Tk] will
fail due.  If no other failure
case is evident, consider what
might happen after a [package forget].
Log in (anonymous is fine) to add a comment.