From: <no...@tc...> - 2025-06-09 02:18:52
|
Automated mail by fx, on behalf of no...@tc... Ticket Change [cc38258b39b5f29916e44c1224ea73f701f960dc253a6bf3f9c0b0c664ade4b9] [tcllib 2.0 install fails with default Tcl build] By marc_culler For Tcllib On 2025-06-09T02:10:33.618 Details https://core.tcl-lang.org/tcllib/tinfo?name=cc38258b39b5f29916e44c1224ea73f701f960dc253a6bf3f9c0b0c664ade4b9 Ticket https://core.tcl-lang.org/tcllib/tktview/e5f3dfc055cfd4cbd2928ff964413749f321c88e Changed Fields assignee: icomment: As mentioned on the Core list, the default path is also wrong on macOS. However, on macOS the script uses ::tcl_pkgPath, but that has the same value as auto_path on macOS and does not exist on Windows. The script would work correctly on macOS if it used the first path on the auto_path list, instead of the last. On Windows the correct path is the last one on the auto_path list, but the script does not use auto_path at all. The actual code is: if {[string match [info nameofexecutable]* [info library]]} { # Starkit set libdir [file join [file dirname [file dirname [info nameofexecutable]]] lib] } else { # Unwrapped. if {[catch {set libdir [lindex $::tcl_pkgPath end]}]} { set libdir [file dirname [info library]] } } The catch statement succeeds on macOS, giving the wrong answer, and fails on Windows causing the result of [info library] to be used. On Windows [info library] returns //zipfs:/lib/tcl/tcl_library. The default values of auto_path on linux, windows and macOS (with a framewor build) are as follows (where $PREFIX is the prefix on unix and the value of INSTALLDIR on Windows) linux: //zipfs:/lib/tcl/tcl_library //zipfs:/lib/tcl $PREFIX/lib Windows: //zipfs:/lib/tcl/tcl_library //zipfs:/lib/tcl $PREFIX/lib macOS: /Library/Frameworks/Tcl.framework/Versions/9.1/Resources/Scripts /Library/Frameworks/Tcl.framework/Versions/9.1/Resources /usr/local/lib $HOME/Library/Tcl /Library/Tcl $HOME/Library/Frameworks /Library/Frameworks /Library/Frameworks/Tk.framework/Versions For macOS many of those paths would never contain a package, and are unlikely to even exist. But that is more of a Tcl issue than a Tcllib issue. I think that one solution (given the current state of things) would be to use the first item in the auto_path which does not begin with "//zipfs:" as the default installation path. That is guaranteed to be a place where Tcl will look, and it is likely to also be a writable directory, at least in the case where one is running the installer as root on a unix system. ...((truncated)) login: marc_culler username: Marc Culler ------------------------------------------------------------ See Tcl/Tk development @ http://core.tcl-lang.org/ ------------------------------------------------------------ |