Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#48478 - [vulkan-loader-layers] vulkan layers do not work due to build misconfiguration

Attached to Project: Arch Linux
Opened by nsf (nsf) - Sunday, 06 March 2016, 14:13 GMT
Last edited by Laurent Carlier (lordheavy) - Sunday, 06 March 2016, 18:33 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Laurent Carlier (lordheavy)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Doing `strace` on vulkan-based app, shows that it probes some directories, none of which contain layer definitions:

open("//etc/vulkan/explicit_layer.d", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr//usr/share/vulkan/explicit_layer.d", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("//etc/vulkan/implicit_layer.d", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr//usr/share/vulkan/implicit_layer.d", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

As you can see one of the paths is "/usr//usr/share/vulkan/explicit_layer.d", with double "usr" in it, which is obviously a sign of build misconfiguration.

Further analysis shows:

Vulkan's "loader/vk_loader_platform.h" contains this:

#define LOCAL_ELAYERS_INFO \
LOCALPREFIX "/" SYSCONFDIR VULKAN_ELAYERCONF_DIR ":" LOCALPREFIX \
"/" DATADIR VULKAN_ELAYERCONF_DIR ":"

Some of the vars come from CMake:

CMakeLists.txt: add_definitions(-DLOCALPREFIX="${CMAKE_INSTALL_PREFIX}")
CMakeLists.txt: add_definitions(-DSYSCONFDIR="${CMAKE_INSTALL_SYSCONFDIR}")
CMakeLists.txt: add_definitions(-DDATADIR="${CMAKE_INSTALL_DATADIR}")

VULKAN_ELAYERCONF_DIR is predefined to "/vulkan/explicit_layer.d"

PKGBUILD contains this:

cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_SYSCONFDIR=/etc \
-DINCLUDE_INSTALL_DIR=/usr/include \
-DLIB_INSTALL_DIR=/usr/lib \
-DCMAKE_INSTALL_DATADIR=/usr/share \

As a result we get one of the paths as "/usr//usr/share/vulkan/explicit_layer.d".

Version where the bug was discovered: 1.0.3.0-2

What's the best way to fix it? Maybe using empty CMAKE_INSTALL_PREFIX, I'm not sure.
This task depends upon

Closed by  Laurent Carlier (lordheavy)
Sunday, 06 March 2016, 18:33 GMT
Reason for closing:  Fixed
Additional comments about closing:  vulkan-validation-layers 1.0.3.0-3

Loading...