Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 3ef925ec7754fa87992501d1dab662b11ee149bf
Ticket: 579617ffffffffffffffffffffffffffffffffff
encodings can't be found
User & Date: jcw on 2002-07-10 13:09:22
Changes

  1. assignee changed to: "dgp"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Context: tclkit, which uses the std unix/tclAppInit.c, 
    but overrides Tcl_AppInit (using TCL_LOCAL_APPINIT).
    
    Basic logic, from my (fragmentary) understanding:
       std main starts
       does a Tcl_FindExecutable
       launches custom tclkit_AppInit
       loads a few static extensions
       sets up a preinit script [1]
       call Tcl_Init
    
    The tclkit init code is relatively small, it's at:
       http://www.equi4.com/metakit/viewcvs.cgi/*checkout*/
    tclkit/src/kitInit.c?rev=1.9
    
    [1] The preinit script is the one that loads TclVFS 
    which provides scripting access to the VFS C layer in 
    the Tcl core.
    
    ----
    Observed behavior: on Unix/Linux, "encoding system" 
    returns "identity".  UNLESS the executable is run on the 
    build machine - THEN it find the installed encodings due 
    to the fact that it remembers (!) a static absolute path 
    of where the tcl8.4/ area is installed.
    ----
    
    The special situation in Tclkit is that it stores 
    encoding files inside a VFS, and that it uses a bit of 
    Tcl scripting to set things up *before* encoding files 
    can be accessed.
    
    Therefore the first call to Tcl_FindExecutable will not 
    be able to get encodings right - nor even a call to 
    Tcl_SetDefaultEncodingDir - because at least one interp 
    has to run scripts before VFS is ready.
    
    For that reason, Tclkit includes a "librarypath" command 
    coded in C, written by Vince Darley, which gets called 
    from Tcl as soon as the VFS mount is in place.  The code 
    for this is a few dozen lines, see:
       http://www.equi4.com/metakit/viewcvs.cgi/*checkout*/
    tclkit/src/pwb.c?rev=1.6
    
    The essential calls there are:
            TclSetLibraryPath(Tcl_NewListObj(1,&path));
            TclpSetInitialEncodings();
            Tcl_FindExecutable(Tcl_GetVar(interp, "argv0", 
    TCL_GLOBAL_ONLY));
    
    What happens, is that Tcl_FindeExecutable gets called a 
    second time - not sure why this is needed.
    
    Any help on this issue would be greatly appreciated - 
    I'm sort of way beyond my understanding of how things 
    work or could be made to work...
    
    Perhaps unrelated, but worth noting, is that tclkit also 
    has trouble when run through a symlink (this is 
    definitely of secondary imortance to me for now).
    
    
  4. foundin changed to: "None"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "jcw"
  9. subsystem changed to: "38. Init - Library - Autoload"
  10. title changed to: "encodings can't be found"
  11. type changed to: "Bug"