Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 703520 - sys-apps/portage: eend implementation disagrees with PMS
Summary: sys-apps/portage: eend implementation disagrees with PMS
Status: IN_PROGRESS
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: 563798
  Show dependency tree
 
Reported: 2019-12-22 08:01 UTC by Michał Górny
Modified: 2023-12-24 17:35 UTC (History)
2 users (show)

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


Attachments
eend: Output QA notice when called without argument (0001-eend-Output-QA-notice-when-called-without-argument.patch,938 bytes, patch)
2021-09-03 16:08 UTC, Ulrich Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-12-22 08:01:14 UTC
PMS states:

| Indicates that the process begun with an ebegin message has completed. Takes one fixed argument, which is a numeric return code [...]

However, Portage makes that argument optional and defaults to 0.  This is very error prone, and leads to many ebuilds not passing the required argument, and in some cases, wrongly assuming eend will take $? rather than the absurd default of 0.
Comment 1 Ulrich Müller gentoo-dev 2021-09-03 16:08:48 UTC
Created attachment 737227 [details, diff]
eend: Output QA notice when called without argument

Maybe we could start with printing a QA notice. See attached patch.
Comment 2 Larry the Git Cow gentoo-dev 2021-09-27 11:19:08 UTC
The bug has been referenced in the following commit(s):

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

commit 95cd9583d415dfeb07917d7b111502f0b991413d
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2021-09-03 16:03:27 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2021-09-27 11:15:04 +0000

    eend: Output QA notice when called without argument
    
    PMS says about eend: "Takes one fixed argument, which is a numeric
    return code, and an optional message in all subsequent arguments."
    
    Bug: https://bugs.gentoo.org/703520
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 bin/isolated-functions.sh | 1 +
 1 file changed, 1 insertion(+)
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-23 09:13:28 UTC
pkgcheck detects this as https://github.com/pkgcore/pkgcheck/pull/365 (MissingEendArgument). IIRC we don't have any violators in tree now.
Comment 4 Ulrich Müller gentoo-dev 2023-05-23 11:46:48 UTC
So, do we just close this (leaving the QA warning in place), or should we make calling eend without numerical first argument an error?
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-12-24 17:35:18 UTC
(In reply to Ulrich Müller from comment #4)
> So, do we just close this (leaving the QA warning in place), or should we
> make calling eend without numerical first argument an error?

The latter IMO.