Skip to content

build: Investigate cross-compiling the full OBS C/C++ build for Windows and macOS from Linux #697

Open

Description

@zackees

Part of the cross-platform meta.

Problem

The Rust side is cross-checked from Linux, but the CMake C/C++/Qt OBS build (macos-build, windows-build) and release packaging (release-rust.yaml) still need native runners. Those are the slowest jobs.

Change (investigation first)

Acceptance

  • A written plan with measurements.
  • Follow-up issues filed for each job that can move.

Activity

  1. added
    P3
    size:M
    on Oct 25, 2026
  2. zackees commented on Oct 25, 2026

    @zackees
    MemberAuthor

    /ready

    Triage: an investigation with a concrete scope (Windows via clang-cl/xwin or MinGW, macOS SDK/Qt/signing) and acceptance criteria (a written plan with measurements, plus one follow-up issue per job that can move). No dependencies are open. It builds on #516's cross-compile findings but doesn't wait on them. P3, size:M.

  3. added
    ready
    on Oct 25, 2026
  4. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    Claiming: investigation of Linux-hosted Windows and macOS native builds.

    1. Inventory the current native build and packaging jobs, dependencies, and the earlier cross-compile findings.
    2. Run focused Linux cross-compile probes where toolchains are already available; measure setup and build costs against current CI logs.
    3. Write a plan stating which jobs can move, which must stay native, expected time saved, and file focused follow-up issues for viable moves.

    First research PR expected today.

  5. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    Progress: current release-gate run 40409686763 has native app builds at Windows x64 6m06s, Windows arm64 13m38s, macOS arm64 11m01s and macOS x86_64 7m43s. The existing Linux cross-compile job (mac-arm64, win-x64) took 3m24s, but only compiles objects: it does not link, run, sign or package the app, so its time cannot be counted as a native-runner saving. The current native jobs already cross-build Windows arm64 on x64 and macOS x86_64 on arm64. I am checking the remaining link/Qt/SDK and packaging constraints before recommending a route.

  6. moved this from Ready to In progress in obs-rust Multiviewon Oct 27, 2026
  7. removed their assignment
    on Oct 28, 2026
  8. moved this from In progress to Ready in obs-rust Multiviewon Oct 28, 2026
  9. zackees commented on Oct 30, 2026

    @zackees
    MemberAuthor

    Claiming: #697 — investigation of Linux-hosted Windows and macOS builds (the claim lapsed on 2026-10-28 with the plan still incomplete).

    Plan:

    1. Inventory the native build and packaging jobs and their current timings from the newest release-gate and scheduled runs.
    2. Probe the cross toolchains this Linux host actually has (clang-cl / lld-link / xwin, MinGW, osxcross) and what the existing cross job already compiles.
    3. Write the plan: which jobs can move, measured expected saving, and what must stay native; file one follow-up per movable job.
  10. zackees commented on Oct 30, 2026

    @zackees
    MemberAuthor

    Investigation result: the C/C++ compile half already runs on Linux (#1075, cmake/cross), and the link half is no longer blocked — soldr 0.9.45 exposes the full target toolchain. What still keeps the jobs native is packaging, signing and the run itself, not the compiler.

    Where the time actually goes

    Measured from the last green release gate, run 41007587429 (2026-10-30), per job:

    Job Build OBS-Studio-Rust Package OBS-Studio-Rust Job total
    Linux x86_64 6m40 1m41 9m15
    macOS arm64 8m01 2m35 12m48
    macOS x86_64 7m50 2m52 13m08
    Windows arm64 9m43 1m38 12m49
    Windows x64 12m25 2m15 16m06

    The gate's wall time is bounded by those legs; the Linux cross-compile check that runs beside them takes 3m46 for two targets: mac-arm64 configure 46 s + compile 47 s, win-x64 configure 42 s + compile 20 s (275 ninja edges, unity groups, cache-warm). That is compile-only — it links nothing — so it is a lower bound, not a prediction.

    What the existing cross check covers

    cmake/cross/CMakeLists.txt compiles, for win-x64 / mac-arm64 / mac-x64: every libobs source, the Rust build's C halves, the platform plugins (win-capture, graphics-hook, get-graphics-offsets, win-wasapi, win-dshow, obs-nvenc, obs-qsv11, nv-filters, d3d11, opengl, mac-capture, mac-avcapture, mac-virtualcam, mac-videotoolbox, decklink, coreaudio, obs-ffmpeg, obs-outputs, aja, …), and the frontend's Windows/macOS unity groups with real uic output. Same unity batches and PCHs as the native build. It links nothing, so link errors — the ones that only native runners find today — are outside it.

    What was the blocker, and why it is gone

    cmake/common/soldr.cmake carried a TODO: it located the cross compiler and SDK by hand "until soldr has soldr cc --target <triple> --print-cc / --print-sysroot" (soldr#2335). soldr 0.9.45 on this box has it. Verified here:

    Probe Windows (x86_64-pc-windows-msvc) macOS (aarch64-apple-darwin)
    soldr cc --print-cc <soldr>/cc-driver/v1/…-clang same shape
    --print-linker clang driver → lld-link clang driver → ld64.lld
    --print-sysroot <soldr>/sdk/…/xwin/2026-06-22/xwin <soldr>/apple-sdk/14.5/darwin-aarch64/package/sdk
    --print-ar / --print-rc llvm-lib / llvm-rc llvm-ar / —
    link a C exe hello.exe, 9,728 B hello-mac, 49,968 B Mach-O
    link a shared library libprobe.dll, 8,192 B libprobe…dylib, 16,880 B

    So a PE executable, a PE DLL, a Mach-O executable and a Mach-O dylib all link from this Linux host. Rust already links for these targets since #695/#925, which is why Rust Cross Lint is a Linux job today.

    Not verified from this host: linking libobs itself against the prebuilt .deps import libraries (the cross check's .deps are not present in this checkout), C++ exceptions/RTTI across the MSVC ABI, and a cold (cache-less) full build. Those are what the spike below measures.

    Which jobs can move

    • Windows x64 — movable, once the spike passes. cmake/windows/cpackconfig.cmake sets CPACK_GENERATOR ZIP, so packaging is a zip plus ci/windows_zip_check.py symbol split: no Windows tool. Signing is signtool in sign-windows.yaml, which osslsigncode can do on Linux, and the packaged-startup smoke test must stay on a Windows runner regardless.
    • Windows arm64 — cannot move as-is. cmake/common/soldr.cmake already documents why there is no win-arm64 cross alias: libobs/util/threading-windows.h (a public header) uses MSVC's ARM64 __ldar*/__stlr* intrinsics, which clang does not provide. It stays native.
    • macOS — compile could move, the job cannot. package-macos needs codesign --deep, xcrun notarytool and stapler, and it makes the DMG with hdiutil; none of that runs on Linux. Moving the ~8 min build step would leave a download plus ~3 min of signing/packaging, so a macOS runner is still in the chain.

    Expected saving, stated conservatively

    • Windows x64: 12m25 of build replaced by a Linux leg of the same shape as the Linux x86_64 one (6m40) plus an artifact hop — about 5 min off that leg, more if the Linux leg keeps its warm caches.
    • macOS: about 5 min off each leg (8 min build → download), with signing/packaging still native.
    • The floor is whichever job stays longest: Windows arm64 at 12m49 until that leg changes, so the gate does not get under ~13 min from this work alone.

    Follow-up

    Filed as #3059: the spike switches soldr.cmake to soldr cc --target … --print-*, links libobs and the platform plugins for win-x64 and both macOS aliases from Linux, and measures a cold build per alias before the compile-only check becomes a real link. Nothing moves before that passes, so I have not filed the per-job move issues yet — that would be speculative work for the coordinator to carry.

    Refs #700, #1075, #695, #930.

  11. moved this from Ready to In progress in obs-rust Multiviewon Oct 30, 2026
  12. moved this from In progress to Ready in obs-rust Multiviewon Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3readysize:M

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions