shadPS4 icon indicating copy to clipboard operation
shadPS4 copied to clipboard

[Linux] shadPS4 no longer builds

Open Shoegzer opened this issue 1 year ago • 7 comments

Builds are failing on the latest commits:

In file included from /home/testing/Desktop/shadps4/shadPS4/externals/glslang/SPIRV/GlslangToSpv.h:41,
                 from /home/testing/Desktop/shadps4/shadPS4/src/video_core/renderer_vulkan/vk_shader_util.cpp:7:
/home/testing/Desktop/shadps4/shadPS4/externals/glslang/SPIRV/Logger.h:40:10: fatal error: glslang/Include/visibility.h: No such file or directory
   40 | #include "glslang/Include/visibility.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

System information:

  • OS: Linux Mint 22 / kernel 6.8
  • CPU: Intel i7-10870H
  • GPU: Nvidia GTX 3070
  • Commit tested: 61f750bdd96f5e456cc2df1a7a8210a75b7d6bfe
  • Last known good commit: 5e12303b06c1984a06c2ecbeec6983761c4b0c82 (I can bisect if necessary)
  • Full build log: build.log

Shoegzer avatar Oct 02 '24 04:10 Shoegzer

Could have been a temporary bug, I'm on Mint 22 with kernel 6.8 as well and got a successful automated build on commit 75adf7c just now. Could you try building off of that commit?

rupponi avatar Oct 02 '24 04:10 rupponi

Thanks, though I just tried again against the most current commit and it still fails, so it's unfortunately not temporary. I also compiled against clang, but this too failed for the same reason.

What are your Qt6 and Vulkan SDK versions, out of curiosity? Clearly there's a difference between your build environment and minme. In any event I'll try to bisect to the problem commit.

Shoegzer avatar Oct 02 '24 18:10 Shoegzer

Update: From the log excerpt above it seems to be complaining that glslang/Include/visibility.h doesn't exist - however I can confirm that it does:

~/Desktop/shadPS4$ ls -la externals/glslang/glslang/Include/visibility.h 
-rw-rw-r-- 1 testing testing 2265 Oct  2 14:11 externals/glslang/glslang/Include/visibility.h

Could this be an upstream issue with glslang (thinking a path problem in logger.h?)

@rupponi This confuses me further how you could get the project to compile, if you haven't tried a clean build with a fresh build directory, can you try that and let me know if it works for you?

Shoegzer avatar Oct 02 '24 20:10 Shoegzer

Update: Okay it seems there IS an upstream error with glslang. Building will succeed if the following files are modified:

shadPS4/externals/glslang/SPIRV/Logger.h
shadPS4/externals/glslang/SPIRV/GlslangToSpv.h

The files must be modified as follows:

FROM: #include "glslang/Include/visibility.h" TO: #include "../glslang/Include/visibility.h"

Shoegzer avatar Oct 03 '24 04:10 Shoegzer

Update: Okay it seems there IS an upstream error with glslang. Building will succeed if the following files are modified:

shadPS4/externals/glslang/SPIRV/Logger.h
shadPS4/externals/glslang/SPIRV/GlslangToSpv.h

The files must be modified as follows:

FROM: #include "glslang/Include/visibility.h" TO: #include "../glslang/Include/visibility.h"

I can confirm this fixes the compiling issue. I am now able to compile successfully on Arch Linux.

BigTreezZ avatar Oct 03 '24 12:10 BigTreezZ

It seems the included header directory is failing to include SPIRV. I do not see this failure to build in Ubuntu. There may be a hint in the CMakeLists.txt from the externals folder.

# glslang
if (NOT TARGET glslang::glslang)
    set(SKIP_GLSLANG_INSTALL ON CACHE BOOL "")
    set(ENABLE_GLSLANG_BINARIES OFF CACHE BOOL "")
    set(ENABLE_SPVREMAPPER OFF CACHE BOOL "")
    set(ENABLE_CTEST OFF CACHE BOOL "")
    set(ENABLE_HLSL OFF CACHE BOOL "")
    set(BUILD_EXTERNAL OFF CACHE BOOL "")
    set(ENABLE_OPT OFF CACHE BOOL "")
    add_subdirectory(glslang)
    file(COPY glslang/SPIRV DESTINATION glslang/glslang FILES_MATCHING PATTERN "*.h")
    target_include_directories(SPIRV INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/glslang")
endif()

shadPS4/externals/glslang/SPIRV/Logger.h will be looking for the file in shadPS4/externals/glslang/glslang/Include/visibility.h

qurious-pixel avatar Oct 03 '24 15:10 qurious-pixel

It seems the included header directory is failing to include SPIRV. I do not see this failure to build in Ubuntu. There may be a hint in the CMakeLists.txt from the externals folder.

# glslang
if (NOT TARGET glslang::glslang)
    set(SKIP_GLSLANG_INSTALL ON CACHE BOOL "")
    set(ENABLE_GLSLANG_BINARIES OFF CACHE BOOL "")
    set(ENABLE_SPVREMAPPER OFF CACHE BOOL "")
    set(ENABLE_CTEST OFF CACHE BOOL "")
    set(ENABLE_HLSL OFF CACHE BOOL "")
    set(BUILD_EXTERNAL OFF CACHE BOOL "")
    set(ENABLE_OPT OFF CACHE BOOL "")
    add_subdirectory(glslang)
    file(COPY glslang/SPIRV DESTINATION glslang/glslang FILES_MATCHING PATTERN "*.h")
    target_include_directories(SPIRV INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/glslang")
endif()

shadPS4/externals/glslang/SPIRV/Logger.h will be looking for the file in shadPS4/externals/glslang/glslang/Include/visibility.h

You can try to add file(COPY glslang/glslang DESTINATION glslang FILES_MATCHING PATTERN "*.h") after add_subdirectory.

abouvier avatar Oct 03 '24 20:10 abouvier

Thanks @abouvier. I tried that but I get the same error unfortunately.

Trying to understand why some builds such as the ones performed here with Linux Mint 22 are failing, while others on Mint or Ubuntu (upstream from Mint) succeed. What is the difference in build environments? The one here is pretty much stock. Are you all building with clean source/build directories?

Shoegzer avatar Oct 05 '24 18:10 Shoegzer

Same happens on Windows/MSYS MinGW64. Unsurprisingly manually fixing paths helps, but @abouvier solution doesn't.

maxphilippov avatar Oct 05 '24 20:10 maxphilippov

Update: Okay it seems there IS an upstream error with glslang. Building will succeed if the following files are modified:

shadPS4/externals/glslang/SPIRV/Logger.h
shadPS4/externals/glslang/SPIRV/GlslangToSpv.h

The files must be modified as follows:

FROM: #include "glslang/Include/visibility.h" TO: #include "../glslang/Include/visibility.h"

This indeed worked for me on Arch Linux, I managed to compile from source and run the executable in the build directory.

Legislate9214 avatar Oct 09 '24 00:10 Legislate9214