tcl::pkgconfig not updated for zipfs installs
Open404eaa51e1a1cc98ac2c64fb662cadf4f538f2adCreated 1 year agoUpdated 1 year ago
Descriptionplain2025-09-02 18:12:18
Some elements managed by the [tcl::pkgconfig] command are intended to report the installation locations where the current build of Tcl has been configured to place its component parts. In particular, the elements scriptdir,install and scriptdir,runtime should report the directory in which the init.tcl file will be installed. In Tcl 9, many configurations of Tcl place this file, and all of the other "script library" components, as well as encoding files, into a zip archive that is available as a virtual filesystem embedded directly in the binary, and not installed in any system file directory at all. In this configuration, these elements of [tcl::pkgconfig] should not falsely be claiming installation locations that are not used. This is a detail of zipfs archive adoption that was never completed. Either these elements should not appear at all, or if the pathname of the VFS location of init.tcl is reliably known, perhaps that should be stored instead.
Referenced by1
88abfff5c8Make a start for [404eaa51e1]. Not finished yet check-in2025-09-18 20:16:04
jan.nijtmanswiki2025-09-04 09:16:05
Even though those directories make no sense any more, it's parent directory makes sense. The most likely way this is used in extensions is to determine the path were Tcl modules can be installed by:
% file dirname [tcl::pkgconfig get scriptdir,runtime] /usr/lib
This directory can be appended with "tcl8/8.x" (or "tcl9/9.0") to find the directory where a module can be installed.
Changing this will break such usage, so I think it's best for now to keep this as-is. At least, an alternative to find "/usr/lib/tcl9" (moduledir???) should be provided.
dgpplain2025-09-08 18:44:21
Yes that looks like an older occasion where the elements of [tcl::pkgconfig list] was not updated to reflect the changes to `make install`. In Tcl 8.5, when [tcl::pkgconfig] originated, all the files were installed relative to SCRIPT_INSTALL_DIR. It appears that Tcl 8.6.11 introduced the MODULE_INSTALL_DIR, enabling redirecting the installation of Tcl Modules during configuration and build and install. We should have stored that info in the pkgconfig space at the time.
dgpplain2025-09-09 18:12:20
It seems that in a --enable-zipfs build of Tcl 9.0+ the configure script skips the setting of INSTALL_LIBRARIES which means `make install` does not install the script library, the encoding data files, or the modules, letting the program find all those things in an attached zipfs archive. The `make install-libraries` target is still available for the user to force the issue, but it's not normally active in this configuration. Whether we have the separate moduledir entries or not, we shouldn't be initializing any of them to places where we did not in fact install anything.
Log in (anonymous is fine) to add a comment.