Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 836375 - portage doesn't update mtimedb["ldpath"] leading to excessive ldconfig runs
Summary: portage doesn't update mtimedb["ldpath"] leading to excessive ldconfig runs
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on: 837899
Blocks: 835380
  Show dependency tree
 
Reported: 2022-03-29 15:59 UTC by SpanKY
Modified: 2023-05-26 13:44 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emege-info.log,22.57 KB, text/plain)
2022-03-29 15:59 UTC, SpanKY
Details

Note You need to log in before you can comment on or make changes to this bug.
Description SpanKY gentoo-dev 2022-03-29 15:59:23 UTC
Created attachment 768151 [details]
emerge --info

not sure when this started.  i'm seeing it with 3.0.21 & 3.0.28 & 3.0.30 for sure.

it's easy to reproduce with pax-utils which shouldn't really be causing cache rebuilds since it doesn't install any lib files that ldconfig would touch.

# touch /lib64
# emerge -bOv pax-utils |& grep ld.so.cache
>>> Regenerating /etc/ld.so.cache...
# emerge -KOv pax-utils |& grep ld.so.cache
>>> Regenerating /etc/ld.so.cache...
# emerge -KOv pax-utils |& grep ld.so.cache
>>> Regenerating /etc/ld.so.cache...
Comment 1 Mike Gilbert gentoo-dev 2022-03-31 16:54:13 UTC
A bisect would be helpful.
Comment 2 Larry the Git Cow gentoo-dev 2022-04-13 15:34:39 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=964c0e16172b76a8ebdd737cd8919870ae2b5f96

commit 964c0e16172b76a8ebdd737cd8919870ae2b5f96
Author:     Mike Frysinger <vapier@chromium.org>
AuthorDate: 2022-03-29 13:56:55 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-04-13 15:34:30 +0000

    vartree: skip env-update if no updates were merged
    
    This speeds up virtual/ installs by not constantly re-running env-update.
    
    [sam: cherry-picked from chromiumos' third_party/portage_tool repo]
    (cherry picked from commit 87ac3566ebb7155a57876d345849bd0fd6878c0e)
    
    Bug: https://bugs.gentoo.org/836375
    Signed-off-by: Sam James <sam@gentoo.org>

 lib/portage/dbapi/vartree.py | 38 +++++++++++++++++++++-----------------
 1 file changed, 21 insertions(+), 17 deletions(-)
Comment 3 Zac Medico gentoo-dev 2022-04-15 19:10:26 UTC
The reason that mtimedb["ldpath"] doesn't update is that the env_update call occurs in a subprocess via the MergeProcess class. So, changes to the prev_mtimes dictionary which occur in the subprocess do not propagate back to the mtimedb in the parent process.
Comment 4 Larry the Git Cow gentoo-dev 2022-04-20 20:24:52 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=e893f4fc12eb618318b1945ce7a05a94fb1ea1b4

commit e893f4fc12eb618318b1945ce7a05a94fb1ea1b4
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2022-04-17 19:12:40 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2022-04-18 02:18:31 +0000

    MergeProcess: propagate mtimedb["ldpath"] to parent process (bug 836375)
    
    Use an instance of multiprocessing.Pipe to propagate mtimedb["ldpath"]
    from the MergeProcess child process to the parent process. This fixes
    env_update calls to avoid unnecessary regeneration of ld.so.cache in
    cases where mtimedb["ldpath"] has not changed since the last call to
    env_update.
    
    Bug: https://bugs.gentoo.org/836375
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/portage/dbapi/_MergeProcess.py | 22 ++++++++++++++++++++++
 lib/portage/dbapi/vartree.py       | 10 ++++++++++
 2 files changed, 32 insertions(+)