Skip to content

obs-scripting: Python host code behind obs-scripting-python-host.h (#882) - #2012

Merged
zackees merged 2 commits into
masterfrom
facade/882-python-runtime
Oct 24, 2026
Merged

zackees merged 2 commits into
masterfrom
facade/882-python-runtime

Conversation

@zackees

@zackees zackees commented Oct 23, 2026

Copy link
Copy Markdown
Member

Refs #882 (slice 3 of 3: Python runtime). Stacked on #1993; retargets to master once that merges. With #1987 and #1993, this takes every shared/obs-scripting entry off ci/platform-ifdef-baseline.json.

obs-scripting-python-host.h, implemented in obs-scripting-python-host-{windows,macos,posix}.c.h (own unity groups and PCHs):

  • obs_python_host_load_at_start(): POSIX true; Windows/macOS wait for the user's install folder (was the obs-scripting.c.h conditional).
  • obs_python_host_home(): the install folder (Windows), or its Python.framework/Versions/M.m (macOS).
  • obs_python_host_no_bytecode(): macOS true.
  • obs_python_host_module_dirs(): macOS PlugIns, then Resources (absolute, when present); others: ../SCRIPT_DIR from the executable, then absolute SCRIPT_DIR.

Also: the Windows #define __func__ __FUNCTION__ goes (MSVC has had __func__ since 2015), and so does the unused <dlfcn.h> include. The MSVC pragmas around the SWIG runtime become /wd4100 /wd4204 on the Python groups. cmake/cross compiles the Windows and macOS hosts. Behavior is unchanged, except that PYTHONHOME is now converted with the buffer's real size on every host.

RED (first commit): test_obs_scripting_python_host_{windows,macos,posix} (Tier 2, plain C on Linux) fail against stub hosts.
GREEN: local Tier 2 passes 402/402, including all three. ./lint passes (ifdef ratchet included), ci/test_cross_sources.py passes, and cmake/cross/docker.sh win-x64 mac-arm64 exits 0.

Tiers 1/3/4 do not apply (C build-structure refactor).

@zackees
zackees force-pushed the facade/882-python-import branch from d256063 to abc921c Compare October 23, 2026 23:53
@zackees
zackees force-pushed the facade/882-python-runtime branch from 8e1b4b8 to 74e1c66 Compare October 23, 2026 23:54
@zackees
zackees changed the base branch from facade/882-python-import to master October 24, 2026 00:41
@zackees
zackees enabled auto-merge October 24, 2026 00:42
@zackees
zackees force-pushed the facade/882-python-runtime branch from 74e1c66 to a8ed98f Compare October 24, 2026 00:42
@zackees

zackees commented Oct 24, 2026

Copy link
Copy Markdown
Member Author

Coordinator: #1993 landed. I retargeted this PR to master and rebased only its own two commits onto master (--onto, no conflicts). Auto-merge is on.

obs-scripting-python-host.h with stub Windows/macOS/POSIX hosts in per-OS
unity groups; test_obs_scripting_python_host_{windows,macos,posix} fail
against the stubs.
)

Whether Python loads at start, PYTHONHOME, the macOS no-bytecode setting
and the sys.path directories move into obs-scripting-python-host-{windows,
macos,posix}. The Windows __func__ define and the unused <dlfcn.h> go
(MSVC has had __func__ since 2015), and the MSVC pragmas around the SWIG
runtime become /wd options. Baseline: the last three obs-scripting
entries (8) to 0.
@zackees
zackees force-pushed the facade/882-python-runtime branch from a8ed98f to 30f6cae Compare October 24, 2026 00:43
@zackees
zackees added this pull request to the merge queue Oct 24, 2026
Merged via the queue into master with commit 6dbe946 Oct 24, 2026
33 checks passed
@zackees
zackees deleted the facade/882-python-runtime branch October 26, 2026 15:43
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