Skip to content
Tcl Source Code History Of Ticket 006bef5d75
Login

History Of Ticket 006bef5d75

Artifacts Associated With Ticket 006bef5d75

  1. Ticket change [70cf7adf51] (rid 253684) by apnadkarni on 2026-05-20 13:45:32:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-markdown"
    4. comment initialized 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,buildtime` 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?
      
    5. foundin initialized to: "9.0"
    6. is_private initialized to: "0"
    7. login: "apnadkarni"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "9546e9877f1a8899e25a89082561ee694e7fb402"
    10. resolution initialized to: "None"
    11. severity initialized to: "Important"
    12. status initialized to: "Open"
    13. submitter initialized to: "apnadkarni"
    14. subsystem initialized to: "53. Configuration and Build Tools"
    15. title initialized to:
      Tcl cannot run from an arbitrary build directory with --disable-zipfs
      
    16. type initialized to: "Bug"
  2. Ticket change [f8fc68d0c9] (rid 253695) by apnadkarni on 2026-05-21 01:17:46:

    1. icomment: "Proposed fix now in the [bug-006bef5d] branch."
    2. login: "apnadkarni"
    3. mimetype: "text/x-fossil-plain"
  3. Ticket change [ed287c942c] (rid 253696) by apnadkarni on 2026-05-21 01:19:00:

    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"
  4. Ticket change [81b83a1838] (rid 253727) by apnadkarni on 2026-05-21 08:25:05:

    1. icomment:
      Here is final fix: When running from the build directory, **and only when running from the build directory** tclsh will look in the source library directory for init.tcl. When running after installation, it should not and will not look there.
      
      The original use case arises from using the buildtree (uninstalled) tclsh when building extensions (including Tk). The above solves this without affecting installed tclsh'es which should not be looking into build trees.
      
      The change to pkgconfig is not necessary and not implemented.
      
      Above is for 9.1. No plans to back port to 9.0 which uses a very different initialization implementation (pre-TIP 732).
      
    2. login: "apnadkarni"
    3. mimetype: "text/x-markdown"
  5. Ticket change [b39b9ff999] (rid 253731) by apnadkarni on 2026-05-21 10:08:15:

    1. closedate changed to: "2461181.9224018287"
    2. closer changed to: "apnadkarni"
    3. login: "apnadkarni"
    4. mimetype: "text/plain"
    5. resolution changed to: "Fixed"
    6. status changed to: "Closed"