WarmUpTill / SceneSwitcher

An automated scene switcher for OBS Studio
https://obsproject.com/forum/resources/automatic-scene-switching.395/
GNU General Public License v2.0
929 stars 72 forks source link

Build fails on latest master - child return code: 1 #1137

Closed Destroy666x closed 4 weeks ago

Destroy666x commented 3 months ago

Describe the bug Even after cleaning everything.

To Reproduce Steps to reproduce the behavior:

  1. Run .github/scripts/Build-Windows.ps1

Expected behavior

Logs

    =>   Using buildspec.json version identifier '1.0.0'
    =>   Check Windows build requirements
     >   Found dependency cmake as C:\Program Files\Cmake\bin\cmake.exe
     >   Found dependency iscc as C:\Program Files (x86)\Inno Setup 6\ISCC.exe
     >   Found dependency openssl as C:\Program Files\Strawberry Perl\c\bin\openssl.exe
    =>   Building advss deps D:\Dev\Repositories\git\OBS-AdvancedSceneSwitcher/.deps/advss-build-dependencies ...
    =>   Check Windows build requirements
     >   Found dependency cmake as C:\Program Files\Cmake\bin\cmake.exe
     >   Found dependency iscc as C:\Program Files (x86)\Inno Setup 6\ISCC.exe
     >   Found dependency openssl as C:\Program Files\Strawberry Perl\c\bin\openssl.exe
    =>   Run plugin configure step to download OBS deps ...
    =>   Configuring advanced-scene-switcher...
Preset CMake variables:

  CMAKE_SYSTEM_VERSION="10.0.18363.657"
  ENABLE_FRONTEND_API:BOOL="TRUE"
  ENABLE_QT:BOOL="TRUE"
  QT_VERSION="6"

-- Selecting Windows SDK version 10.0.20348.0 to target Windows 10.0.18363.657.
-- CMAKE_PROJECT_NAME is advanced-scene-switcher
-- advanced-scene-switcher configured for out-of-tree build
-- Setting up Pre-Built obs-deps (x64)
-- Setting up Pre-Built obs-deps (x64) - done
-- Setting up Pre-Built Qt6 (x64)
-- Setting up Pre-Built Qt6 (x64) - done
-- Setting up OBS sources (x64)
-- Setting up OBS sources (x64) - done
-- Configure OBS sources (x64)
-- Configure OBS sources (x64) - done
-- Build OBS sources (x64)
CMake Error at cmake/common/buildspec_common.cmake:95 (execute_process):
  execute_process failed command indexes:

    1: "Child return code: 1"

Call Stack (most recent call first):
  cmake/common/buildspec_common.cmake:225 (_setup_obs_studio)
  cmake/windows/buildspec.cmake:21 (_check_dependencies)
  cmake/windows/buildspec.cmake:24 (_check_dependencies_windows)
  cmake/windows/defaults.cmake:8 (include)
  CMakeLists.txt:19 (include)

-- Configuring incomplete, errors occurred!
Exception: D:\Dev\Repositories\git\OBS-AdvancedSceneSwitcher\.github\scripts\Build-Windows.ps1:130
Line |
 130 |  Build
     |  ~~~~~
     | cmake -DCMAKE_PREFIX_PATH:PATH= --preset windows-x64 exited with non-zero code 1.

Version information

Additional context Add any other context about the problem here.

WarmUpTill commented 3 months ago

Can you please try removing the OUTPUT_QUIET from https://github.com/WarmUpTill/SceneSwitcher/blob/master/cmake/common/buildspec_common.cmake#L95C1-L100C18? Then we should have more information why the cmake call, which is intended to build OBS itself, fails.

Destroy666x commented 3 months ago
caption.vcxproj -> D:\Dev\Repositories\git\OBS-AdvancedSceneSwitcher\.deps\obs-studio-29.1.2\build_x64\deps\libcaption\Debug\caption.lib
  w32-pthreads.vcxproj -> D:\Dev\Repositories\git\OBS-AdvancedSceneSwitcher\.deps\obs-studio-29.1.2\build_x64\deps\w32-pthreads\Debug\w32-pthreads.dll
  Installing OBS rundir
     Trwa tworzenie biblioteki D:/Dev/Repositories/git/OBS-AdvancedSceneSwitcher/.deps/obs-studio-29.1.2/build_x64/libobs/Debug/obs.lib i obiektu D:/Dev/Repositories/git/OBS-AdvancedSceneSwitcher/.deps/obs-studio-29.1.2/build_x64/libobs/Debug/obs.exp
libz.a(gzwrite.obj) : error LNK2019: nierozpoznany symbol zewnętrzny __ms_vsnprintf przywołany w funkcji gzvprintf [D:\Dev\Repositories\git\OBS-AdvancedSceneSwitcher\.deps\obs-studio-29.1.2\build_x64\libobs\libobs.vcxproj]
libz.a(gzlib.obj) : error LNK2001: nierozpoznany symbol zewn─Ötrzny __ms_vsnprintf [D:\Dev\Repositories\git\OBS-AdvancedSceneSwitcher\.deps\obs-studio-29.1.2\build_x64\libobs\libobs.vcxproj]
D:\Dev\Repositories\git\OBS-AdvancedSceneSwitcher\.deps\obs-studio-29.1.2\build_x64\libobs\Debug\obs.dll : fatal error LNK1120: liczba nierozpoznanych element├│w zewn─Ötrznych: 1 [D:\Dev\Repositories\git\OBS-AdvancedSceneSwitcher\.deps\obs-studio-29.1.2\build_x64\libobs\libobs.vcxproj]
WarmUpTill commented 3 months ago

That seems really strange. Which compiler are you using? Is it maybe outdated for some reason? Or have you updated it recently?

Even after cleaning everything.

Just confirm: Did you also delete the .deps folder?

Destroy666x commented 3 months ago

Yes, everything.

I didn't change compiler, should be default one (MSVC?). I updated some stuff, like Visual Studio relatad packages - build tools etc., cmake, bunch of other software. Most were minor updates though.

WarmUpTill commented 3 months ago

Does it make a difference if you update the OBS version / dependencies in the buildspec.json file?

{
    "dependencies": {
        "obs-studio": {
            "version": "30.1.2",
            "baseUrl": "https://github.com/obsproject/obs-studio/archive/refs/tags",
            "label": "OBS sources",
            "hashes": {
                "macos": "490bae1c392b3b344b0270afd8cb887da4bc50bd92c0c426e96713c1ccb9701a",
                "windows-x64": "c2dd03fa7fd01fad5beafce8f7156da11f9ed9a588373fd40b44a06f4c03b867"
            }
        },
        "prebuilt": {
            "version": "2024-03-19",
            "baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
            "label": "Pre-Built obs-deps",
            "hashes": {
                "macos": "2e9bfb55a5e0e4c1086fa1fda4cf268debfead473089df2aaea80e1c7a3ca7ff",
                "windows-x64": "6e86068371526a967e805f6f9903f9407adb683c21820db5f07da8f30d11e998"
            }
        },
        "qt6": {
            "version": "2024-03-19",
            "baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
            "label": "Pre-Built Qt6",
            "hashes": {
                "macos": "694f1e639c017e3b1f456f735330dc5afae287cbea85757101af1368de3142c8",
                "windows-x64": "72d1df34a0ef7413a681d5fcc88cae81da60adc03dcd23ef17862ab170bcc0dd"
            },
            "debugSymbols": {
                "windows-x64": "fbddd1f659c360f2291911ac5709b67b6f8182e6bca519d24712e4f6fd3cc865"
            }
        }
    },
    "platformConfig": {
        "macos": {
            "bundleId": "com.warmuptill.advanced-scene-switcher"
        }
    },
    "name": "advanced-scene-switcher",
    "displayName": "Advanced Scene Switcher",
    "version": "1.0.0",
    "author": "WarmUpTill",
    "website": "https://github.com/WarmUpTill/SceneSwitcher",
    "email": "noone@nothing.com",
    "uuids": {
        "windowsApp": "A4ADDF26-4426-4D2E-B26A-C7C878DA8FC9"
    }
}

Not sure if the adv-ss dependencies are compatible with this version of the OBS deps, so you might have to run the Build-Windows.ps1 at least twice. (Once to trigger the setup of the .deps folder, which might fail at some adv-ss dependency, and a second time for the plugin build)

Destroy666x commented 3 months ago

That passes the OBS part, but throws some kind of depreciation warnings for the plugin itself:

D:\Dev\Repositories\git\OBS-AdvancedSceneSwitcher\lib\macro\macro.cpp(986,39): warning C4996: 'obs_frontend_add_dock': został uznany za przestarzały [D:\Dev\Repositories\git\
OBS-AdvancedSceneSwitcher\build_x64\advanced-scene-switcher-lib.vcxproj]
D:\Dev\Repositories\git\OBS-AdvancedSceneSwitcher\lib\utils\status-control.cpp(218,2): warning C4996: 'obs_frontend_add_dock': został uznany za przestarzały [D:\Dev\Repositor
ies\git\OBS-AdvancedSceneSwitcher\build_x64\advanced-scene-switcher-lib.vcxproj]
D:\Dev\Repositories\git\OBS-AdvancedSceneSwitcher\lib\macro\macro.cpp(986,39): error C2220: następujące ostrzeżenie jest traktowane jako błąd [D:\Dev\Repositories\git\OBS-Adv
ancedSceneSwitcher\build_x64\advanced-scene-switcher-lib.vcxproj]
D:\Dev\Repositories\git\OBS-AdvancedSceneSwitcher\lib\utils\status-control.cpp(218,2): error C2220: następujące ostrzeżenie jest traktowane jako błąd [D:\Dev\Repositories\git
\OBS-AdvancedSceneSwitcher\build_x64\advanced-scene-switcher-lib.vcxproj]
    Ostrzeżenia: 2
    Liczba błędów: 2

EDIT: switching to obs_frontend_add_dock_by_id("test", "test", _dock); fixes it, but ofc it's not a proper fix as there's entirely differnt return type and then the build gets stopped by similar warning for obs_sceneitem_get_info which isn't even marked as deprecated in docs (?)

WarmUpTill commented 3 months ago

Ah, so that means that for some reason your build environment is no longer compatible with OBS 29. That is very strange, but I am not really sure how to diagnose this further.

I am not sure if it is a good idea to drop support for OBS 29 yet and adapt the buildspec.json file.

I think for now it is OK to simply ignore the warnings. You can do this by applying the following patch:

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -344,7 +344,7 @@ if(OS_WINDOWS)
   target_compile_definitions(${LIB_NAME} PRIVATE UNICODE _UNICODE)
   if(MSVC)
     target_compile_options(${LIB_NAME} PUBLIC /MP /d2FH4- /wd4267 /wd4267
-                                              /bigobj)
+                                              /wd4996 /bigobj)

     # Workaround for MSVC incompatibility in CI environment
     add_compile_definitions(${target_name} _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)
Destroy666x commented 3 months ago

Ok, thanks. How would you change the compiler BTW? Is there any parameter I can pass somewhere? Or does that also need code edits?

WarmUpTill commented 3 months ago

The MSVC compiler version of depends on the version you have installed using visual studio as far as I know. Maybe they can also be installed separately, but I am not familiar with that.

Destroy666x commented 3 months ago

Yes, but is there any way to tell the script/cmake to use e.g. Clang? Without uninstalling etc. I don't really trust Microsoft products too much, in terms of reliability, which was just confirmed here

WarmUpTill commented 3 months ago

You can set the CXX environment variable or CMAKE_CXX_COMPILER cmake variable to select the C++ compiler to use.

Destroy666x commented 4 weeks ago

This fixed itself, no idea what was the issue still.

WarmUpTill commented 3 weeks ago

Ah good to know - thanks for the update! :)