Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 55151 - Tk library can't be dynamically loaded from Tcl when starting i8kmon with gui
Summary: Tk library can't be dynamically loaded from Tcl when starting i8kmon with gui
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Doug Goldstein (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-25 06:31 UTC by Ulf Dreyer
Modified: 2004-09-15 04:20 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
pkgIndex-8.3.4.diff (pkgIndex-8.3.4.diff,1.71 KB, patch)
2004-08-12 03:04 UTC, Ming Zhao (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ulf Dreyer 2004-06-25 06:31:49 UTC
i8kmon gives me
    can't find package Tk
        while executing
    "package require Tk"

This is from i8k-Readme:

NOTE: it has been reported that on some Linux distributions i8kmon exits
with an error like this:

    can't find package Tk
        while executing
    "package require Tk"

This is not a bug in i8kmon. It means that Tcl/Tk files are not installed
correctly on your system and the Tk library can't be dynamically loaded
from Tcl. In this case you can run i8kmon with the command:

    wish /usr/bin/i8kmon -- [options...]

You should also report the bug to the maintainer of the Tcl/Tk packages
included in your Linux distribution. A quick fix for the problem could
also be adding the following line to /usr/lib/tk8.3/pkgIndex.tcl:

    package ifneeded Tk 8.3 [list load "/usr/lib/libtk8.3.so.1" Tk]

This works on Debian and maybe on other Linux distributions.

Reproducible: Always
Steps to Reproduce:
1.load kernel module
2.emerge i8kutils
3.call "i8kmon"  without "-d"

Actual Results:  
can't find package Tk
        while executing
    "package require Tk"


Expected Results:  
run i8kmon in gui-mode
Comment 1 Doug Goldstein (RETIRED) gentoo-dev 2004-08-06 19:29:47 UTC
Works for me. I'm the TCL / TK maintainer.

Which version of TCL and TK do you have? Can you provide me with an emerge info? Which version of i8kutils is this?
Comment 2 Doug Goldstein (RETIRED) gentoo-dev 2004-08-08 08:12:57 UTC
Well Ulf, when you get a chance please answer the requested questions and re-open this bug. Because I can't duplicate this problem using your instructions with the two current versions of i8kutils in Portage.
Comment 3 Ulf Dreyer 2004-08-09 07:00:46 UTC
  As requested here are my tcl tk version:
  tcl-7.3.4
  tk-8.3.4-r1

  I tested again by reemergin i8utils 1.17 and 1.25
  and also recompiled tcl and tk.
  Still the same message:

---------------------------------
can't find package Tk 8.3
    while executing
"package require Tk $tcl_version"
    (procedure "make_ui" line 16)
    invoked from within
"make_ui"
    (procedure "main" line 4)
    invoked from within
"main"
    invoked from within
"if {$tcl_interactive == 0} {
    main
    vwait forever
}"
    (file "/usr/bin/i8kmon" line 734)
---------------------------------



Here is the result of emerge info:
(additional comments below)
---------------------------------

Gentoo Base System version 1.4.16
Portage 2.0.50-r9 (default-x86-1.4, gcc-3.3.3, glibc-2.3.3.20040420-r0, 2.6.7-gentoo-r8)
=================================================================
System uname: 2.6.7-gentoo-r8 i686 Mobile Intel(R) Pentium(R) 4 - M CPU 1.80GHz
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -mcpu=pentium4 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/X11 /etc/cron.daily /etc/foomatic /etc/gconf /etc/rsync /etc/sound /etc/sound/events /etc/ssh /etc/ssl /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -mcpu=pentium4 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="ftp:///ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://gentoo.inode.at/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X Xaw3d aalib alsa apm arts avi berkdb bonobo cdr crypt cups dga directfb divx4linux dvd emacs encode fbcon foomaticdb gdbm ggi gif gnome gpm gtk gtk2 gtkhtml imlib java jpeg libg++ libwww mad mikmod mmx motif mozilla mpeg ncurses nls oggvorbis opengl pam pcmcia pdflib perl png pnp ppds python quicktime readline sdl slang spell sse ssl svga tcltk tcpd tetex truetype x86 xml2 xmms xv zlib"

---------------------------------

The laptop is running gentoo for about one year,
running regular "emerge -uDv world".

As written in the original error report maybe
the /usr/lib/tk8.3/pkgIndex.tcl does not get properly 
updated.
Comment 4 Ming Zhao (RETIRED) gentoo-dev 2004-08-10 03:59:31 UTC
I think maybe it's caused by "package require Tk $tcl_version". 
Ulf's tcl's version is 7.3, but Tk's version is 8.3, so i8kmon will complain that "can't find package Tk".
Changing this line to "package require Tk" may fix this problem.
Comment 5 Ulf Dreyer 2004-08-10 06:08:41 UTC
Sorry, that TCL version has been a typo.
It should read
 tcl-8.3.4          // 8 instead of 7
  tk-8.3.4-r1

sorry!
Comment 6 Ming Zhao (RETIRED) gentoo-dev 2004-08-10 09:42:15 UTC
Ulf, could you write a test script with only a single line -- "package require Tk $tcl_version" (without quote), and run the script with tclsh and wish separately, then paste the console's output here?
Comment 7 Ulf Dreyer 2004-08-10 10:54:38 UTC
these are the script outputs:

tclsh tcl-test.sh
can't find package Tk 8.3
    while executing
"package require Tk $tcl_version
"
    (file "tcl-test.sh" line 1)
-----------------------------------------------------
wish tcl-test.sh

no output but a window opened (like it should)


Bye
Comment 8 Ming Zhao (RETIRED) gentoo-dev 2004-08-10 20:23:04 UTC
After downgrading Tk from 8.4.6 to 8.3.4-r1, I got the same error.
I found pkgIndex.tcl was totally missing in /usr/lib/tk8.3.
After creating pkgIndex.tcl in /usr/lib/tk8.3 manually, the bug can be fixed.
Comment 9 Ming Zhao (RETIRED) gentoo-dev 2004-08-12 03:03:10 UTC
According to Tk's CVS changelog, this bug has been fixed in 8.4(Makefile.in, http://cvs.sourceforge.net/viewcvs.py/tktoolkit/tk/unix/Makefile.in?rev=1.95&view=log).
I cut the changes from CVS and post a patch here, hoping it will work.
Changed in ebuild:
--- tk-8.3.4-r1.ebuild.old      2004-06-25 07:06:21.000000000 +0800
+++ tk-8.3.4-r1.ebuild  2004-08-12 18:00:15.322823296 +0800
@@ -40,6 +40,8 @@
        unpack ${A}
        cd ${S}/library
        epatch ${FILESDIR}/remove-control-v.diff
+       cd ${S}/unix
+       epatch ${FILESDIR}/pkgIndex-${PV}.diff
 }

Comment 10 Ming Zhao (RETIRED) gentoo-dev 2004-08-12 03:04:40 UTC
Created attachment 37272 [details, diff]
pkgIndex-8.3.4.diff
Comment 11 Ming Zhao (RETIRED) gentoo-dev 2004-08-21 01:55:44 UTC
Ulf, could you help test my patch?
Comment 12 Doug Goldstein (RETIRED) gentoo-dev 2004-09-14 22:51:24 UTC
Great work Ming. Ulf, if you can give that patch a test and then we'll be able to merge that into the tree.
Comment 13 Ulf Dreyer 2004-09-15 02:18:39 UTC
Sorry it took so long - first mail accidentally got marked as read.

The diff works for TK 8.3

But I guess since 8.4 is now marked stable it doesn't really matter :(
Comment 14 Ming Zhao (RETIRED) gentoo-dev 2004-09-15 02:29:55 UTC
But the bug can be closed, :)
Comment 15 Ulf Dreyer 2004-09-15 04:20:19 UTC
Done, sorry didn't know I had to do that.
Thought you would after it's merged.

Bye