Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 835823 - Add QA warning for 'ebegin' without 'eend'
Summary: Add QA warning for 'ebegin' without 'eend'
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on: 837899
Blocks:
  Show dependency tree
 
Reported: 2022-03-23 02:53 UTC by Sam James
Modified: 2022-07-10 16:31 UTC (History)
3 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 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-03-23 02:53:53 UTC
'ebegin' without 'eend' doesn't make much sense and will lead to confusing output in the build log.

We should have an eqawarn for such instances.

Relevant snippet from #gentoo-qa:
"""
[14:32:38]  <@sam_> ulm: two questions about ebegin/eend
[14:32:45]  <@sam_> ulm: is it valid to call eend without ebegin?
[14:32:51]  <@sam_> ulm: ... and the opposite (ebegin without eend)? :)
[14:33:01]  <@sam_> ulm: i've read pms already obviously but i just want to double check
[14:33:24]  <@sam_> we have some cases in tree of e.g. einfo/eend!
[14:53:06]  <@ulm> eend Indicates that the process begun with an ebegin message has completed.
[14:53:29]  <@ulm> sam_: obviously it is intended to be called after ebegin
[14:53:59]  <@ulm> but I think it won't error out if it isn't
[14:55:35]  <@ulm> I'd rather not make that incorrect usage an error
[14:56:15]  <@ulm> only thing that can happen is bad formatting of the output, which isn't a good reason to abort the build process
[14:56:41]  <@ulm> sam_: maybe portage should output a qa warning
[16:12:25]  <@sam_> ulm: what about the opposite?
[16:12:30]  <@sam_> same? just add a warning?
[16:33:38]  <@ulm> yeah, warning too
"""
Comment 1 Larry the Git Cow gentoo-dev 2022-04-15 04:47:41 UTC
The bug has been closed via the following commit(s):

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

commit 3994939f982f22afbc7aaf3b8eca6680ad85c617
Author:     Thomas Bracht Laumann Jespersen <t@laumann.xyz>
AuthorDate: 2022-04-12 08:59:11 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-04-15 04:47:35 +0000

    ebegin: Output QA warning if call to eend is missing
    
    The idea here is to check if EBEGIN_EEND is set after the phase has been
    executed. If so, then a call to eend is probably missing. This is under
    the assumption that ebegin-eend invocations should be properly paired
    within the same phase.
    
    In ebegin, the EBEGIN_EEND variable is also checked, and, if set,
    indicates that ebegin has been called and is missing the closing call to
    eend.
    
    I doubt that this check is perfect, but it seems to work in what little
    testing I've done.
    
    Closes: https://bugs.gentoo.org/835823
    Signed-off-by: Thomas Bracht Laumann Jespersen <t@laumann.xyz>
    Closes: https://github.com/gentoo/portage/pull/811
    Signed-off-by: Sam James <sam@gentoo.org>

 bin/isolated-functions.sh | 3 +++
 bin/phase-functions.sh    | 4 ++++
 2 files changed, 7 insertions(+)
Comment 2 Larry the Git Cow gentoo-dev 2022-04-15 08:37:01 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bb044a3dd58f5d6ac0fa66dfe07daf3c6773480e

commit bb044a3dd58f5d6ac0fa66dfe07daf3c6773480e
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-04-15 08:35:57 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-04-15 08:36:54 +0000

    sys-apps/portage: backport new QA checks; /run warning removal
    
    portage.git is currently undergoing a fair bit of refactoring
    and other non-trivial changes, so let's backport some useful bits.
    
    - Backport QA checks (eend w/o ebegin, ebegin w/o eend, /var/tmp install dir)
    - Drop obsolete /run-not-mounted warning
    
    Bug: https://bugs.gentoo.org/835824
    Bug: https://bugs.gentoo.org/835823
    Bug: https://bugs.gentoo.org/832853
    Bug: https://bugs.gentoo.org/493154
    Bug: https://bugs.gentoo.org/837536
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/portage/files/3.0.30-qa-checks.patch      | 137 ++++++++++
 .../portage/files/3.0.30-revert-run-warn.patch     |  64 +++++
 sys-apps/portage/portage-3.0.30-r2.ebuild          | 276 +++++++++++++++++++++
 3 files changed, 477 insertions(+)