Skip to content

recipe(cef): package the Windows cross-build toolchain and add the Windows recipe (#2417) - #30

Merged
zackees merged 2 commits into
mainfrom
recipe/cef-windows-toolchain
Oct 31, 2026
Merged

zackees merged 2 commits into
mainfrom
recipe/cef-windows-toolchain

Conversation

@zackees

@zackees zackees commented Oct 31, 2026

Copy link
Copy Markdown
Member

The Windows half of obs-rust/obs-studio#2417 (part of #1864): the recipe and the toolchain package that a Linux → Windows CEF build needs, with the recorded blocker retired by measurement rather than assumption.

Refs obs-rust/obs-studio#2417.

What changed

  • recipes/cef/windows/package_win_toolchain.py turns soldr's xwin payload into the archive depot_tools installs as a Windows toolchain: VC/Tools/MSVC/<msvc>/{include,lib/{x64,arm64}}, Windows Kits/10/{Include,Lib}/<sdk>/…, VS_VERSION. It names the zip with the tree's sha1, which is how build/vs_toolchain.py finds it.
  • recipes/cef/windows/build.sh — sync|toolchain|build|pack [x64|arm64]. sync uses CEF's automate script; build packages the toolchain, exports DEPOT_TOOLS_WIN_TOOLCHAIN_BASE_URL, DEPOT_TOOLS_WIN_TOOLCHAIN=1 and GYP_MSVS_HASH_3bfcb536c8, then calls GN directly with target_os="win" (automate-git.py on branch 8078 has no target-OS switch) and ninja; pack makes cef_binary_8078_windows_{x64,arm64}.zip with the target's libcef_dll_wrapper.lib and checks args.gn for the codecs, the OS and the CPU.
  • bosn.toml: cef-win-{sync,toolchain,build,pack} and the arm64 trio, on the same cef-linux stack and out/cef checkout.

RED

ca24822 adds only tests/test_cef_windows_recipe.py, which fails against the tree before the recipe exists:

7 failed in 0.12s
E   FileNotFoundError: .../recipes/cef/windows/build.sh

GREEN

53b2940, full suite 58 passed, ruff check clean.

Evidence: depot_tools installs the package (real payload, not a fixture)

Packaging the host's actual payload (soldr 0.9.48, x86_64-pc-windows-msvc xwin, 1.1 GB, both arches):

$ python3 recipes/cef/windows/package_win_toolchain.py package \
    --xwin ~/.soldr/sdk/x86_64-pc-windows-msvc/xwin/2026-06-22/xwin --out <scratch>/wintoolchain
toolchain zip: <scratch>/wintoolchain/534bb6ee0faf7f1c1563c5e57cabb689bcece827.zip   (273 MB, 33 s)
toolchain sha1: 534bb6ee0faf7f1c1563c5e57cabb689bcece827

Then depot_tools' own installer, served over a file:// base URL — the same code path gclient runhooks uses:

$ DEPOT_TOOLS_WIN_TOOLCHAIN_BASE_URL=file://<scratch>/wintoolchain \
  python3 <depot_tools>/win_toolchain/get_toolchain_if_necessary.py --force --no-junction \
    --toolchain-dir <scratch>/tcroot --output-json <scratch>/win_toolchain.json \
    534bb6ee0faf7f1c1563c5e57cabb689bcece827
Extracting .../534bb6ee0faf7f1c1563c5e57cabb689bcece827.zip...
Calculating hash of toolchain in vs_files/534bb6ee0faf7f1c1563c5e57cabb689bcece827. Please wait...
EXIT=0

win_toolchain.json: "version": "2026", "path": …/vs_files/534bb6ee…, "win_sdk": …/vs_files/534bb6ee…/Windows Kits/10. No "unexpected value" line: the extracted tree re-hashes to the name it was fetched by.

That last part is a measured detail, not a guess: the first attempt named the zip without the vs_files path component and depot_tools rejected it as corrupt (got 534bb6ee… instead of 7ce998de…). CalculateHash strips the hash directory but keeps the install root, so the hashed key is vs_files\vc\tools\…; the module and its test now pin that.

What is not proven

The GN configure. target_os="win" with this toolchain has not been run, so this PR claims the packaging is correct and the recipe is shaped for the cross build — not that cef_binary_8078_windows_x64.zip builds yet. That is the next step in #2417, on the existing out/cef checkout (47 GB, warm), after which the arm64 run and the release upload. Also untested: build/vs_toolchain.py's Linux path mounts the toolchain through ciopfs; the recipe refuses to run without it, and the install proof above bypassed the mount with --no-junction.

@zackees zackees left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coordinator review: the RED (ca24822) then GREEN (53b2940) order looks right. The packaging claim is backed by a real depot_tools install, including the vs_files hash-key detail, which is now pinned in a test. Calling python3 directly in build.sh matches recipes/cef/linux/build.sh. Both rm -rf calls use ${VAR:?} guards. This repo has no hosted checks, so the merge rests on the local pytest (58 passed) and ruff runs in the description. The GN configure step is explicitly not yet proven. That's fine for a recipe PR, but the cef-win-build bosn task should not be treated as working until the follow-up in obs-rust/obs-studio#2417 runs it. No blocking findings.

@obs-rust-project-manager obs-rust-project-manager Bot moved this to Ready to merge in obs-rust Multiview Oct 31, 2026
@zackees
zackees merged commit 74d7dee into main Oct 31, 2026
@obs-rust-project-manager obs-rust-project-manager Bot moved this from Ready to merge to Done in obs-rust Multiview Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant