Skip to content

The truly free, open-source, local-first, cross-platform CapCut replacement. Scriptable through a JSON-RPC API & MCP.

ci: the Windows build script gets a stack, and Intel Macs get a runtime

Jareer042688f53834
diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml
index 705f5c69..fe4ed43d 100644
--- a/.github/workflows/build-app.yml
+++ b/.github/workflows/build-app.yml
@@ -55,6 +55,10 @@ env:
# ONNX Runtime, for the Linux bundles: the version the ort crate is built
# against (see ort-sys's dist table), as Microsoft's own shared build.
ORT_VERSION: 1.28.0
+ # And for Intel Macs, which neither ort nor Microsoft build for any more:
+ # the last release Microsoft made for them. The ort crate asks for the
+ # runtime's API 17 and up, which this carries.
+ ORT_INTEL_MAC_VERSION: 1.23.2
# Oldest macOS the bundles run on. Apple silicon Macs all run newer than
# this; it is the Intel floor.
MACOSX_DEPLOYMENT_TARGET: "12.0"
@@ -211,6 +215,28 @@ jobs:
# target set, the check is folded away at compile time.)
echo "RUSTFLAGS=-C link-arg=$(xcrun clang --print-file-name=libclang_rt.osx.a)" >> "$GITHUB_ENV"
+ # ONNX Runtime on an Intel Mac. ort ships no static build for
+ # x86_64-apple-darwin, so the cutout's runtime is Microsoft's shared
+ # one, linked dynamically the way Linux does it, and bundled into
+ # Frameworks by dylibbundler along with FFmpeg's - the install name
+ # is @rpath, so the bundler is told where to look. Apple silicon
+ # keeps ort's static build.
+ - name: ONNX Runtime (Intel macOS)
+ if: matrix.platform == 'macos' && matrix.arch == 'x86_64'
+ run: |
+ set -euo pipefail
+ stem="onnxruntime-osx-x86_64-$ORT_INTEL_MAC_VERSION"
+ curl -fsSL --retry 5 --retry-all-errors -o onnxruntime.tgz \
+ "https://github.com/microsoft/onnxruntime/releases/download/v$ORT_INTEL_MAC_VERSION/$stem.tgz"
+ tar -xzf onnxruntime.tgz
+ test -f "$stem/lib/libonnxruntime.$ORT_INTEL_MAC_VERSION.dylib"
+ ln -sf "libonnxruntime.$ORT_INTEL_MAC_VERSION.dylib" "$stem/lib/libonnxruntime.dylib"
+ {
+ echo "ORT_LIB_LOCATION=$PWD/$stem/lib"
+ echo "ORT_PREFER_DYNAMIC_LINK=1"
+ echo "ORT_DIR=$PWD/$stem"
+ } >> "$GITHUB_ENV"
+
# ── Windows ────────────────────────────────────────────────────────
# LLVM: libclang for bindgen on both architectures, and the C/C++
# compiler on arm64. Chocolatey's LLVM is x64; the arm64 runner takes
@@ -410,7 +436,8 @@ jobs:
dylibbundler -od -b \
-x "$app/Contents/MacOS/concat" \
-d "$app/Contents/Frameworks" \
- -p @executable_path/../Frameworks
+ -p @executable_path/../Frameworks \
+ ${ORT_DIR:+-s "$ORT_DIR/lib"}
# Nothing outside the bundle may remain: a load path into
# Homebrew would break on a Mac without it.
diff --git a/engine/crates/concat/build.rs b/engine/crates/concat/build.rs
index 6e10369c..a6fb369a 100644
--- a/engine/crates/concat/build.rs
+++ b/engine/crates/concat/build.rs
@@ -18,9 +18,23 @@ fn main() {
// Not `EmbedForSoftwareRenderer`, which pre-decodes to raw pixels: that is
// for MCUs with no filesystem, it is the only kind the software renderer
// can read, and Skia and FemtoVG cannot use it at all.
- let config = slint_build::CompilerConfiguration::new()
- .embed_resources(slint_build::EmbedResourcesKind::EmbedFiles);
- slint_build::compile_with_config("ui/app.slint", config)
+ //
+ // On its own thread with a deep stack: the Slint compiler recurses over
+ // the tree, and the tree has outgrown the megabyte a main thread gets
+ // on Windows - the release build died there with a stack overflow and
+ // nothing else to say. Half a gigabyte is reserved, not committed.
+ let compile = std::thread::Builder::new()
+ .name("slint".into())
+ .stack_size(512 << 20)
+ .spawn(|| {
+ let config = slint_build::CompilerConfiguration::new()
+ .embed_resources(slint_build::EmbedResourcesKind::EmbedFiles);
+ slint_build::compile_with_config("ui/app.slint", config)
+ })
+ .expect("could not start the Slint compiler thread");
+ compile
+ .join()
+ .expect("the Slint compiler thread panicked")
.expect("failed to compile ui/app.slint");
// Three facts about the build that the built thing cannot ask for at run