ci: build the real OBS adapter on all three platforms
Two things: unbreak the Windows compile, and give macOS/Windows a libobs.
MSVC fix. test_json.cpp failed to compile on the Windows runner with
"a universal-character-name specifies an invalid character" and "illegal
escape sequence" -- MSVC still forms escape sequences and
universal-character-names INSIDE raw string literals, which it must not.
Every JSON input containing a backslash is now built by string concatenation
from a single kBS constant, which also sidesteps the separate murky corner of
translation phase 1 where a doubled backslash immediately followed by 'u' has
historically been treated inconsistently. Same 158 checks, no behaviour
change.
OBS SDK bootstrap for macOS/Windows. Adopts obsproject/obs-plugintemplate's
buildspec machinery -- buildspec.json plus cmake/common/buildspec_common.cmake
and cmake/{macos,windows}/buildspec.cmake -- so those two platforms get a real
libobs and build the actual plugin module instead of only the core library.
Linux is untouched and still uses Ubuntu's libobs-dev
(-DSTPLUGIN_BOOTSTRAP_OBS=OFF); the bootstrap only runs where there is no
system package.
Trimmed against upstream, each change recorded in the file that makes it:
- qt6 is dropped from dependencies_list on both platforms. The properties UI
is plain obs_properties_* and nothing here links Qt.
- The OBS sub-build builds and installs the `libobs` target, not
`obs-frontend-api`. Building the frontend API is what would drag Qt back in,
and this plugin never calls it.
- The sub-build is configured with ENABLE_UI=OFF and ENABLE_SCRIPTING=OFF as
well as upstream's ENABLE_FRONTEND=OFF: the pinned OBS predates
ENABLE_FRONTEND and gates its Qt-dependent UI on ENABLE_UI, so without this
it configures the whole OBS UI and demands Qt anyway.
- Only the Release configuration is built and installed, not Debug as well.
Nothing consumes a debug libobs and it doubles the slowest CI step.
- Only the dependency-acquisition modules are vendored. The template's
compilerconfig/defaults/helpers/xcode modules drive its own target and
bundle layout, which this project does not use.
obs-studio is pinned to 30.0.2, deliberately low: OBS refuses to load a module
built against a NEWER libobs than the one running it and accepts older ones, so
this pin IS the minimum OBS version users need. 30.0.2 is also exactly what
Ubuntu 24.04's libobs-dev ships, which puts all three platforms on one floor,
and it supports the modern CMake layout the bootstrap drives via
-DOBS_CMAKE_VERSION=3.0.0. prebuilt is obs-deps 2023-11-03 with the hashes
obs-studio 30.0.2's own buildspec.json publishes; the obs-studio source
archive hashes were computed from the GitHub tag archives.
The workflow also prints what was actually produced on each platform (ldd /
otool / dir over build/package) and uploads it as an artifact, so "does this
even link against libobs" is answered by CI output rather than assumed.
Verified locally: the Linux path is unchanged by all of this -- a fresh
configure still finds libobs-dev, and ctest is 6/6. The macOS and Windows
bootstrap can only be verified by CI; that is what this push is for.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RL8abRmgFXkVASHkkqiJbE
This commit is contained in:
+57
-19
@@ -1,8 +1,14 @@
|
||||
name: Build
|
||||
|
||||
# Scaffolding CI: proves the CMake toolchain configures and builds on all
|
||||
# three platforms the design doc names. It does not yet link livekit-ffi
|
||||
# or produce a real OBS-installable package -- see README.md.
|
||||
# Every job builds the real plugin: the core library linked against the
|
||||
# pinned livekit/client-sdk-cpp release, and -- where libobs is available --
|
||||
# the OBS adapter module itself.
|
||||
#
|
||||
# Linux gets libobs from Ubuntu's libobs-dev. macOS and Windows have no
|
||||
# equivalent system package, so they run obs-plugintemplate's buildspec
|
||||
# bootstrap (buildspec.json + cmake/common/buildspec_common.cmake), which
|
||||
# downloads the pinned obs-deps bundle and obs-studio source and builds just
|
||||
# `libobs`. That step is the slow one: several minutes on a cold runner.
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -19,10 +25,12 @@ jobs:
|
||||
- name: Install build dependencies
|
||||
run: |
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y -qq cmake ninja-build libobs-dev
|
||||
sudo apt-get install -y -qq cmake ninja-build libobs-dev libcurl4-openssl-dev
|
||||
|
||||
- name: Configure
|
||||
run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
|
||||
# Linux keeps its distribution libobs; the buildspec bootstrap is for
|
||||
# the two platforms that have no such package.
|
||||
run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DSTPLUGIN_BOOTSTRAP_OBS=OFF
|
||||
|
||||
- name: Build
|
||||
run: cmake --build build
|
||||
@@ -30,6 +38,19 @@ jobs:
|
||||
- name: Test (core library)
|
||||
run: ctest --test-dir build --output-on-failure
|
||||
|
||||
- name: Show what was built
|
||||
run: |
|
||||
ls -la build/package/bin build/package/data/locale build/package/licenses
|
||||
ldd build/package/bin/streamer-tools-camera.so | grep -E 'obs|livekit'
|
||||
nm -D build/package/bin/streamer-tools-camera.so | grep -E ' T obs_module_(load|unload)'
|
||||
|
||||
- name: Upload plugin
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: streamer-tools-camera-linux-x64
|
||||
path: build/package
|
||||
|
||||
macos:
|
||||
name: macOS (macos-latest)
|
||||
runs-on: macos-latest
|
||||
@@ -41,10 +62,8 @@ jobs:
|
||||
run: brew install cmake ninja
|
||||
|
||||
- name: Configure
|
||||
# libobs is not expected to be found here yet (no Homebrew
|
||||
# formula / SDK download wired up in this pass) -- the top-level
|
||||
# CMakeLists.txt falls back to building only the core library in
|
||||
# that case. See README.md.
|
||||
# The buildspec bootstrap runs here: it fetches obs-deps + the pinned
|
||||
# obs-studio source and builds libobs before this project configures.
|
||||
run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
|
||||
|
||||
- name: Build
|
||||
@@ -53,6 +72,18 @@ jobs:
|
||||
- name: Test (core library)
|
||||
run: ctest --test-dir build --output-on-failure
|
||||
|
||||
- name: Show what was built
|
||||
run: |
|
||||
ls -la build/package/bin || true
|
||||
otool -L build/package/bin/streamer-tools-camera.so || true
|
||||
|
||||
- name: Upload plugin
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: streamer-tools-camera-macos
|
||||
path: build/package
|
||||
|
||||
windows:
|
||||
name: Windows (windows-latest)
|
||||
runs-on: windows-latest
|
||||
@@ -61,22 +92,29 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install build dependencies
|
||||
# winvm-builder is a self-hosted act_runner labeled
|
||||
# "windows-latest" -- it is NOT the GitHub-hosted windows-latest
|
||||
# image, so none of the tools that image preinstalls (cmake
|
||||
# included) can be assumed present. Confirmed by a first CI run
|
||||
# on this repo: "cmake : The term 'cmake' is not recognized...".
|
||||
# lukka/get-cmake downloads a pinned cmake+ninja binary and adds
|
||||
# it to PATH for this job, with no admin/choco dependency.
|
||||
# winvm-builder is a self-hosted act_runner labeled "windows-latest";
|
||||
# it is NOT the GitHub-hosted image, so none of that image's
|
||||
# preinstalled tooling (cmake included) can be assumed present.
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Configure
|
||||
# Same story as macOS: no OBS SDK available yet on this runner,
|
||||
# so this proves the core library + MSVC toolchain only.
|
||||
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
|
||||
# The default Visual Studio generator is required, not Ninja:
|
||||
# cmake/windows/buildspec.cmake keys the dependency slice off
|
||||
# CMAKE_VS_PLATFORM_NAME, which only a VS generator sets.
|
||||
run: cmake -S . -B build -A x64
|
||||
|
||||
- name: Build
|
||||
run: cmake --build build --config Release
|
||||
|
||||
- name: Test (core library)
|
||||
run: ctest --test-dir build -C Release --output-on-failure
|
||||
|
||||
- name: Show what was built
|
||||
run: dir build\package\bin
|
||||
|
||||
- name: Upload plugin
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: streamer-tools-camera-windows-x64
|
||||
path: build/package
|
||||
|
||||
Reference in New Issue
Block a user