Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 934130 - linux-info.eclass fails tests
Summary: linux-info.eclass fails tests
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-12 09:29 UTC by Ulrich Müller
Modified: 2024-06-12 09:47 UTC (History)
1 user (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 Ulrich Müller gentoo-dev 2024-06-12 09:29:19 UTC
eclass/tests $ ./linux-info_get_running_version.sh
 * Testing get_running_version 1.2.3 ...
die: get_running_version() called on non-Linux system, please fix the ebuild


Apparently test are broken since 2018, when the test for "use kernel_linux" was introduced to the eclass:

commit 9e7c4b6d2daa9a8b1c33154f8dd296a2d1a26e92
Author: Michał Górny <mgorny@gentoo.org>
Date:   Thu Mar 8 17:24:12 2018 +0100

    linux-info.eclass: Die in most of public-ish APIs on non-Linux
    
    Add appropriate 'die' calls in most of the seemingly public APIs
    of the eclass that could be called by ebuilds and that are going to fail
    horribly when used on non-Linux systems. This means that
    e.g. 'kernel_is' calls need to be explicitly guarded in ebuilds, as we
    can't really reasonably return 'true' or 'false' if there is no Linux
    kernel in the first place.
Comment 1 Larry the Git Cow gentoo-dev 2024-06-12 09:47:30 UTC
The bug has been closed via the following commit(s):

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

commit 8629d5a9fc153679289b85189f385af8348f4f25
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2024-06-12 09:43:49 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2024-06-12 09:46:39 +0000

    eclass/tests: Override use() in linux-info_get_running_version.sh
    
    linux-info.eclass checks for the kernel_linux flag since 2018,
    introduced with commit 9e7c4b6d2daa9a8b1c33154f8dd296a2d1a26e92.
    
    Closes: https://bugs.gentoo.org/934130
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 eclass/tests/linux-info_get_running_version.sh | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)