The vulkan-headers path needs to include ${SYSROOT}, or configuring fails since I don't have the package installed natively on the build system: https://github.com/gentoo/gentoo/blob/master/media-libs/vulkan-loader/vulkan-loader-1.2.141.ebuild#L52 Maybe unrelatedly, it also fails because it assumes it can call its generated asm_offset program as if it is in $PATH. Reproducible: Always Steps to Reproduce: 1. emerge -v vulkan-loader # with a sysroot profile Actual Results: -- Could NOT find VulkanHeaders (missing: VulkanHeaders_INCLUDE_DIR) -- Could NOT find VulkanRegistry (missing: VulkanRegistry_DIR) CMake Error at cmake/FindVulkanHeaders.cmake:112 (file): file STRINGS file "/var/tmp/portage/media-libs/vulkan-loader-1.2.141/work/Vulkan-Loader-1.2.141/VulkanHeaders_INCLUDE_DIR-NOTFOUND/vulkan/vulkan.h" cannot be read. Call Stack (most recent call first): CMakeLists.txt:55 (find_package) And after fixing that by adding ${SYSROOT}: [3/15] cd /var/tmp/portage/media-libs/vulkan-loader-1.2.141/work/vulkan-loader-1.2.141_build-abi_x86_64.amd64/loader && asm_offset GAS FAILED: loader/gen_defines.asm cd /var/tmp/portage/media-libs/vulkan-loader-1.2.141/work/vulkan-loader-1.2.141_build-abi_x86_64.amd64/loader && asm_offset GAS /bin/sh: asm_offset: command not found Expected Results: It should build and install. This patch fixed the second error: --- a/loader/CMakeLists.txt +++ b/loader/CMakeLists.txt @@ -168,7 +168,7 @@ set(OPT_LOADER_SRCS ${OPT_LOADER_SRCS} unknown_ext_chain_gas.S) add_executable(asm_offset asm_offset.c) target_link_libraries(asm_offset Vulkan::Headers) - add_custom_command(OUTPUT gen_defines.asm DEPENDS asm_offset COMMAND asm_offset GAS) + add_custom_command(OUTPUT gen_defines.asm DEPENDS asm_offset COMMAND ./asm_offset GAS) add_custom_target(loader_asm_gen_files DEPENDS gen_defines.asm) target_compile_definitions(asm_offset PRIVATE _XOPEN_SOURCE=500) # hush compiler warnings for readlink else() This might be the upstream issue, but I didn't read through it: https://github.com/KhronosGroup/Vulkan-Loader/issues/249
Please attach the entire build log to this bug report.
Are you saying you installed vulkan-headers outside of portage into a location different than Portage would have? If so, I am not sure we should modify the ebuild to support that.
No, I installed it into a sysroot with portage as a dependency of other packages. https://dev.gentoo.org/~mgorny/articles/the-ultimate-guide-to-eapi-7.html#sysroot-and-esysroot-variables-for-depend I guess replacing EPREFIX with ESYSROOT is cleaner and equivalent to adding ${SYSROOT} like I described.
Since you already developed the fix, are you willing to submit a pull request?
Does Gentoo still require commit signatures on pull requests? I'd rather not have to maintain a GPG key to change one word. --- a/media-libs/vulkan-loader/vulkan-loader-1.2.141.ebuild +++ b/media-libs/vulkan-loader/vulkan-loader-1.2.141.ebuild @@ -49,7 +49,7 @@ -DBUILD_WSI_WAYLAND_SUPPORT=$(usex wayland) -DBUILD_WSI_XCB_SUPPORT=$(usex X) -DBUILD_WSI_XLIB_SUPPORT=$(usex X) - -DVULKAN_HEADERS_INSTALL_DIR="${EPREFIX}/usr" + -DVULKAN_HEADERS_INSTALL_DIR="${ESYSROOT}/usr" ) cmake_src_configure }
No, I can push it for you. Just fork the Gentoo github repo: https://wiki.gentoo.org/wiki/Gentoo_GitHub#How_to_make_a_pull_request
Okay, I opened https://github.com/gentoo/gentoo/pull/16655 . I told it to close this bug without adding a patch to fix the second failure because I'd prefer to investigate what they said in the upstream bug before changing that.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fce28df7e8304ff4b93b1c194a1f8cb76876b571 commit fce28df7e8304ff4b93b1c194a1f8cb76876b571 Author: David Michael <fedora.dm0@gmail.com> AuthorDate: 2020-07-10 00:12:25 +0000 Commit: Nick Sarnie <sarnex@gentoo.org> CommitDate: 2020-07-10 00:16:53 +0000 media-libs/vulkan-loader: become sysroot-aware This allows building in a sysroot without using the headers installed on the host. Closes: https://bugs.gentoo.org/731112 Package-Manager: Portage-2.3.99, Repoman-2.3.23 Signed-off-by: David Michael <fedora.dm0@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/16655 Signed-off-by: Nick Sarnie <sarnex@gentoo.org> .../vulkan-loader/vulkan-loader-1.2.137-r1.ebuild | 66 ++++++++++++++++++++++ .../vulkan-loader/vulkan-loader-1.2.141-r1.ebuild | 66 ++++++++++++++++++++++ media-libs/vulkan-loader/vulkan-loader-9999.ebuild | 2 +- 3 files changed, 133 insertions(+), 1 deletion(-)