Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 893164 - =media-libs/mesa-22.2.5 fails to detect libdrm_amdgpu when compiling to custom ROOT=
Summary: =media-libs/mesa-22.2.5 fails to detect libdrm_amdgpu when compiling to custo...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-03 22:32 UTC by ev
Modified: 2023-09-29 03:44 UTC (History)
0 users

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


Attachments
full meson log (meson-log.txt,141.43 KB, text/plain)
2023-02-03 22:32 UTC, ev
Details
emerge build log (build.log,12.37 KB, text/x-log)
2023-02-03 22:33 UTC, ev
Details
mesa build failing missing header files (mesa-build.log.xz,23.70 KB, text/plain)
2023-02-10 08:05 UTC, ev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ev 2023-02-03 22:32:18 UTC
Created attachment 849808 [details]
full meson log

I'm emerging packages to separate filesytem using ROOT= variable. 
I cannot compile mesa for amdgpu because mesa's meson configure scripts looks for libdrm_amdgpu on host system instead of ROOT= filesystem.
(My host system doesn't have amdgpu and doesn't have this library.)

Build system detects libdrm_amdgpu via command '/usr/bin/x86_64-pc-linux-gnu-pkg-config --modversion libdrm_amdgpu' which fails because it's not aware of ROOT= to which emerge installed libdrm.


Relevant part of emerge build log:
Run-time dependency libzstd found: YES 1.5.2
Run-time dependency threads found: YES
Checking for function "pthread_setaffinity_np" with dependency threads: YES 
Run-time dependency expat found: YES 2.5.0
Library m found: YES
Message: libdrm 2.4.110 needed because amdgpu has the highest requirement
Run-time dependency libdrm_amdgpu found: NO (tried pkgconfig and cmake)

../mesa-22.2.5/meson.build:1678:4: ERROR: Dependency "libdrm_amdgpu" not found, tried pkgconfig and cmake

A full log can be found at /var/tmp/portage/media-libs/mesa-22.2.5/work/mesa-22.2.5-abi_x86_32.x86/meson-logs/meson-log.txt
 * ERROR: media-libs/mesa-22.2.5::gentoo failed (configure phase):
 *   (no error message)



Relevant part of meson:
Cpuld ebuild or build system  log:
Message: libdrm 2.4.110 needed because amdgpu has the highest requirement
Pkg-config binary for 1 is cached.
Determining dependency 'libdrm_amdgpu' with pkg-config executable '/usr/bin/x86_64-pc-linux-gnu-pkg-config'
env[PKG_TMPDIR]: /var/tmp/portage/._unmerge_
env[PKG_LOGDIR]: /var/tmp/portage/media-libs/mesa-22.2.5/temp/logging
env[PKG_CONFIG_SYSTEM_LIBRARY_PATH]: /lib:/usr/lib
env[PKG_CONFIG_SYSTEM_INCLUDE_PATH]: /usr/include
env[PKG_CONFIG]: x86_64-pc-linux-gnu-pkg-config
env[PKG_CONFIG_PATH]: /usr/share/pkgconfig:/usr/share/pkgconfig
env[PKG_CONFIG_LIBDIR]: /usr/lib/pkgconfig
Called `/usr/bin/x86_64-pc-linux-gnu-pkg-config --modversion libdrm_amdgpu` -> 1

CMake binary for 1 is cached.
Preliminary CMake check failed. Aborting.
Run-time dependency libdrm_amdgpu found: NO (tried pkgconfig and cmake)


Could ebuild/build system modify these enviroment variables to scan correct filesystem for libdrm_amdgpu?

Could this check be patched out? It's a runtime dependency. Emerge already keeps track of them. Libdrm was correctly installed before mesa on ROOT= fs.
Comment 1 ev 2023-02-03 22:33:19 UTC
Created attachment 849810 [details]
emerge build log
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-02-04 23:50:54 UTC
In your --root, is there a /etc/portage/make.conf with 
PKG_CONFIG_PATH="${ROOT}usr/lib/pkgconfig/" or similar?
Comment 3 ev 2023-02-10 08:03:12 UTC
No, my --root make.conf is a fresh make.conf from stage3 with ACCEPT_LICENSE configured.

I've tried to add export PKG_CONFIG_PATH="$EROOT/usr/lib/pkgconfig/" into multilib_src_configure of =media-libs/mesa-22.2.5 ebuild.
It helps with initial dependency check, but build still fails because of missing header files. 

I've also tried to add PKG_CONFIG_PATH="${ROOT}usr/lib/pkgconfig/" to make.conf in my --root. But it didn't change the results. 

I'll attach new build log.
Comment 4 ev 2023-02-10 08:05:40 UTC
Created attachment 850322 [details]
mesa build failing missing header files
Comment 5 Matt Turner gentoo-dev 2023-09-29 03:44:17 UTC
> I cannot compile mesa for amdgpu because mesa's meson configure scripts looks 
> for libdrm_amdgpu on host system instead of ROOT= filesystem.

Isn't that how ROOT=/--root is supposed to work?

> Could ebuild/build system modify these enviroment variables to scan correct 
> filesystem for libdrm_amdgpu?

This isn't how it works, AFAIK.

Gentoo stage1 builds from a stage3 by emerging into another directory specified by ROOT=, but all the dependencies of the build-time dependencies still have to be available in the environment in which they're emerged.

> Could this check be patched out? It's a runtime dependency. Emerge already 
> keeps track of them. Libdrm was correctly installed before mesa on ROOT= fs.

I think you're confused about ROOT but also about the types of dependencies. libdrm is indeed a runtime dependency, but it's also a build-time dependency. That is, mesa links against libdrm's shared objects.

This issue is invalid as far as I can tell.