New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed base package replacers being removed incorrectly #11629
Fixed base package replacers being removed incorrectly #11629
Conversation
I've investigated this problem more in-depth and I don't think this is the right solution. In fact, I think the bug is not even related to #11449 at all. I'm assuming that 11449 just by coincidence raised another issue to the surface. I'm trying to explain where I think the actual bug resides: If you run the test case from #11626 and diff the logic between 2.5.8 and current main, for both versions, the bug is actually that In 2.5.8, however, this was not an issue because the package was re-added to the pool again in a later step. This does not happen in So I think the actual bug here is the |
I had a short night so take this with a grain of salt but after looking at this my impression is that the unlockPackage call is correct here, and it correctly removes the package which was loaded from the lock file, but then the The root package not being checked there is probably simply an omission, and it seems reasonable to me that it would trigger a package load once the package is unlocked. But anyway I got another fix which also works and is maybe more general as it handles it at the place where other unlocked packages get loaded, I'm not sure which is best to be honest. See #11634 |
I see, I'd vote to leaving it in the |
Yeah both are really fine by me and more or less equivalent I think. @naderman any also-sleep-deprived counter opinion? 😆 |
Finally understood why this fix works on the original bug report. drupal/core removed the replace for drupal/classy in some 9.x version. The update of drupal/paragraphs with all deps means however that some older drupal/core version compatible with the selected versions (^9.2) get loaded which still have the replace. This in turn results in drupal/classy getting unlocked as it is now also part of "-W/with-all-dependencies" for the update. As the actually chosen newer drupal version does not replace drupal/classy, the package itself needs to be loaded. That doesn't currently happen because loading of root requirement packages on replace unlocking is missing. So this is right. Going to still add a test specifically for this scenario outside of the multi repo replace unlocking one that had to be updated here by coincidence. |
Worked out a test reproducing this which fails on main. Added here. |
Makes sense! Thanks for the test - funny we had one already ( |
Fixes #11626
If the replaced package is part of the require request itself, we must also load it. We actually incorrectly adjusted the test in #11449.
I hope the changes are correct, requesting a review by @naderman :)