Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 635474 - sys-apps/portage-2.3.12: postinst-qa-check.d checks produce false positives for rootfs in tmpfs
Summary: sys-apps/portage-2.3.12: postinst-qa-check.d checks produce false positives f...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 631448
  Show dependency tree
 
Reported: 2017-10-25 22:18 UTC by Rick Farina (Zero_Chaos)
Modified: 2018-01-29 02:10 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rick Farina (Zero_Chaos) gentoo-dev 2017-10-25 22:18:20 UTC
I hate hiding things behind the qa feature, but the scripts in https://github.com/gentoo/portage/tree/master/bin/postinst-qa-check.d are SUPER PAINFULLY slow on my system where the entire rootfs is in tmpfs, which I find unacceptable.  At any given moment, it appears that this is all my system is running.

Please hide these expensive checks behind FEATURES=qa or some new flag at your discretion.  I run FEATURES=qa on all dev boxes, but on my build box I won't see the logs unless it's a hard failure so this kind of thing is pointless.
Comment 1 Zac Medico gentoo-dev 2017-10-25 22:25:02 UTC
If it's doing something prohibitively expensive (as in bug 631454), then we really need to fix it, not just hide it behind a flag.
Comment 2 Zac Medico gentoo-dev 2017-10-25 22:39:49 UTC
I guess it's probably calling eqatag for an obscene number of files, as in bug 631454. We need to do something about that, it's just not acceptable.
Comment 3 Zac Medico gentoo-dev 2017-10-25 23:00:34 UTC
The fact that your root fs is on tmpfs explains the issue, since copying the files there would bump the ctime, and we're using -newercm (-cnewer) in postinst-qa-check.d.
Comment 4 Zac Medico gentoo-dev 2017-10-25 23:12:28 UTC
I think what we need to do is test for a positive result *before* the package is merged, and then simply disable the check in that case.
Comment 5 Zac Medico gentoo-dev 2017-10-26 05:00:52 UTC
A reasonable approach would be to have preinst-qa-check.d scripts that fix up the state, so that any problems found by the postinst-qa-check.d scripts can be blamed on the current package with a high level of confidence.
Comment 7 Rick Farina (Zero_Chaos) gentoo-dev 2017-10-26 19:42:17 UTC
forgive my naivity on this, but the current checks seem to check the entire filesystem instead of just the files you are installing, and the suggested patch doesn't appear to change that.

Wouldn't it be possible to check just the files you are installing?  As an example, I've been installing virtual/jpeg and stuck on this check for nearly 3 hours right now.....
Comment 8 Rick Farina (Zero_Chaos) gentoo-dev 2017-10-26 19:50:59 UTC
thanks to dwfreed for noticing, please return BEFORE the find in the case of known impossibility, such as parallel-install.  Although if this check ran on just the files being installed (before merge) that wouldn't be a limitation.
Comment 9 Zac Medico gentoo-dev 2017-10-26 20:01:41 UTC
(In reply to Rick Farina (Zero_Chaos) from comment #7)
> forgive my naivity on this, but the current checks seem to check the entire
> filesystem instead of just the files you are installing, and the suggested
> patch doesn't appear to change that.

The cost of the 'find' calls is relatively small, so that should not be a problem.

> Wouldn't it be possible to check just the files you are installing?  As an
> example, I've been installing virtual/jpeg and stuck on this check for
> nearly 3 hours right now.....

The really costly part is the eqatag call with an extremely large number of false-positive files, and the proposed patch will fix that.

(In reply to Rick Farina (Zero_Chaos) from comment #8)
> thanks to dwfreed for noticing, please return BEFORE the find in the case of
> known impossibility, such as parallel-install.  Although if this check ran
> on just the files being installed (before merge) that wouldn't be a
> limitation.

It's useful to keep the find calls in this case, since it will detect when update-desktop-database, update-mime-database, or gtk-update-icon-cache needs to be called.
Comment 10 Rick Farina (Zero_Chaos) gentoo-dev 2017-10-26 20:22:46 UTC
I will yield to your wisdom on this matter, as usual.  Is this patch ready for testing or should I hold off for some reason?
Comment 11 Zac Medico gentoo-dev 2017-10-26 20:29:43 UTC
(In reply to Rick Farina (Zero_Chaos) from comment #10)
> I will yield to your wisdom on this matter, as usual.  Is this patch ready
> for testing or should I hold off for some reason?

It's ready, please test.
Comment 12 Rick Farina (Zero_Chaos) gentoo-dev 2017-10-26 20:44:43 UTC
to further clarify, I am running FEATURES=parallel-install and this is still an issue for me (pre-patch).  I'm adding this note because I honestly don't fully understand what is going on here and so I'm trying to add detail which might be useful.
Comment 13 Larry the Git Cow gentoo-dev 2017-10-27 19:11:44 UTC
The bug has been referenced in the following commit(s):

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

commit 2f01a9fdc68740642cca25c0fcc7f1d1fc14c0ee
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2017-10-26 06:06:51 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2017-10-27 18:52:08 +0000

    postinst_qa_check: initialize preinst state (bug 635474)
    
    In order to prevent false-positives during postinst_qa_check,
    use a preinst_qa_check function to initialize a baseline state
    for the postinst checks.
    
    Bug: https://bugs.gentoo.org/635474

 bin/misc-functions.sh                  | 18 +++++++++++-------
 bin/postinst-qa-check.d/50gnome2-utils |  3 +++
 bin/postinst-qa-check.d/50xdg-utils    |  6 ++++++
 bin/preinst-qa-check.d/50gnome2-utils  |  1 +
 bin/preinst-qa-check.d/50xdg-utils     |  1 +
 pym/portage/package/ebuild/doebuild.py |  1 +
 6 files changed, 23 insertions(+), 7 deletions(-)}
Comment 14 Rick Farina (Zero_Chaos) gentoo-dev 2018-01-29 01:57:29 UTC
This all seems good in my testing.
Comment 15 Zac Medico gentoo-dev 2018-01-29 02:10:01 UTC
(In reply to Rick Farina (Zero_Chaos) from comment #14)
> This all seems good in my testing.

Great, thanks!