Bug 2152738

Summary: vulkan header files being installed to incorrect location
Product: [Fedora] Fedora Reporter: Juan Ramos <juan>
Component: vulkan-validation-layersAssignee: Dave Airlie <airlied>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 37CC: airlied, ajax, ndegraef, tpelka
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-07-07 09:59:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Juan Ramos 2022-12-12 21:50:32 UTC
Description of problem:

Fedora installing header files inconsistently causing confusion for cross-platform Vulkan developers.

The following confusion was found on Discord.

```
i'm having problems with building a program with vulkan
on windows (in visual studio 2022), cmake fails to find vulkan with find_package(Vulkan REQUIRED), 
even though the Vulkan SDK seems to be properly installed and the VULKAN_SDK environment variable is set to the correct directory

after trying it again on fedora, my cmake file works fine, but the header files from the vulkan-validation-layers-devel package,
such as vk_enum_string_helper.h are in /usr/include/vulkan/vulkan/ instead of in /usr/include/vulkan/ with the other headers, 
so #include <vulkan/vk_enum_string_helper.h> doesn't work
whereas on windows, those headers are all in the same directory (which is C:\VulkanSDK\1.3.231.1\Include\vulkan for me)
i want to make my code portable and idk what to do about this 
```

Currently the fedora packaging is inconsistent with lunarg packaging (Causing confusion on how to build against the SDK).

In our CMake we specify header files being installed to the include/vulkan folder.
https://github.com/KhronosGroup/Vulkan-ValidationLayers/blob/46f343d06003fdbdafa9d5c9d14a11a08006bc1e/layers/CMakeLists.txt#L61

However, the Fedora packaging has this line here:
https://src.fedoraproject.org/rpms/vulkan-validation-layers/blob/a6ebc0c75fb22a469a12c61092fb90b81bb0e20e/f/vulkan-validation-layers.spec#_60

Which results in the `vulkan/vulkan` inconsistency issue. The `LunarG` packages are consistent.

The fix is just a minor adjustment to the cmake configuration:

```
%cmake3 ....
        -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir}/ # Don't specify Vulkan, the code does that already
	
%cmake_build
```

Comment 1 Juan Ramos 2022-12-14 17:13:08 UTC
Looks like this issue can be closed. This commit fixes the issue.
https://src.fedoraproject.org/rpms/vulkan-validation-layers/c/e831166e80cd558f6bf5002632da52611756a2be?branch=rawhide

Comment 2 Juan Ramos 2022-12-14 17:13:52 UTC
Thanks Dave Airlie for the quick turn around.

Comment 3 Niels De Graef 2023-07-07 09:59:36 UTC
Moving to Fedora since that's where the report was from and closing as mentioned above