Skip to content
Tcl Source Code View Ticket
Login

View Ticket

tcl_findLibrary doesn't look in arch specific directory

Closed / Rejected219394ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 25 years ago
Descriptionplain2000-10-26 05:12:19
OriginalBugID: 6180 Bug
Version: 8.3.2
SubmitDate: '2000-08-29'
LastModified: '2000-08-29'
Severity: LOW
Status: UnAssn
Submitter: usman
ChangedBy: usman
OS: Linux-Red Hat
FixedDate: '2000-10-25'
ClosedDate: '2000-10-25'


The tcl_findLibrary procedure looks for a library in positions
relative to the executable. One of these positions is relative
to the Tcl library ([info library]). The others are relative to
the executable itself. The search path relative to the 
Tcl library does not consider an architecture specific library.

This means that if the executable is copied or linked to a different
location , extensions will fail to load.

So if Tcl library is here:
mypath/lib/tcl8.3

The system checks this:
mypath/lib/<package>

but not this:
mypath/<arch>/lib/<package>

Symptom is errors that show that tcl_findLibrary failed (but not
a "can't find package" error):

% ln -s <BUILD>/wish8.3 /tmp/wish
% /tmp/wish
% package require vu
Can't find a usable vu.tcl in the following directories: 
    <BUILD>/lib/vu2.0 /lib/vu2.0 /lib/vu2.0 /library /library /vu2.0/library /vu2.0/library

This probably means that vu wasn't installed properly.

Work around: use aliases instead of symlinks, or set the <EXTENSION>_LIBRARY
environment variable, which tcl_findLibrary can use.
dgp Ticket [219394ffff]: 2 changes [History diff]2001-02-08 08:12:36
dgp Ticket [219394ffff]: 1 change [History diff]2001-04-04 04:57:49
dgpplain2001-08-28 07:09:20
Logged In: YES 
user_id=80530

[tcl_findLibrary] exists to serve the extensions that
are written partly in C and partly in Tcl, such as Tk,
[incr Tcl], and vu.  The Tcl-coded portion of an
extension is called the "script library" of that extension.
[tcl_findLibrary] is intended to find and [source] one
master file of that script library to load the Tcl-coded
portion of the extension in the interp.

Notice that the code sought and evaluated by
[tcl_findLibrary] is architecture-independent Tcl code.
It makes no sense for [tcl_findLibrary] to go looking
for Tcl scripts in an architecture-dependent directory.
They should be installed under the arch-independent
$prefix, not under $exec_prefix.  For that reason, the
feature request is rejected.

The problem reported with the "vu" package above
is a bug in the installation procedures of that package
installing its script library under exec_prefix
instead of prefix:

http://sf.net/tracker/index.php?func=detail&aid=455943&group_id=11464&atid=111464

As observed in this request, the workaround for the end
user of a buggy package like vu in this example is the
setting of the VU_LIBRARY environment variable.
Log in (anonymous is fine) to add a comment.