Skip to content

Commit f2ffd83

Browse files
Build the OpenFX plugin for Linux, where Resolve also runs
Resolve is a Linux application and the OFX plugin has only ever shipped for macOS and Windows. Nothing in the OFX render is platform-specific -- it is a CPU pass over a host-supplied buffer -- so what was missing was a way to configure the project without the FFGL half. OLDCATHODE_BUILD_FFGL, the option idler already carries, is that way. The FFGL plugin, the SDK submodule and GLEW are one dependency group; turning it off leaves the OFX target with no GL loader anywhere in the configure, which matters because the SDK's own find_package(GLEW REQUIRED) would otherwise fail at configure time on a machine that needs no GL at all. The job builds in an AlmaLinux 8 container rather than on the ubuntu image, for glibc 2.28 against 2.39: Resolve's supported Linux is Rocky 8.6, and a plugin linked against a newer glibc is refused by the loader there, while anything newer loads a 2.28 build fine. gcc-toolset-13 supplies the compiler and its runtime is linked statically, since it is not installed on a stock Rocky 8. The collect step asserts the glibc floor rather than trusting the image. Not yet loaded into Resolve on Linux -- this is a build, not a measurement. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent c4ebb61 commit f2ffd83

2 files changed

Lines changed: 102 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,98 @@ jobs:
178178
path: installers/*
179179
if-no-files-found: warn
180180

181+
linux-ofx:
182+
name: linux-x86_64 (OpenFX)
183+
runs-on: ubuntu-latest
184+
# AlmaLinux 8 rather than the ubuntu image, for glibc 2.28 against 2.39.
185+
# Resolve's supported Linux is Rocky 8.6, and a plugin linked against a
186+
# newer glibc is refused by the loader on the distro Blackmagic actually
187+
# ships for -- while anything newer than Rocky 8 loads a 2.28 build
188+
# perfectly well. This is the widest target, not a concession.
189+
#
190+
# There is no FFGL half to this job. Resolume has no Linux build, the FFGL
191+
# SDK has no Linux path, and the OpenFX plugin is a CPU render that never
192+
# makes a GL call.
193+
container: almalinux:8
194+
steps:
195+
# Ahead of checkout on purpose: actions/checkout shells out to git and
196+
# the base image has none. gcc-toolset-13 because the stock gcc 8.5
197+
# predates parts of the C++17 library this code uses.
198+
- name: Toolchain
199+
run: |
200+
dnf -y install git cmake zip binutils gcc-toolset-13
201+
source /opt/rh/gcc-toolset-13/enable
202+
gcc --version
203+
204+
# No submodules: the FFGL SDK is the only one and this job does not build
205+
# FFGL. The OpenFX SDK subset is vendored in-tree.
206+
- uses: actions/checkout@v7
207+
208+
# OLDCATHODE_BUILD_FFGL=OFF is what makes the job possible at all. With it
209+
# ON, the SDK's own find_package(GLEW REQUIRED) fails at CONFIGURE time,
210+
# so the build dies before compiling a line of a plugin that needs no GL
211+
# loader.
212+
#
213+
# Static libstdc++/libgcc because gcc-toolset-13's runtime is not
214+
# installed on a stock Rocky or Alma 8 -- a dynamically linked build
215+
# would fail to load on precisely the machines this targets.
216+
- name: Configure
217+
run: |
218+
source /opt/rh/gcc-toolset-13/enable
219+
cmake -B build \
220+
-DCMAKE_BUILD_TYPE=Release \
221+
-DOLDCATHODE_BUILD_FFGL=OFF \
222+
-DOLDCATHODE_BUILD_TOOLS=OFF \
223+
-DCMAKE_CXX_FLAGS="-static-libstdc++ -static-libgcc"
224+
225+
- name: Build
226+
run: |
227+
source /opt/rh/gcc-toolset-13/enable
228+
cmake --build build --parallel
229+
230+
- name: Collect artifact
231+
run: |
232+
so="build/OldCathode.ofx.bundle/Contents/Linux-x86-64/OldCathode.ofx"
233+
test -f "$so"
234+
235+
# `nm ... | grep -q` SIGPIPEs under `bash -eo pipefail` when grep
236+
# FINDS its match, failing the release on a correct binary. Captured
237+
# and matched with `case` instead, as the macOS job does.
238+
__syms=$( nm -D --defined-only "$so" )
239+
case "$__syms" in
240+
*OfxGetPlugin*) ;;
241+
*) echo "expected OfxGetPlugin, got: $__syms"; exit 1 ;;
242+
esac
243+
244+
# The whole reason for the container, asserted rather than assumed:
245+
# the highest glibc symbol version the binary asks for must not be
246+
# newer than Rocky 8's 2.28. Building in the right image is easy to
247+
# get right and impossible to notice getting wrong.
248+
__glibc=$( objdump -T "$so" | grep -o 'GLIBC_[0-9.]*' | sort -uV | tail -1 )
249+
echo "highest glibc requirement: $__glibc"
250+
if [ "$( printf '%s\nGLIBC_2.28\n' "$__glibc" | sort -uV | tail -1 )" != "GLIBC_2.28" ]; then
251+
echo "$__glibc is newer than Rocky 8 provides"; exit 1
252+
fi
253+
readelf -d "$so" | grep NEEDED
254+
255+
mkdir -p "ofxout/OldCathode.ofx.bundle/Contents/Linux-x86-64"
256+
cp "$so" "ofxout/OldCathode.ofx.bundle/Contents/Linux-x86-64/OldCathode.ofx"
257+
ls -R ofxout
258+
259+
- name: Archive (zip)
260+
run: |
261+
cd ofxout
262+
zip -r "../old-cathode-ofx-linux-x86_64.zip" ./*
263+
264+
- uses: actions/upload-artifact@v7
265+
with:
266+
name: old-cathode-linux-x86_64
267+
path: "*.zip"
268+
if-no-files-found: error
269+
181270
release:
182271
name: Publish release
183-
needs: [build, windows-installer]
272+
needs: [build, linux-ofx, windows-installer]
184273
if: startsWith(github.ref, 'refs/tags/v')
185274
runs-on: ubuntu-latest
186275
steps:

CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ endif()
3232

3333
option(OLDCATHODE_BUILD_TOOLS "Build the offline render harness" ON)
3434

35+
# The FFGL plugin, the FFGL SDK submodule and GLEW are one dependency group,
36+
# and the OpenFX plugin belongs to none of it. Turning this OFF builds the OFX
37+
# plugin alone, with no GL loader anywhere in the configure -- which is what
38+
# the Linux job does, because the FFGL SDK has no Linux path, and GLEW would
39+
# otherwise have to be installed to build something that never calls it.
40+
option(OLDCATHODE_BUILD_FFGL "Build the FFGL plugin (needs the FFGL SDK and, off macOS, GLEW)" ON)
41+
42+
if(OLDCATHODE_BUILD_FFGL)
3543
# ---------------------------------------------------------------------------
3644
# The Resolume FFGL SDK, as a git submodule under external/.
3745
# ---------------------------------------------------------------------------
@@ -135,6 +143,8 @@ elseif(APPLE)
135143
CACHE PATH "" FORCE)
136144
endif()
137145

146+
endif() # OLDCATHODE_BUILD_FFGL
147+
138148
# ---------------------------------------------------------------------------
139149
# The OpenFX build of the same effect, for Resolve/Vegas/Nuke/Natron. CPU
140150
# render against the vendored OFX SDK subset under external/openfx (C headers
@@ -195,7 +205,9 @@ if(BUILD_OFX)
195205
endif()
196206
endif()
197207

208+
if(OLDCATHODE_BUILD_FFGL)
198209
install(TARGETS OldCathode
199210
LIBRARY DESTINATION "."
200211
BUNDLE DESTINATION "."
201212
)
213+
endif() # OLDCATHODE_BUILD_FFGL

0 commit comments

Comments
 (0)