From: SourceForge.net <no...@so...> - 2007-06-07 22:43:03
|
Bugs item #1733117, was opened at 2007-06-08 02:39 Message generated for change (Comment added) made by flatworm You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1733117&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 38. Package Manager Group: current: 8.5a6 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Konstantin Khomoutov (flatworm) Assigned to: Don Porter (dgp) Summary: auto_path changes and avail package cacheing issues Initial Comment: Package managing code might in certain cases not notice the availability of a more recent version of a package X that was made available by modifying auto_path at runtime if package manager have already seen any version of package X at the scanning stage. How to trigger: 1) We have a package named, say, "foo" somewhere accessible via $auto_path; 2) Then by some means (usually by calling [package require something]) we cause the package manager to make its run through the $auto_path scanning the packages. After that the package manager will know that the package "foo" is available. 3) Then we add another direcroty to auto_path which makes some more recent version of the same package "foo" available to the package manager. (Use case: we want to locally override a certain package in the standard package hierarchy). 4) Then [package require foo] will fetch the original version (not the latest) since the package manager won't rescan the directories listed on auto_path. >From the Tclers' chatroom: [00:14]<jenglish> kostix - the default [package unknown] handler does keep track of auto_path adjustments -- if any pkgIndex.tcl diddles with auto_path (which, really, they shouldn't, but some do anyway...) it will scan the new directories too. [00:18]<jenglish> ... but IIRC the default [package unknown] handler has some short-circuiting logic; it might stop scanning for pkgIndex.tcl files once it finds a package that satisfies the requirements. The ways to overcome the problem are: 1) Add [package forget foo] before calling [package require foo]; 2) Specify the exact version in [package require] to make [package unknown] be not happy with the version of "foo" it already known about. My poposition is to make the package manager rescan the hierarchy on any change of auto_path (may be it's worth remembering the sorted list of normalized paths from auto_path and compare it with the similar list aquired from the changed auto_path to track changes which don't really change things). Changes to auto_path are rare and probably such change in behaviour won't lead to slowdowns. P.S. This issue is also confirmed to exist in 8.4.14 and .15 ---------------------------------------------------------------------- >Comment By: Konstantin Khomoutov (flatworm) Date: 2007-06-08 02:43 Message: Logged In: YES user_id=1350198 Originator: YES Correction: I don't mean "rescan packages when auto_path changes", I mean "Invalidate the cache of known packages when auto_path changes" so that any subsequent [package require] (or whatever) make the package manager to rescan the list of packages. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1733117&group_id=10894 |