Artifacts Associated With Ticket 5d6de65036
Ticket change [37a862a79d] (rid 157702) by dgp on 2017-11-03 16:11:02:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
First posted in a stackoverlow question: https://stackoverflow.com/questions/47099580/tcl-package-require-loads-the-wrong-package-version % package prefer stable % package ifneeded p 1.4a1 {package provide p 1.4a1} % package ifneeded p 1.1 {package provide p 1.1} % package require p 1.1 1.4a1 The search loop in PkgRequireCore() is simply wrong. - foundin initialized to: "8.5+"
- is_private initialized to: "0"
- login: "dgp"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Severe"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "39. Package Manager"
- title initialized to:
[package require] misses stable options with stable preference
- type initialized to: "Bug"
Ticket change [7ac72e6564] (rid 157830) by dgp on 2017-11-06 00:07:50:
- assignee changed to: "aku"
- icomment:
aku, maybe you should take the first try at this, because looking over the code is filling me with the impulse for a substantial rewrite. (Available version lists kept sorted). If you can devise a less radical fix that may be more appropriate on the 8.5 branch.
- login: "dgp"
- mimetype: "text/plain"
Ticket change [bfeaa76cfc] (rid 157835) by dgp on 2017-11-06 00:11:33:
- icomment:
Branch bug-5d6de65036 contains a test case demonstrating the bug to be fixed.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [a5ae87c0fa] (rid 158255) by aku on 2017-11-13 19:06:11:
- icomment:
See commit [12e286e121] for my fix. No radical change. Kept a single search loop with choice after its completion. Simply made sure that a failure in the first comparison of each iteration does not prevent the comparison for stable to be run. Moved the requirements check before both. Passes the extended testsuite. If acceptable, please merge. A more radical approach would be to move the search loop into a separate function, add flag to distinguish search for stable vs search for any. Then run search for any if stable is not requested, or search for stable failed to find anything. Comment indicated that the list of available versions is sorted ? Ascending or descending ? If descending we can take first element matching our criteria and then stop. For ascending I see no way to an early stop.
- login: "aku"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [2ae7091c8e] (rid 158256) by aku on 2017-11-13 19:06:32:
- comment changed to:
First posted in a stackoverflow question: https://stackoverflow.com/questions/47099580/tcl-package-require-loads-the-wrong-package-version % package prefer stable % package ifneeded p 1.4a1 {package provide p 1.4a1} % package ifneeded p 1.1 {package provide p 1.1} % package require p 1.1 1.4a1 The search loop in PkgRequireCore() is simply wrong. - login: "aku"
- mimetype: "text/plain"
- comment changed to:
Ticket change [251b9f1be8] (rid 158258) by jan.nijtmans on 2017-11-14 08:44:35:
- icomment:
I think this looks good for 8.5. So her's my +1 to merge (FWIW).
- login: "jan.nijtmans"
- mimetype: "text/plain"
- icomment:
Ticket change [f2ed3b3225] (rid 158263) by dgp on 2017-11-14 13:37:42:
- icomment: "Thank you for the fix. I am merging it forward."
- login: "dgp"
- mimetype: "text/plain"
Ticket change [8b355d1941] (rid 158264) by dgp on 2017-11-14 13:43:15:
- icomment:
We have to prioritize correctness over other things. Clarity is usually the right second place. Performance after those. The prior implementation, I believe, was complicated out of an optimization attempt to minimize calls to SomeRequirementSatisfied(). Too bad that complicated often leads to wrong. It will be interesting to see if this change leads to fresh complaints about [package require] getting slower. There is ample room here for a refactoring that can improve both clarity and performance I think. Hopefully someone can find time to pursue that in the 8.7+ branches. Finally, I think there's still arguably a selection bug, though the spec is vague enough that I'm not certain. I will post that in a fresh ticket.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [9481b83da9] (rid 158281) by dgp on 2017-11-14 17:24:18:
- closedate changed to: "2458072.22521336"
- closer changed to: "dgp"
- icomment: "Merge completed."
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [eabe8b3ef4] (rid 158282) by aku on 2017-11-14 17:38:33:
- closedate changed to: "2458072.2351094"
- closer changed to: "aku"
- icomment:
> We have to prioritize correctness over other things. Yes, of course. Apologies if anything I said came across as not advocating that. That was definitely not my intention. > Clarity is usually the right second place. > Performance after those. True as well. > The prior implementation, I believe, was complicated > out of an optimization attempt to minimize calls to > SomeRequirementSatisfied(). I honestly do not remember anymore. > There is ample room here for a refactoring that can > improve both clarity and performance I think. Yes. The text starting from `A more radical approach ...` were my notes and thoughts on that matter so far. > Finally, I think there's still arguably a selection bug, > though the spec is vague enough that I'm not certain. I > will post that in a fresh ticket. Ok. Keeping my eyes open for it.
- login: "aku"
- mimetype: "text/plain"