Skip to content
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

Detect and handle unnecessary package reinstall (bug 915494) #1126

Conversation

zmedico
Copy link
Member

@zmedico zmedico commented Oct 9, 2023

Compare package rebuilds/reinstalls to installed packages of the same
exact version, and eliminate unecessary rebuilds/reinstalls triggered
solely by the @__auto_slot_operator_replace_installed__ set. This is
careful to obey the user's wishes if they have explicitly requested
for a package to be rebuilt or reinstalled for some reason.

The SonameSkipUpdateTestCase::testSonameSkipUpdateNoPruneRebuilds
test case shows that the new depgraph._eliminate_rebuilds method
eliminates a backtracking run that is needed for the
testSonameSkipUpdate test case to succeed via prune_rebuilds
backtracking which was added for bug 439688.

Bug: https://bugs.gentoo.org/915494

@zmedico zmedico marked this pull request as draft October 9, 2023 22:05
@zmedico zmedico force-pushed the bug_439688_identical_binpkg_unecessary_reinstall branch 7 times, most recently from 1dec035 to 867755a Compare October 11, 2023 14:55
@zmedico zmedico changed the title Detect and handle unnecessary binary package reinstall Detect and handle unnecessary binary package reinstall (bug 915494) Oct 11, 2023
@zmedico zmedico force-pushed the bug_439688_identical_binpkg_unecessary_reinstall branch from 867755a to c552b86 Compare October 12, 2023 01:04
@zmedico zmedico marked this pull request as ready for review October 12, 2023 01:06
@zmedico zmedico changed the title Detect and handle unnecessary binary package reinstall (bug 915494) Detect and handle unnecessary package reinstall (bug 915494) Oct 12, 2023
@zmedico zmedico force-pushed the bug_439688_identical_binpkg_unecessary_reinstall branch from c552b86 to 10c0789 Compare October 12, 2023 01:17
@thesamesam
Copy link
Member

thesamesam commented Oct 12, 2023

I suppose you can't come up with a test case without say, andrew's vdb?

I keep thinking we should have some way of summarising/serialising the "important bits" of a vdb so users can just run a command and dump it for the purposes of reproducing bugs..

@zmedico
Copy link
Member Author

zmedico commented Oct 12, 2023

Well, lib/portage/tests/resolver/soname/test_skip_update.py::SonameSkipUpdateTestCase::testSonameSkipUpdate can suffice as a test case if I add a parameter to disable prune_rebuilds backtracking. I'll do that now...

@zmedico zmedico force-pushed the bug_439688_identical_binpkg_unecessary_reinstall branch from 10c0789 to fde0b4f Compare October 12, 2023 01:47
@zmedico
Copy link
Member Author

zmedico commented Oct 12, 2023

Well, lib/portage/tests/resolver/soname/test_skip_update.py::SonameSkipUpdateTestCase::testSonameSkipUpdate can suffice as a test case if I add a parameter to disable prune_rebuilds backtracking. I'll do that now...

Now testSonameSkipUpdateNoPruneRebuilds will fail if _eliminate_rebuilds doesn't do the job that prune_rebuilds backtracking does in testSonameSkipUpdate.

@zmedico zmedico force-pushed the bug_439688_identical_binpkg_unecessary_reinstall branch from fde0b4f to f46ddfe Compare October 12, 2023 02:11
Copy link
Member

@thesamesam thesamesam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

lib/_emerge/depgraph.py Outdated Show resolved Hide resolved
@zmedico zmedico force-pushed the bug_439688_identical_binpkg_unecessary_reinstall branch from f46ddfe to b04acb3 Compare October 12, 2023 16:24
@zmedico zmedico force-pushed the bug_439688_identical_binpkg_unecessary_reinstall branch 4 times, most recently from 099921c to addfe5a Compare October 12, 2023 18:05
Compare package rebuilds/reinstalls to installed packages of the same
exact version, and eliminate unecessary rebuilds/reinstalls triggered
solely by the @__auto_slot_operator_replace_installed__ set. This is
careful to obey the user's wishes if they have explicitly requested
for a package to be rebuilt or reinstalled for some reason.

The SonameSkipUpdateTestCase::testSonameSkipUpdateNoPruneRebuilds
test case shows that the new depgraph._eliminate_rebuilds method
eliminates a backtracking run that is needed for the
testSonameSkipUpdate test case to succeed via prune_rebuilds
backtracking which was added for bug 439688.

Bug: https://bugs.gentoo.org/915494
Signed-off-by: Zac Medico <zmedico@gentoo.org>
@zmedico zmedico force-pushed the bug_439688_identical_binpkg_unecessary_reinstall branch from addfe5a to 4978b91 Compare October 12, 2023 18:37
@gentoo-bot gentoo-bot merged commit 4978b91 into gentoo:master Oct 12, 2023
10 checks passed
@zmedico zmedico deleted the bug_439688_identical_binpkg_unecessary_reinstall branch October 12, 2023 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants