Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macos github action fails with "sse2.h is missing" when used with obs 30.0.0-rc1 #95

Closed
ubifred opened this issue Oct 19, 2023 · 1 comment · Fixed by obsproject/obs-studio#9762

Comments

@ubifred
Copy link
Contributor

ubifred commented Oct 19, 2023

Operating System Info

Windows 11

Other OS

MacOS

OBS Studio Version

30.0.0-rc1

OBS Studio Version (Other)

No response

OBS Studio Log URL

Not relevant

OBS Studio Crash Log URL

No response

Expected Behavior

obs-plugintemplate build work on macos with obs-studio 30.0.0

Current Behavior

With the buildspec.json configure to use obs-studio 30.0.0-rc1

"obs-studio": {
            "version": "30.0.0-rc1",
            "baseUrl": "https://github.com/obsproject/obs-studio/archive/refs/tags",
            "label": "OBS sources",
            "hashes": {
                "macos": "77d1d0bef0e156e5e5b19646dc9372ea99a046e39de985496e291e9f23e60764",
                "windows-x64": "da07d21831571fa78e1d09a2d39ca88a7dd80dff77c4feedb1afa83c586b621b"
            }
        },

The macos build in github action fails with the error:

  [ZERO_CHECK] Running script Generate CMakeFiles/ZERO_CHECK
  [plugin-support] Compiling plugin-support.c
  [plugin-support] Compiling plugin-support.c
  [plugin-support] Building library libplugin-support.a
  [plugin-support] Building library libplugin-support.a
  [obs-plugintemplate] Processing empty-obs-plugintemplate.plist
  [obs-plugintemplate] Compiling plugin-main.c
  ❌ /Users/runner/work/obs-plugintemplate/obs-plugintemplate/.deps/Frameworks/libobs.framework/Headers/graphics/../util/sse-intrin.h:31:10: 'simde/x86/sse2.h' file not found
  #include "simde/x86/sse2.h"
           ^~~~~~~~~~~~~~~~~~
  [obs-plugintemplate] Compiling plugin-main.c
  ❌ /Users/runner/work/obs-plugintemplate/obs-plugintemplate/.deps/Frameworks/libobs.framework/Headers/graphics/../util/sse-intrin.h:31:10: 'simde/x86/sse2.h' file not found
  #include "simde/x86/sse2.h"

The detail error is (re run action with debug info):

  In file included from /Users/runner/work/obs-plugintemplate/obs-plugintemplate/src/plugin-main.c:19:
  In file included from /Users/runner/work/obs-plugintemplate/obs-plugintemplate/.deps/Frameworks/libobs.framework/Headers/obs-module.h:20:
  In file included from /Users/runner/work/obs-plugintemplate/obs-plugintemplate/.deps/Frameworks/libobs.framework/Headers/obs.h:26:
  In file included from /Users/runner/work/obs-plugintemplate/obs-plugintemplate/.deps/Frameworks/libobs.framework/Headers/graphics/vec3.h:21:
  In file included from /Users/runner/work/obs-plugintemplate/obs-plugintemplate/.deps/Frameworks/libobs.framework/Headers/graphics/vec4.h:23:
  /Users/runner/work/obs-plugintemplate/obs-plugintemplate/.deps/Frameworks/libobs.framework/Headers/graphics/../util/sse-intrin.h:31:10: fatal error: 'simde/x86/sse2.h' file not found
  #include "simde/x86/sse2.h"

After some digging it appears that

  • AFAIU The root cause is that the ARCH_SIMDE_FLAGS is not set during the obs-studio build for MacOS as the obs-studio build is using the new "framework 3.0" cause the OBS_CMAKE_VERSION is forced to 3.0.0 for MacOS and obs-studio CMakeList.txt uses "framework 3.0" for "Darwin"

    The use of "framework 3.0" (instead of legacy) does not expose the simde header for libobs cause ARCH_SIMD_FLAGS is never set hence the test in obs-studio/libobs/CMakeLists.txt:316 fails to add this files to public headers.

  • This does not happen on windows cause OBS_CMAKE_VERSION is set to 2.0.0 so the legacy build is used in OBS

  • Does not happen either for linux cause libobs deps is not built taken from package manager which install all the simde headers

Steps to Reproduce

  1. fork the https://github.com/obsproject/obs-plugintemplate
  2. update the buildspec.json to use obs 30.0.0-rc1:
diff --git a/buildspec.json b/buildspec.json
index 8a10e3f..91366dd 100644
--- a/buildspec.json
+++ b/buildspec.json
@@ -1,30 +1,30 @@
 {
     "dependencies": {
         "obs-studio": {
-            "version": "29.1.2",
+            "version": "30.0.0-rc1",
             "baseUrl": "https://github.com/obsproject/obs-studio/archive/refs/tags",
             "label": "OBS sources",
             "hashes": {
-                "macos": "215f1fa5772c5dd9f3d6e35b0cb573912b00320149666a77864f9d305525504b",
-                "windows-x64": "46d451f3f42b9d2c59339ec268165849c7b7904cdf1cc2a8d44c015815a9e37d"
+                "macos": "77d1d0bef0e156e5e5b19646dc9372ea99a046e39de985496e291e9f23e60764",
+                "windows-x64": "da07d21831571fa78e1d09a2d39ca88a7dd80dff77c4feedb1afa83c586b621b"
             }
         },
         "prebuilt": {
-            "version": "2023-04-12",
+            "version": "2023-10-09",
             "baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
             "label": "Pre-Built obs-deps",
             "hashes": {
-                "macos": "9535c6e1ad96f7d49960251e85a245774088d48da1d602bb82f734b10219125a",
-                "windows-x64": "c13a14a1acc4224b21304d97b63da4121de1ed6981297e50496fbc474abc0503"
+                "macos": "4b7651e5a19b4ffa2371725e9d7865b5bc4eae46fd7ca0d4b9fabdf7491332b0",
+                "windows-x64": "7585ba9cc470c1f668af6d51efe6da211b16822b884382817750d9e8b502a81c"
             }
         },
         "qt6": {
-            "version": "2023-04-12",
+            "version": "2023-10-09",
             "baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
             "label": "Pre-Built Qt6",
             "hashes": {
-                "macos": "eb7614544ab4f3d2c6052c797635602280ca5b028a6b987523d8484222ce45d1",
-                "windows-x64": "4d39364b8a8dee5aa24fcebd8440d5c22bb4551c6b440ffeacce7d61f2ed1add"
+                "macos": "8d2fe5a7ddb0c5d5b2d37e43fde50661eb497e2b219e65f3822233e8a7f33e5a",
+                "windows-x64": "feadb745e622fb81aa1cdcdc1179baef4c4442d15cb8f0212cb7ceda0f1911df"
             },
             "debugSymbols": {
                 "windows-x64": "f34ee5067be19ed370268b15c53684b7b8aaa867dc800b68931df905d679e31f"asdfadfs
  1. push on master to trigger github action -> windows, linux build fine, macos fails.

Anything else we should know?

I had this issue cause I was preparing the update of a plugins that uses libobs "util/util.hpp" which is not available on 29.1.2 (restored by obsproject/obs-studio@55237ab on master and release/30.0.0)

So I changed buildspec.json to use 30.0.0-rc1 and the new sse2.h occurs on macos only.

As the 30.0.0 is still in RC1 it is not too late to fix it.

@ubifred ubifred changed the title sse2.h is missing macos github action fails with "sse2.h is missing" when used with obs 30.0.0-rc1 Oct 19, 2023
@ubifred
Copy link
Contributor Author

ubifred commented Oct 19, 2023

For the record here is the ugly workaround that let me build on macos with obs 30.0.0-rc1:

diff --git a/cmake/common/buildspec_common.cmake b/cmake/common/buildspec_common.cmake
index b6c5f95..07ad933 100644
--- a/cmake/common/buildspec_common.cmake
+++ b/cmake/common/buildspec_common.cmake
@@ -75,10 +75,10 @@ function(_setup_obs_studio)

   message(STATUS "Configure ${label} (${arch})")

-  # ugly workaround to force macos (using new framework — vs legacy for win and
-  # linux) to add the SIMDE header in libobs headers
+  # ugly workaround to force macos (using new framework — vs legacy for win and linux) to add the SIMDE header in libobs
+  # headers
   if(CMAKE_HOST_SYSTEM_NAME MATCHES "(Darwin)")
-         set(workaround "-DARCH_SIMD_FLAGS=ON")
+    set(workaround "-DARCH_SIMD_FLAGS=ON")
   endif()

   execute_process(
@@ -87,7 +87,7 @@ function(_setup_obs_studio)
       "${dependencies_dir}/${_obs_destination}/build_${arch}" -G ${_cmake_generator} "${_cmake_arch}"
       -DOBS_CMAKE_VERSION:STRING=${_cmake_version} -DENABLE_PLUGINS:BOOL=OFF -DENABLE_UI:BOOL=OFF
       -DOBS_VERSION_OVERRIDE:STRING=${_obs_version} "-DCMAKE_PREFIX_PATH='${CMAKE_PREFIX_PATH}'" ${_is_fresh}
-         ${_cmake_extra} ${workaround}
+      ${_cmake_extra} ${workaround}
     RESULT_VARIABLE _process_result COMMAND_ERROR_IS_FATAL ANY
     OUTPUT_QUIET)
   message(STATUS "Configure ${label} (${arch}) - done")

It fix the issue in the plugin side... but the real fix shall be on obs-studio side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant