Skip to content

ci: Check the host boundary by existing paths, without moving files (#1051) - #1062

Merged
zackees merged 4 commits into
masterfrom
infra/1051-host-boundary-ratchet
Oct 16, 2026
Merged

zackees merged 4 commits into
masterfrom
infra/1051-host-boundary-ratchet

Conversation

@zackees

@zackees zackees commented Oct 16, 2026

Copy link
Copy Markdown
Member

Fixes #1051 (phases 1–3 of the rewritten issue: no files move).

RED

  • 3b2c50777: ratchet and ci_scope tests. 9 failures and 18 errors in test_platform_ifdef_ratchet (no findings(), no comment stripping, no OS-header or other-OS rules, no --exceptions), and 1 failure in test_ci_scope (libobs/cmake/os-windows.cmake started every OS).
  • d4190e1f0: every PLATFORMS row in plugins/CMakeLists.txt must match ci/platform_paths.py. This failed for coreaudio-encoder, nv-filters, obs-nvenc, obs-text and oss-audio. For example, obs-text and nv-filters are Windows-only but classified as shared, so a change to them started Linux CI and no Windows lane.

GREEN

ci/platform_ifdef_ratchet.py (extended in place, no new lint):

  • It now uses ci/platform_paths.platforms(), the classifier ci_scope.py already uses, instead of its own drifted token list.
  • A platform file that names another OS fails (e.g. _WIN32 in a .m file), and so does a conditional that names two OSes.
  • OS headers count:
    • <windows.h>, <d3d*.h>, <AppKit/…>, <X11/…>, <unistd.h>, … count in shared files and in another OS's files.
    • <pthread.h> and <fcntl.h> stay portable (w32-pthreads and the MSVC CRT provide them).
  • Comments, raw strings and literals are stripped, and continued lines are joined, before matching.
  • ci/platform-ifdef-exceptions.toml lists public libobs headers whose conditionals are part of the API/ABI, each with a reason: c99defs.h, threading.h, platform.h, graphics.h, obs.h, sse-intrin.h, util_uint64.h. Entries must be headers with a reason, and an entry with nothing left to exempt fails. The vendored decklink-sdk/ is excluded.
  • The baseline is regenerated: 139 files, 478 findings.

ci/platform_paths.py adds a table of modules whose name doesn't say their OS, matched to CMake PLATFORMS, plus the Windows-only updater, AMF/QSV test tools and inject/shared-memory helpers.

ci/ci_scope.py: libobs/cmake/os-<os>.cmake starts only that OS. The token fallback is now permanent: its TODO said to delete it once paths were renamed, and upstream paths are never renamed.

Docs:

  • naming.md gets the repository layout policy and a table mapping each C component to its crate.
  • AGENTS.md gets two quick rules.
  • ci-tooling.md and rust/README.md are updated.

Local

  • test_ci_scope, test_platform_ifdef_ratchet and test_platform_facade pass, and the ratchet passes on the rebased tree.
  • ./lint is green except test_app_config_identity. That test fails only because this session's BASH_ENV turns on nounset (VERSION_LINE: unbound variable), and it passes with env -u BASH_ENV. It is unrelated to this PR.

No C/C++ source, public header or C test is changed.

…coping

platform_ifdef_ratchet gains: one classifier (ci/platform_paths.py),
other-OS and two-OS conditionals in platform files, OS headers, comment
and string stripping, and a public-header exceptions file. ci_scope maps
libobs/cmake/os-<os>.cmake to that OS only.

Refs #1051
obs-text and nv-filters (Windows only) classify as shared, so a change to
them starts Linux and no Windows lane; coreaudio-encoder (Windows and
macOS) classifies as macOS only; obs-nvenc and oss-audio likewise.

Refs #1051
…1051)

platform_ifdef_ratchet.py:
- classifies files with ci/platform_paths.py, the classifier ci_scope.py
  uses, instead of its own drifted token list (platform-number.c,
  platform-pipe.h and the other shared platform-* facades are now counted);
- fails a platform file that names another OS (_WIN32 in a .m file) or two
  OSes in one conditional;
- counts OS headers (<windows.h>, <AppKit/...>, <X11/...>, <unistd.h>, ...)
  in shared files and in the wrong platform file; <pthread.h> and <fcntl.h>
  stay portable (w32-pthreads, the MSVC CRT);
- strips comments, raw strings and literals and joins continued lines first;
- skips the public libobs headers listed with a reason in
  ci/platform-ifdef-exceptions.toml (c99defs.h, threading.h, platform.h,
  graphics.h, obs.h, sse-intrin.h, util_uint64.h), and the vendored
  decklink-sdk.

platform_paths.py lists the modules whose name doesn't say their OSes,
checked against plugins/CMakeLists.txt PLATFORMS: obs-text and nv-filters
(Windows) no longer start Linux-only CI, coreaudio-encoder starts Windows
too, plus the Windows-only updater, amf/qsv test tools and inject/shm
helpers. ci_scope.py maps libobs/cmake/os-<os>.cmake to that OS only, and
the token fallback is permanent: upstream paths are never renamed.

Baseline regenerated: 139 files, 478 findings.

Fixes the RED tests in f7d34bec9 and 22a8a1a26. Refs #1051
The upstream C/C++ tree stays where upstream has it while we merge
upstream; all Rust lives in the rust/ workspace, one crate per ported
component; a fully ported C component is deleted, not moved. naming.md
gets the C component -> crate table, AGENTS.md the two quick rules, and
ci-tooling.md the new ratchet and ci_scope behaviour.

Refs #1051
@zackees
zackees enabled auto-merge October 16, 2026 09:55
@zackees
zackees added this pull request to the merge queue Oct 16, 2026
Merged via the queue into master with commit 673f76f Oct 16, 2026
20 checks passed
@zackees
zackees deleted the infra/1051-host-boundary-ratchet branch October 26, 2026 15:44
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.

Host boundary without moving files: tighten the platform ifdef ratchet, keep CI path scoping, record the repo layout policy

1 participant