Skip to content

ci: Scope #else of Linux conditionals to macOS and Windows - #902

Closed
zackees wants to merge 4 commits into
masterfrom
infra/896-nix-else
Closed

zackees wants to merge 4 commits into
masterfrom
infra/896-nix-else

Conversation

@zackees

@zackees zackees commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Refs #897. Fixes #896 together with #898 (merged).

Bug

#898 scopes an edit in a branch that excludes Linux to nothing, but that is the code macOS and Windows compile:

  • #else of #ifdef __linux__ (e.g. frontend/components/ColorSourceToolbar.cpp:63);
  • #ifndef __linux__ / #if !defined(__linux__);
  • CMake else() after if(OS_LINUX).

There are 90 Linux/BSD-keyed conditionals in libobs/frontend/shared/plugins.

RED / GREEN

Proof

Probes and measurements are in the comments below.

@zackees

zackees commented Oct 15, 2026

Copy link
Copy Markdown
Member Author

Proof in real PR CI (probe PRs #904–#908, closed after reading)

Each probe was a one-line change on this branch. The control branched from master. I read which native jobs the run started, then cancelled the run.

probe change macOS jobs Windows jobs
#904 line inside #ifdef __APPLE__, frontend/OBSApp.cpp:270 ran skipped
#905 line inside #ifdef _WIN32, libobs/obs.c:375 skipped ran
#906 new #ifdef __linux__ … #else … #endif in libobs/obs.c ran ran
#907 comment in test/cmocka/tests.d/test_obs_data.cmake (plain C test) skipped skipped
#908 (control, master) same edit as #907 ran ran

So a macOS change starts the macOS runners, a Windows change starts the Windows runners, and the code macOS/Windows compile in a Linux #else starts both. A plain C test registration now skips native, where master starts both (#907 vs #908).

Speed

Replaying #898's scope over the last 120 PR runs: native macOS+Windows runs drop from 92 to 58, saving about 25 native runner-minutes per affected PR (865 in total). This branch's fixes add native runs only for Linux-#else hunks, and none of those 120 PRs had one. Since #837, Linux Tier 2 (~13 min) bounds PR wall time, so the gain shows up as runner-minutes and macOS queue time rather than as one PR's wall time.

Linux cross-compiling with soldr

Evaluated on #897 (#897 (comment)):

@zackees
zackees marked this pull request as ready for review October 15, 2026 22:12
@zackees
zackees force-pushed the infra/896-nix-else branch from b309619 to f3b1876 Compare October 15, 2026 22:12
@zackees zackees changed the title ci: Scope #else of Linux conditionals to macOS and Windows (stacked on #898) ci: Scope #else of Linux conditionals to macOS and Windows Oct 15, 2026
@zackees
zackees enabled auto-merge October 15, 2026 22:12
@zackees
zackees disabled auto-merge October 15, 2026 22:15
@zackees

zackees commented Oct 15, 2026

Copy link
Copy Markdown
Member Author

Closing per maintainer direction: no #ifdef scanning. Scoping becomes path-only, and core files must have no platform defines at all (the lint in #900). A follow-up PR removes the content scanning from #898.

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.

ci: Start native jobs for edits inside platform #if blocks in shared files

1 participant