Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: ed287c942ce8cde939a2bb3db212372e2cdf4f14fae2153e32f66f2f10cace3a
Ticket: 006bef5d75f6fd6b12cdbb774cfa1faef94c7835
Tcl cannot run from an arbitrary build directory with --disable-zipfs
User & Date: apnadkarni on 2026-05-21 01:19:00
Changes

  1. comment changed to:
    (Below is with reference to the autoconf build system. The nmake build also has the same issue with OPTS=noembed.)
    
    If Tcl is built at an arbitrary location, say in `/tmp/90` and configured as 
    
    ```
    /mnt/c/src/tcltk/wip/tcl/unix/configure --prefix=/tmp/90install --disable-zipfs
    ```
    
    an attempt to run it as follows fails.
    
    ```
    apnadkarni@IO:/tmp/90$ LD_LIBRARY_PATH=`pwd` ./tclsh
    application-specific initialization failed: Cannot find a usable init.tcl in the following directories:
        /tmp/90install/lib/tcl9.0 /tmp/lib/tcl9.0 /lib/tcl9.0 /tmp/library /library /tcl9.0/library /tcl9.0.4/library /tcl9.0.4/library
    
    This probably means that Tcl wasn't installed properly.
    ```
    
    Note `make test|shell` succeed because they set `TCL_LIBRARY` to the library directory in the sources.
    
    I strongly suspect this is not new to 9.0 but now has assumed more importance for two reasons.
    
    - While the above would still fail prior to TIP 732, builds within the first level below the configure.ac directory would still work because of Tcl would go searching in multiple places hunting for init.tcl. TIP 732 restricts this. In any case, restoring the earlier searches does not fix the above problem.
    
    - Being able to run tclsh from the build directory has become more important due to the recent changes in support of a BI installer for packaging purposes when building extensions (including Tk). Admittedly, a selfish interest.
    
    I propose to fix this by introducing additional keys to the `tcl::pkgconfig` command. The command already includes keys `scriptdir,install`, `scriptdir,runtime`, `bindir,runtime` etc. I would like to add the key `scriptdir,build` which would hold the script directory path as of build time. The search for init.tcl would then include this path (it already includes the previous two).
    
    The keys returned by tcl::pkgconfig are not documented so I don't think adding new key(s) needs a TIP but happy to write one if folks are happy to vote!
    
    Any comments or alternative solutions?
    
  2. login: "apnadkarni"
  3. mimetype: "text/plain"