Bug 15004 - problematic interaction between buildtools and virgl
Summary: problematic interaction between buildtools and virgl
Status: RESOLVED FIXED
Alias: None
Product: AutoBuilder
Classification: Infrastructure
Component: autobuilder (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 4.2 M2
Assignee: Alexander Kanavin
QA Contact:
URL:
Whiteboard: AB-INT
Depends on:
Blocks:
 
Reported: 2023-01-12 15:27 UTC by Alexandre Belloni
Modified: 2023-01-19 15:50 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre Belloni 2023-01-12 15:27:01 UTC
Email from Richard:

We've been seeing AB failures like:

https://autobuilder.yoctoproject.org/typhoon/#/builders/56/builds/2103

which looks like dri needs to be installed on the host but the problem
is in fact buildtools. Taking the opensuse154-ty-2 worker where this
failed:

rpurdie@opensuse154-ty-2:~> pkg-config --variable=dridriverdir dri
/usr/lib64/dri

but using buildtools:

pokybuild@opensuse154-ty-2:~/yocto-worker/oe-selftest/build> source buildtools/environment-setup-x86_64-pokysdk-linux
pokybuild@opensuse154-ty-2:~/yocto-worker/oe-selftest/build> pkg-config --variable=dridriverdir dri
Package dri was not found in the pkg-config search path.
Perhaps you should add the directory containing `dri.pc'
to the PKG_CONFIG_PATH environment variable
No package 'dri' found
pokybuild@opensuse154-ty-2:~/yocto-worker/oe-selftest/build> which pkg-config
/home/pokybuild/yocto-worker/oe-selftest/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/bin/pkg-config

which means the pkg-config from buildtools isn't falling back to host
pc files. We should be able to set PKG_CONFIG_PATH in the sdk to
account for this, e.g.:

pokybuild@opensuse154-ty-2:~/yocto-worker/oe-selftest/build>
PKG_CONFIG_PATH=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/lib/pkgconfig:/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/share/pkgconfig:/usr/lib64/pkgconfig/ pkg-config dri
--variable=dridriverdir
/usr/lib64/dri

the hard part is figuring out which paths the host pkg-config uses.
Comment 1 Alexandre Belloni 2023-01-12 15:28:20 UTC
https://autobuilder.yoctoproject.org/typhoon/#builders/56/builds/2103/steps/15/logs/stdio
oe-selftest opensuse154-ty-2

https://autobuilder.yoctoproject.org/typhoon/#builders/56/builds/2094/steps/15/logs/stdio
oe-selftest opensuse154-ty-2


2023-01-12 02:10:06,477 - oe-selftest - INFO - FAIL: runtime_test.TestImage.test_testimage_virgl_headless (subunit.RemotedTestCase)
2023-01-12 02:10:06,478 - oe-selftest - INFO - ----------------------------------------------------------------------
2023-01-12 02:10:06,478 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/home/pokybuild/yocto-worker/oe-selftest/build/meta/lib/oeqa/selftest/cases/runtime_test.py", line 271, in test_testimage_virgl_headless
    dripath = subprocess.check_output("pkg-config --variable=dridriverdir dri", shell=True)
  File "/home/pokybuild/yocto-worker/oe-selftest/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/python3.10/subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/home/pokybuild/yocto-worker/oe-selftest/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/python3.10/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'pkg-config --variable=dridriverdir dri' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/pokybuild/yocto-worker/oe-selftest/build/meta/lib/oeqa/core/decorator/__init__.py", line 35, in wrapped_f
    return func(*args, **kwargs)
  File "/home/pokybuild/yocto-worker/oe-selftest/build/meta/lib/oeqa/selftest/cases/runtime_test.py", line 273, in test_testimage_virgl_headless
    self.fail("Could not determine the path to dri drivers on the host via pkg-config.\nPlease install Mesa development files (particularly, dri.pc) on the host machine.")
  File "/home/pokybuild/yocto-worker/oe-selftest/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/python3.10/unittest/case.py", line 675, in fail
    raise self.failureException(msg)
AssertionError: Could not determine the path to dri drivers on the host via pkg-config.
Please install Mesa development files (particularly, dri.pc) on the host machine.
Comment 2 Alexander Kanavin 2023-01-12 15:43:48 UTC
Patch:
https://lists.openembedded.org/g/openembedded-core/message/175802
Comment 3 Richard Purdie 2023-01-13 14:33:03 UTC
I also filed https://bugzilla.yoctoproject.org/show_bug.cgi?id=15007 for the bug in nativesdk-pkgconfig