Repository navigation
ci: Check the host boundary by existing paths, without moving files (#1051) - #1062
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1051 (phases 1–3 of the rewritten issue: no files move).
RED
3b2c50777: ratchet andci_scopetests. 9 failures and 18 errors intest_platform_ifdef_ratchet(nofindings(), no comment stripping, no OS-header or other-OS rules, no--exceptions), and 1 failure intest_ci_scope(libobs/cmake/os-windows.cmakestarted every OS).d4190e1f0: everyPLATFORMSrow inplugins/CMakeLists.txtmust matchci/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):ci/platform_paths.platforms(), the classifierci_scope.pyalready uses, instead of its own drifted token list._WIN32in a.mfile), and so does a conditional that names two OSes.<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).ci/platform-ifdef-exceptions.tomllists 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 vendoreddecklink-sdk/is excluded.ci/platform_paths.pyadds a table of modules whose name doesn't say their OS, matched to CMakePLATFORMS, plus the Windows-only updater, AMF/QSV test tools and inject/shared-memory helpers.ci/ci_scope.py:libobs/cmake/os-<os>.cmakestarts 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.mdgets the repository layout policy and a table mapping each C component to its crate.AGENTS.mdgets two quick rules.ci-tooling.mdandrust/README.mdare updated.Local
test_ci_scope,test_platform_ifdef_ratchetandtest_platform_facadepass, and the ratchet passes on the rebased tree../lintis green excepttest_app_config_identity. That test fails only because this session'sBASH_ENVturns onnounset(VERSION_LINE: unbound variable), and it passes withenv -u BASH_ENV. It is unrelated to this PR.No C/C++ source, public header or C test is changed.