Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: c02382bc881c7d3325610379f7456b85b6a0acf810dd548264c50c782756194f
Ticket: dad36af8e573011e034bff3bfa051292b6e0159d
TCL_PACKAGE_PATH seems broken
User & Date: RogerO on 2024-09-19 09:24:50
Changes

  1. comment changed to:
    I am trying to use Tcl 8.6.15 on a Linux (openSUSE Tumbleweed) system. Not a newbie here. In the build of the latest 8.6.15, I have a problem with TCL_PACKAGE_PATH. When building, we define it via an environment variable:
    
    export TCL_PACKAGE_PATH="%scriptdir %_datadir/tcl"
    
    The build sets it as follows in tclConfig.sh:
    
    TCL_PACKAGE_PATH='/usr/lib64/tcl /usr/share/tcl'
    
    So I'm happy with the paths. These are the two directories in which to find packages.
    
    When I package require a package in, say /usr/share/tcl, it says the package cannot be found.
    
    I did a trace on the running program, and I see what I think are mysterious paths being explored. In #1 and #2 (below) there is a space after the path name. In #3 the full TCL_PACKAGE_PATH is being used. Close, but no cigar.
    
    read(0, "package require rsoft\n", 4096) = 22
    readlink("/usr", 0x7ffd5d2af6c0, 1023)  = -1 EINVAL (Invalid argument)
    readlink("/usr/lib64", 0x7ffd5d2af6c0, 1023) = -1 EINVAL (Invalid argument)
    readlink("/usr/lib64/tcl ", 0x7ffd5d2af6c0, 1023) = -1 ENOENT (No such file or directory)    <--- Mysterious #1
    access("/usr", F_OK)                    = 0
    access("/usr/lib64", F_OK)              = 0
    access("/usr/lib64/tcl ", F_OK)         = -1 ENOENT (No such file or directory)              <--- Mysterious #2
    readlink("/usr", 0x7ffd5d2af6c0, 1023)  = -1 EINVAL (Invalid argument)
    readlink("/usr/lib64", 0x7ffd5d2af6c0, 1023) = -1 EINVAL (Invalid argument) 
    openat(AT_FDCWD, "/usr/lib64/tcl /usr/share/tcl/tclIndex", O_RDONLY) = -1 ENOENT (No such file or directory)  <--- Mysterious #3
    readlink("/usr", 0x7ffd5d2af6c0, 1023)  = -1 EINVAL (Invalid argument)
    readlink("/usr/lib", 0x7ffd5d2af6c0, 1023) = -1 EINVAL (Invalid argument)
    openat(AT_FDCWD, "/usr/lib/tclIndex", O_RDONLY) = -1 ENOENT (No such file or directory)
    readlink("/usr", 0x7ffd5d2af6c0, 1023)  = -1 EINVAL (Invalid argument)
    readlink("/usr/lib64", 0x7ffd5d2af6c0, 1023) = -1 EINVAL (Invalid argument)
    readlink("/usr/lib64/tcl", 0x7ffd5d2af6c0, 1023) = -1 EINVAL (Invalid argument)
    openat(AT_FDCWD, "/usr/lib64/tcl/tclIndex", O_RDONLY) = -1 ENOENT (No such file or directory)
    readlink("/usr", 0x7ffd5d2af720, 1023)  = -1 EINVAL (Invalid argument)
    readlink("/usr/lib64", 0x7ffd5d2af720, 1023) = -1 EINVAL (Invalid argument)
    readlink("/usr/lib64/tcl", 0x7ffd5d2af720, 1023) = -1 EINVAL (Invalid argument)
    readlink("/usr/lib64/tcl/tcl8.6", 0x7ffd5d2af720, 1023) = -1 EINVAL (Invalid argument)
    openat(AT_FDCWD, "/usr/lib64/tcl/tcl8.6/tclIndex", O_RDONLY) = 3
    
    And there is this:
    
    % puts $::auto_path
    /usr/lib64/tcl/tcl8.6 /usr/lib64/tcl /usr/lib {/usr/lib64/tcl /usr/share/tcl}
    
    Are we specifying the paths incorrectly? This is how it has been done in previous releases. And it worked then. But not in 8.6.15.
    
  2. login: "RogerO"
  3. mimetype: "text/plain"