Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 905214 - dev-util/include-what-you-use-0.19 fails tests
Summary: dev-util/include-what-you-use-0.19 fails tests
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Florian Schmaus
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-28 07:05 UTC by Agostino Sarubbo
Modified: 2023-04-29 19:16 UTC (History)
0 users

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


Attachments
build.log (build.log,383.14 KB, text/plain)
2023-04-28 07:05 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2023-04-28 07:05:54 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: dev-util/include-what-you-use-0.19 fails tests.
Discovered on: amd64 (internal ref: ci)
Comment 1 Agostino Sarubbo gentoo-dev 2023-04-28 07:05:56 UTC
Created attachment 860871 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2023-04-28 07:05:57 UTC
Error(s) that match a know pattern:


FAILED (errors=169)
  IWYU Git version not found, DO NOT release from this tree!
OSError: Failed to locate IWYU.
Comment 3 Florian Schmaus gentoo-dev 2023-04-28 12:31:36 UTC
I managed to fix the ebuild's src_test by invoking run_iwyu_tests_py so that the actually build include-what-you-use will be used for testing (and not the system-one that is potentially in PATH), by

src_test() {
   "${EPYTHON}" run_iwyu_tests.py \
        -- ${BUILD_DIR}/bin/${PN} \
        || || die "Tests failed with $? (using ${EPYTHON})"
}

However, the tests fail with include-what-you-use being unable to find the stddef.h header. This appears to be because the include path is specified relative to the include-what-you-use binaries location, and in src_test, the binary has not yet been merged into the live filesystem:

../include-what-you-use-0.19_build/bin/include-what-you-use -E -x c++ - -v < /dev/null
clang version 15.0.7
…
ignoring nonexistent directory "/var/tmp/portage/dev-util/include-what-you-use-0.19/work/include-what-you-use-0.19_build/bin/../../../../lib/clang/15.0.7/include"
ignoring nonexistent directory "/usr/local/include"
…

Observe how the include directory is specified as "/var/tmp/portage/dev-util/include-what-you-use-0.19/work/include-what-you-use-0.19_build/bin/../../../../lib/clang/15.0.7/include".
Comment 4 Larry the Git Cow gentoo-dev 2023-04-29 19:16:41 UTC
The bug has been closed via the following commit(s):

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

commit 9c479450dfc4080bb682ac6803107efe2422b81c
Author:     Florian Schmaus <flow@gentoo.org>
AuthorDate: 2023-04-29 19:09:44 +0000
Commit:     Florian Schmaus <flow@gentoo.org>
CommitDate: 2023-04-29 19:16:34 +0000

    dev-util/include-what-you-use: fix tests
    
    1. invoke run_iwyu_tests with "-- ${BUILD_DIR}/bin/${PN}", so that the
    just build iwyu is used and not the one potentially available in PATH
    
    2. Fix include path, see
    https://github.com/include-what-you-use/include-what-you-use/pull/1252
    
    3. Drop stddef from badinc.cc. This makes the test pass. I am not sure
    if this is correct or not, but at the moment it was either this or
    dropping the test entirely.
    
    Closes: https://bugs.gentoo.org/905214
    Signed-off-by: Florian Schmaus <flow@gentoo.org>

 dev-util/include-what-you-use/Manifest             |  1 +
 ...cxx-badinc.cc-remove-stddef-from-expected.patch | 34 ++++++++++++++++++++++
 .../include-what-you-use-0.19.ebuild               | 21 +++++++++++--
 3 files changed, 54 insertions(+), 2 deletions(-)