Artifacts Associated With Ticket 695441ffffffffffffffffffffffffffffffffff
Ticket change [04a01a49c7] (rid 120035) by jenglish on 2003-03-01 04:09:33:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
The tcl_findLibrary procedure does not check the directories listed in $::auto_path when looking for the specified initialization script. This means that a combined script/binary package which calls tcl_findLibrary in its _Init() routine might not be able to find its own library, even though Tcl's package mechanism was able to find the binary library.
- foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "jenglish"
- subsystem initialized to: "None"
- title initialized to: "tcl_findLibrary does not look in $::auto_path"
- type initialized to: "RFE"
Ticket change [3cbf7db297] (rid 120961) by jenglish on 2003-03-01 11:20:57:
- icomment:
Logged In: YES user_id=68433 An example is probably in order: Suppose Foo 1.0 contains libFoo.so, fooInit.tcl, and pkgIndex.tcl, where pkgIndex.tcl says: package ifneeded Foo 1.0 [list load [file join $dir libFoo[info sharedlibextension]]] and Foo_Init() Tcl_Eval()s a startup script containing tcl_findLibrary Foo 1.0 1.0 fooInit.tcl FOO_LIBRARY Foo_Library If Foo1.0 is installed in one of the standard places (according to tcl_findLibrary), this will work. If it's stored in a nondefault location, [tclPkgUnknown] can find out about the package if $::auto_path is extended, but the package will still fail to load since tcl_findLibrary doesn't look in the same place(s) as [tclPkgUnknown]. Or is this an improper use of tcl_findLibrary?
- login: "jenglish"
- mimetype: "text/plain"
- subsystem changed to: "38. Init - Library - Autoload"
- username: "jenglish"
- icomment:
Ticket change [418e70add1] (rid 116211) by dgp on 2003-03-02 06:58:02:
- assignee changed to: "dgp"
Ticket change [7edb53d31a] (rid 97480) by dgp on 2003-03-03 09:01:01:
- icomment:
Logged In: YES user_id=80530 my strong preference is that no new package uses [tcl_findLibrary], and packages that currently use [tcl_findLibrary] should try to move away from it. [tcl_findLibrary] exists to solve a problem that packages are much better off just not creating for themselves in the first place. For your example, just be sure to install all files of Foo 1.0 [*] -- libFoo.so, fooInit.tcl, and pkgIndex.tcl -- all in the same installation directory. Then, pkgIndex.tcl should contain: package ifneeded Foo 1.0 [list source [file join $dir fooInit.tcl]] And fooInit.tcl should contain: load [file join [file dirname [info script]] libFoo[info sharedlibextension]] Foo Since your package includes binary files, it should be installed only on an appropriate platform, either under TCL_EXEC_PREFIX, or somewhere else that will be placed on auto_path only on appropriate platforms. I believe this approach is what TEA2 recommends. The older style of installing binary parts under TCL_EXEC_PREFIX and cross-platform parts under TCL_PREFIX is what led to the need for [tcl_findLibrary] to allow the package to find its missing half. The only benefit of that scheme was to save disk space on file servers serving multi-platform clients, and that's largely an optimization of a bygone era. Much better for runtime sanity and for uninstall capability to put all parts of an installed package in just one place. [*] FWIW, I'd rather you named the package "foo" rather than "Foo".
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [efc877cf33] (rid 109059) by jenglish on 2003-03-04 06:56:48:
- icomment:
Logged In: YES user_id=68433 Calling tcl_findLibrary from the package _Init() routine is useful since it works for statically loaded as well as dynamically loaded packages. Plus, it provides useful hooks for overriding the library path from the environment (for e.g., debugging) and from the application (for e.g., tclkits). BTW, I agree that the script and binary parts should always be installed in the same place. However, for statically-linked, statically-loaded packages there might not be a separate binary part (or even a pkgIndex.tcl). Basically: if the binary part loads the script part, the package can work as a Tcl_StaticPackage() or be dynamically loaded with no code changes. The other way around, it can't.
- login: "jenglish"
- mimetype: "text/plain"
- username: "jenglish"
- icomment:
Ticket change [246fc4f6b5] (rid 131107) by dgp on 2003-04-17 04:03:07:
- icomment:
Logged In: YES user_id=80530 FWIW... I notice that on Max OS X only, the ::tcl_pkgPath is also searched. This seems like a half-fulfillment of this feature request on a single platform.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [afc1e72066] (rid 97865) by dgp on 2003-07-04 05:55:18:
- icomment:
Logged In: YES user_id=80530 see also Tk Bug 765642
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [a13dd2f921] (rid 109685) by andreas_kupries on 2003-07-04 06:02:02:
- icomment:
Logged In: YES user_id=75003 IMHO. From my POV the script part of a package FOO should simply be another package, maybe named 'FOO-tcl' or some such. Then the binary part can simply 'package require' the thing and it does not matter there the script part is located. The package search mechanism will be enough and obviates the need for 'another' search algorithm to locate stuff.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Ticket change [ed3bae20ce] (rid 103842) by dgp on 2003-07-04 06:21:28:
- icomment:
Logged In: YES user_id=80530 Economy of search algorithms is attractive, I agree. I don't think the two package answer really works though, because we really don't have two packages. Presumably package FOO (in this case, Tk) needs package FOO-tcl to work correctly, while at the same time FOO-tcl makes use of commands provided by FOO. Circular dependency is immediate evidence that there's really only one package here (one unit of loading).
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [9e67d17d3a] (rid 96468) by dgp on 2003-07-16 19:59:33:
- priority changed to: "8"
Ticket change [7befd1319d] (rid 96991) by dgp on 2003-10-07 00:14:07:
- priority changed to: "5 Medium"
Ticket change [2e932da10d] (rid 119244) by dgp on 2004-08-19 03:37:16:
- icomment:
Logged In: YES user_id=80530 Attached patch changes the search path to include directories in the $::auto_path and the scriptdir,runtime in the package's configuration, if any. Some obsolete directories that should be included in auto_path when relevant were also dropped. Testing invited.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [67ca6394d6] (rid 102951) by dgp on 2004-08-19 03:37:17:
- icomment:
File Added - 98323: 695441.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [44ff8ddc22] (rid 116805) by dgp on 2004-08-19 23:18:55:
- icomment:
Logged In: YES user_id=80530 Patch is incompatible with Safe Base, which apparently does not allow [file normalize] in a safe interp.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [c4dbe017f8] (rid 111906) by dgp on 2004-08-19 23:56:54:
- icomment:
File Deleted - 98323: File Added - 98426: 695441.patch Logged In: YES user_id=80530 updated patch should correct the safe interp glitch.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Add attachment "695441.patch" [8ed5049932] (rid 120182) by dgp on 2004-08-19 23:56:54.
Ticket change [5870aef99b] (rid 117802) by dgp on 2004-08-24 00:40:08:
- assignee changed to: "hobbs"
- icomment:
Logged In: YES user_id=80530 patch committed to HEAD. Assigning to tclguy to judge whether an 8.4 backport is also appropriate.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
Ticket change [00618f9e5a] (rid 119312) by dgp on 2004-10-27 00:02:52:
- icomment:
Logged In: YES user_id=80530 what portion of this, if any, should be backported, should be sorted out before 8.4.8 release.
- login: "dgp"
- mimetype: "text/plain"
- priority changed to: "9 Immediate"
- username: "dgp"
- icomment:
Ticket change [a0e49490b9] (rid 96888) by dgp on 2004-11-16 06:00:14:
- assignee changed to: "dgp"
Ticket change [822d293036] (rid 117186) by dgp on 2004-11-17 00:19:58:
- status changed to: "Closed"
Ticket change [363b76aa9e] (rid 107077) by dgp on 2004-11-17 00:19:59:
- closedate changed to: "2004-11-16T17:19:59"
- closer changed to: "dgp"
- icomment:
Logged In: YES user_id=80530 modified version backported for Tcl 8.4.8.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Accepted"
- username: "dgp"