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.
Created attachment 849810 [details] emerge build log
In your --root, is there a /etc/portage/make.conf with PKG_CONFIG_PATH="${ROOT}usr/lib/pkgconfig/" or similar?
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.
Created attachment 850322 [details] mesa build failing missing header files
> 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.