Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7edb53d31a49922b27f908c8a4bc2ba0ae6fb82f
Ticket: 695441ffffffffffffffffffffffffffffffffff
tcl_findLibrary does not look in $::auto_path
User & Date: dgp on 2003-03-03 09:01:01
Changes

  1. icomment:
    Logged In: YES 
    user_id=80530
    
    my strong preference is that no new package 
    uses [tcl_findLibrary], and packages that
    currently use [tcl_findLibrary] should try to
    move away from it.
    
    [tcl_findLibrary] exists to solve a problem that
    packages are much better off just not
    creating for themselves in the first place.
    
    For your example, just be sure to install 
    all files of Foo 1.0 [*] -- libFoo.so, fooInit.tcl,
    and pkgIndex.tcl  -- all in the same installation
    directory.  Then, pkgIndex.tcl should contain:
    
    package ifneeded Foo 1.0 [list source [file join $dir
    fooInit.tcl]]
    
    And fooInit.tcl should contain:
    
    load [file join [file dirname [info script]] libFoo[info
    sharedlibextension]] Foo
    
    Since your package includes binary files, it should
    be installed only on an appropriate platform, either
    under TCL_EXEC_PREFIX, or somewhere else
    that will be placed on auto_path only on appropriate
    platforms.
    
    I believe this approach is what TEA2 recommends.
    
    The older style of installing binary parts under
    TCL_EXEC_PREFIX and cross-platform parts
    under TCL_PREFIX is what led to the need
    for [tcl_findLibrary] to allow the package to find
    its missing half.  The only benefit of that scheme
    was to save disk space on file servers serving
    multi-platform clients, and that's largely an
    optimization of a bygone era.  Much better for
    runtime sanity and for uninstall capability to
    put all parts of an installed package in just
    one place.  
    
    [*] FWIW, I'd rather you named the package
    "foo" rather than "Foo".
    
    
  2. login: "dgp"
  3. mimetype: "text/plain"
  4. username: "dgp"