Skip to content

cef: Cross-build CEF 8078 for Windows x64 and arm64 from Linux (part of #1864) #2417

Open

Description

@zackees

Part of #1864 (build-host decision recorded there). Windows still ships CEF 7871 (Chromium 150), which no longer gets security fixes.

Scope

  • recipes/cef/windows in obs-rust/obs-studio-libs: CEF branch 8078, at the same commit as the Linux build, cross-compiled from Linux (target_os="win", packaged Windows SDK toolchain), with proprietary_codecs=true ffmpeg_branding=Chrome symbol_level=1 chrome_pgo_phase=0, run under bosn.
  • A recipe test like tests/test_cef_recipe.py that checks the codec and symbol flags.
  • cef_binary_8078_windows_x64.zip and _arm64.zip in the obs-rust/cef 8078 release, with SHA-256s, then the CMakePresets.json hashes in obs-studio.

Acceptance criteria

Activity

  1. added
    P1
    size:L
    on Oct 25, 2026
  2. zackees commented on Oct 25, 2026

    @zackees
    MemberAuthor

    /ready

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

    @zackees
    MemberAuthor

    A worker looked at this before claiming it, and is not claiming it yet. Two prerequisites are missing:

    1. Windows toolchain package. Chromium's Linux→Windows cross build takes the MSVC and Windows SDK as a zip, set with DEPOT_TOOLS_WIN_TOOLCHAIN_BASE_URL and GYP_MSVS_HASH_<hash>. Google's own package is internal. The usual way to make one is depot_tools/win_toolchain/package_from_installed.py, run on a Windows machine with Visual Studio 2022. Nobody has made one for obs-rust or put it anywhere. The open question is who makes it, and where it is stored. A Windows host would work, or an xwin/msvc-wine download rearranged into the same layout. That second route is untested and has its own MSVC license question.
    2. Disk space. The Linux x86_64 recipe needs about 150 GB (bosn.toml), but the build host has 139 GB free (93% full). A Chromium sync is also in progress under obs-studio-extern/obs-studio-libs/out/cef (37 GB so far, started 2026-10-25 12:48). A Windows checkout (target_os=["win"]) plus x64 and arm64 output directories needs space freed first, or another disk.

    Once the toolchain package exists, recipes/cef/windows follows the Linux recipe: the same branch and GN defines with target_os="win", --x64-build and --arm64-build, and a test of the codec flags.

  5. zackees commented on Oct 31, 2026

    @zackees
    MemberAuthor

    Status on the recorded blocker (the Windows toolchain package), measured on the obs-studio5 worker host, 2026-10-31.

    The toolchain inputs are now on this host. soldr 0.9.48 resolves both Windows MSVC targets and their xwin payloads:

    soldr cc --target x86_64-pc-windows-msvc  --print-sysroot
      -> ~/.soldr/sdk/x86_64-pc-windows-msvc/xwin/2026-06-22/xwin
    soldr cc --target aarch64-pc-windows-msvc --print-sysroot
      -> ~/.soldr/sdk/aarch64-pc-windows-msvc/xwin/2026-06-22/package
    soldr cc --target x86_64-pc-windows-msvc  --print-rc
      -> ~/.soldr/bin/llvm-21.1.5-r2/hardlinked/bin/llvm-rc
    

    The x64 payload is 1.1 GB and carries exactly the two header/library trees depot_tools' win_toolchain wants, for both target arches:

    • crt/include (MSVC STL + UCRT headers) and crt/lib/{x86_64,aarch64} (*.lib per arch, enclave subdirs included);
    • sdk/include/{ucrt,um,shared,winrt,cppwinrt} at 10.0.26100, and sdk/lib/{um,ucrt}/{x86_64,aarch64};
    • soldr-case-overlay-v1-*.yaml, an explicit case-insensitive overlay (the reason the payload works on a case-sensitive Linux FS at all).

    There are no cl.exe / link.exe / rc.exe binaries in it, which matches the build: Chromium on Windows compiles with clang-cl, links with lld-link, and archives with llvm-lib, all of which are already on the host through soldr's LLVM; llvm-rc is provided for the resource steps.

    So the second route noted above — "an xwin/msvc-wine download rearranged into the same layout" — has its inputs, including the arm64 half, without a Windows machine. What does not exist yet is the packaging: the zip served through DEPOT_TOOLS_WIN_TOOLCHAIN_BASE_URL, its GYP_MSVS_HASH_<hash> name, and depot_tools' win_toolchain.json (VC/Tools/MSVC/<version>/{include,lib} and Windows Kits/10/{Include,Lib}/<version> symlink farm plus the path/version fields). That is the untested part; nothing in this comment says it works.

    One more constraint found while checking the recipe path: CEF's automate-git.py at branch 8078 has no target-OS switch — its only arch flags are --x64-build / --arm64-build, and it derives the host OS (grep -n 'target.os\|target_os' automate-git.py finds no option). A Windows cross build therefore cannot ride the Linux/macOS recipe's sync/build steps; it needs its own GN invocation with target_os="win" plus win_toolchain's packaged files, after gclient sync has produced the tree. That is the design the recipes/cef/windows recipe has to encode, and it should be split sync / build / pack like the Linux one — the arm64 runs died as bosn cancelled whenever the launching tick ended, so a build must be launched in a way that outlives the tick.

    Next step I would take here, in order: (1) a packaging script + a flag test in obs-studio-libs (tests/test_cef_recipe.py should fail while the Windows recipe lacks the codec/symbol GN defines); (2) one real gclient sync + GN configure against the packaged toolchain to prove or kill the cross-build route; (3) only then the hours-long build.

    Not claiming the issue: step (2) is the fork in the road and it has not been run.

  6. zackees commented on Oct 31, 2026

    @zackees
    MemberAuthor

    Claiming: CEF 8078 cross-build for Windows x64 and arm64 from Linux (part of #1864).

    The recorded blocker was the Windows toolchain package. Measured on this host today, that part is solved: soldr cc --print-sysroot's xwin payload for x86_64-pc-windows-msvc (1.1 GB, both arches) converts to the archive depot_tools wants, and depot_tools itself accepts it.

    1. PR 1 (now): recipes/cef/windows/package_win_toolchain.py + build.sh + bosn.toml tasks in obs-rust/obs-studio-libs, with the Windows cross-build tests. Evidence in the PR: a real package of the host payload (273 MB zip) installed by depot_tools' own get_toolchain_if_necessary.py from a file:// base URL, which re-hashed the extracted tree and wrote win_toolchain.json (version 2026).
    2. PR 2: the fork in the road — one gclient sync + GN configure with target_os="win" against that toolchain on the existing out/cef checkout, to prove or kill the cross-build route before any multi-hour ninja run.
    3. Then the real build and a pack of cef_binary_8078_windows_x64.zip / _windows_arm64.zip, with the codec flags checked in args.gn and the archive attached to an obs-rust/cef release.

    One thing to expect: build/vs_toolchain.py on Linux mounts the toolchain through ciopfs (case-insensitive), so the recipe checks for it; the install proof above ran with --no-junction and did not need the mount.

  7. zackees commented on Oct 31, 2026

    @zackees
    MemberAuthor

    PR 1 is up: obs-rust/obs-studio-libs#30.

    It adds recipes/cef/windows/{build.sh,package_win_toolchain.py} and the cef-win-* bosn tasks, with the RED/GREEN tests. The toolchain half is measured, not projected: the host's real xwin payload packages to a 273 MB zip in 33 s, and depot_tools' own get_toolchain_if_necessary.py installs it from a file:// base URL, re-hashes the extracted tree to the name it fetched (534bb6ee…) and writes win_toolchain.json with version 2026.

    One correction to the plan above, from that run: the zip name must hash the vs_files\ path prefix depot_tools uses, not the bare relative path — the first attempt was rejected as corrupt. Pinned in the module and its test.

    Still open, and the next PR: gn gen with target_os="win" against this toolchain on the warm out/cef checkout. Nothing here claims a Windows archive builds yet.

  8. moved this from Ready to In progress in obs-rust Multiviewon Oct 31, 2026
  9. zackees commented on Oct 31, 2026

    @zackees
    MemberAuthor

    Worker tick (2026-10-31 ~15:25Z): PR 1 landed — obs-rust/obs-studio-libs#30 is merged (74d7dee, 15:12Z), so the Windows toolchain half of this issue is on main.

    • The squash carried both commits (ca24822 RED, 53b2940 GREEN); the local branch tip is byte-identical to origin/main (git diff origin/main --stat empty), so nothing was lost in the squash and the branch can be dropped.
    • What that proves: soldr's xwin payload (x86_64-pc-windows-msvc, both arches) packages to a depot_tools-shaped toolchain zip and depot_tools' own get_toolchain_if_necessary.py installs it from a file:// base URL, re-hashing to the fetched name and writing win_toolchain.json with version 2026.

    Next step, and why it is not in this tick: the actual cef-windows-build-* cross build is the long leg, and this host is already running the arm64 Linux CEF build (#3062, bosn job 60, 1h15m in, .ninja_log still growing). Two 130k+-target Chromium builds at once would thrash the box and both would thrash the 271 GB free on /. The Windows build is queued behind #3062 rather than started concurrently.

    Still open on the acceptance criteria: the Windows archives (cef_binary_8078_windows_{x64,arm64}.zip, SHA-256s, then the CMakePresets.json hashes), a Windows app-lane build against them, the H.264 MP4 / dock render on Windows 10/11, and the #1864 version-floor guard.

  10. removed their assignment
    on Nov 1, 2026
  11. moved this from In progress to Ready in obs-rust Multiviewon Nov 1, 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

    P1readysize:L

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions