Skip to content

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

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

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

Conversation

@zackees

@zackees zackees commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Refs #882 (slice 2 of 3: Python import). Independent of #1987 (slice 1); the two touch neighboring lines in ci/platform-ifdef-baseline.json and cmake/cross/CMakeLists.txt only.

  • The Windows (python312.dll) and macOS (Python.framework/Versions/3.12/lib/libpython3.12.dylib) library names move behind obs_python_host_lib_name() in obs-scripting-python-import-host-{windows,macos}.c.h, each in its own unity group and PCH. import_python() asks the host for each version from 3.12 down to 3.6. Same order and same result as the old VERSION_PATTERN/FILE_PATTERN/dstr_replace loop.
  • access(path, F_OK) becomes os_file_exists(), so <windows.h>, <io.h>, F_OK, access and PATH_MAX leave the PCH. On Windows this also accepts non-ASCII install paths (UTF-8 to wide), which _access (ANSI) didn't.
  • RUNTIME_LINK and Py_NO_ENABLE_SHARED come from cmake/python.cmake. Python.h comes through each host's hosts/<os>/obs-scripting-python-include.h, selected by CMake include path the way coreaudio-encoder does it. The Windows one keeps the _DEBUG hiding.
  • MSVC pragmas C4152 and C4115 become /wd options on the Python groups.
  • Baseline: obs-scripting-python-import.pch.h (4) and obs-scripting-python-import.h (4) go to 0. cmake/cross compiles the Windows and macOS host groups.

RED (first commit): test_obs_scripting_python_import_host_{windows,macos} (Tier 2; plain C, so they run on Linux) fail against stub hosts.
GREEN: the hosts implement the names. ./lint passes (ifdef ratchet included). Local Tier 2: both new tests pass; 398/399 overall. The one failure, test_deinterlace_2x_field_order (83 s), is a timing-sensitive libobs test this PR does not touch (its last fix allows a late hold); it was a load flake on the shared machine. cmake/cross/docker.sh win-x64 mac-arm64 exits 0.

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

@zackees
zackees marked this pull request as ready for review October 23, 2026 22:55
@zackees
zackees added this pull request to the merge queue Oct 23, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 23, 2026
@zackees

zackees commented Oct 23, 2026

Copy link
Copy Markdown
Member Author

Coordinator: this conflicts with master in ci/platform-ifdef-baseline.json and cmake/cross/CMakeLists.txt, probably from #1987 (Lua host code) landing. cmake/cross is build code, so I'm leaving the rebase to you. Turn on auto-merge after rebasing and it will queue once green.

obs-scripting-python-import-host.h with stub Windows/macOS hosts in per-OS
unity groups; test_obs_scripting_python_import_host_{windows,macos} fail
against the stubs.
…port-host.h (#882)

The Windows/macOS library names move into
obs-scripting-python-import-host-{windows,macos}; access(F_OK) becomes
os_file_exists, so <windows.h>, <io.h> and PATH_MAX go. RUNTIME_LINK and
Py_NO_ENABLE_SHARED come from CMake, Python.h from each host's
hosts/<os>/obs-scripting-python-include.h (Windows hides _DEBUG there), and
the MSVC pragmas become /wd options. Baseline: two obs-scripting entries (8)
to 0.
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