Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 61c1d2a5e6b8b901f6bd7061710c614b8e4b3b0cc895e276865a28249f183a66
Ticket: 2990516fffffffffffffffffffffffffffffffff
TM default paths do not search custom --libdir
User & Date: aspect on 2019-03-02 07:14:36
Changes

  1. closer changed to: "nobody"
  2. comment changed to:
    The default paths set in [tcl::tm::path] are rooted at
    
    [file dirname [info library]]
    
    and
    
    [file join [file dirname [file dirname [file normalize [info nameofexecutable]]]] lib]
    
    The first wants to search near Tcl's script library which is
    a sensible place TMs might have been installed.
    
    The second is more problematic.  If one assumes [info nameofexecutable]
    is meant to be tclsh in its normal installed location, then the construction
    is attempting to produce the default value of $(libdir) for a Tcl install
    which is the right place for any TM containing binary parts to get
    installed.
    
    However, Tcl permits customization of $(libdir).  One place this is
    commonly used is on systems with both 32- and 64- bit collections
    of binaries installed.  On such systems a 64-bit build of Tcl might
    be customized to install into a $(libdir) like /usr/lib64 .  That path
    can never be constructed from the TM defaults, because that
    default hardcodes in the last element "lib".
    
    By analogy, the older [tclPkgUnknown] package discovery
    system potentially has the same problem, and has worked
    around it via the variable ::tcl_pkgPath where the actual
    configured value of $(libdir) gets stored and retrieved to
    eventually find its way onto the $::auto_path .  It's a rather
    ugly solution and I'm not recommending copying it.  Just
    noting that this is not a new problem to solve.
    
    I think the right place to find the value is in the result
    returned by the command
    
    [tcl::pkgconfig get libdir,runtime]
    
    This, of course, means we will have a renewed interest
    in making that command actually work.
    
  3. icomment:
    The second default could be described as downright dangerous for embedding 
    programs and starpacks.  It's also surprising if [info nameofexe] happens to 
    be a symlink.
    
    What would it take to fix this?  Is [tcl::pkgconfig get libdir,runtime] 
    still unreliable for this purpose?
    
    (anecdotally, I don't see any binary .tm's in the wild so I'm tempted to 
    argue for removing the second default altogether ..)
    
  4. login: "aspect"
  5. mimetype: "text/plain"
  6. severity changed to: "Minor"