Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 731112 - media-libs/vulkan-loader-1.2.141 - CMake Error at cmake/FindVulkanHeaders.cmake:112 (file): file STRINGS file .../work/Vulkan-Loader-1.2.141/VulkanHeaders_INCLUDE_DIR-NOTFOUND/vulkan/vulkan.h" cannot be read.
Summary: media-libs/vulkan-loader-1.2.141 - CMake Error at cmake/FindVulkanHeaders.cma...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2020-07-06 17:41 UTC by David Michael
Modified: 2020-07-10 00:17 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Michael 2020-07-06 17:41:19 UTC
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
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2020-07-09 16:12:22 UTC
Please attach the entire build log to this bug report.
Comment 2 Nick Sarnie gentoo-dev 2020-07-09 16:14:32 UTC
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.
Comment 3 David Michael 2020-07-09 17:14:13 UTC
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.
Comment 4 Nick Sarnie gentoo-dev 2020-07-09 23:23:19 UTC
Since you already developed the fix, are you willing to submit a pull request?
Comment 5 David Michael 2020-07-09 23:41:41 UTC
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
 }
Comment 6 Nick Sarnie gentoo-dev 2020-07-09 23:43:06 UTC
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
Comment 7 David Michael 2020-07-10 00:01:57 UTC
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.
Comment 8 Larry the Git Cow gentoo-dev 2020-07-10 00:17:44 UTC
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(-)