Skip to content

build: preserve effective Cargo profiles in bundled native builds - #1856

Merged
zackees merged 4 commits into
masterfrom
infra/1332-cargo-native-profiles
Oct 23, 2026
Merged

zackees merged 4 commits into
masterfrom
infra/1332-cargo-native-profiles

Conversation

@zackees

@zackees zackees commented Oct 23, 2026

Copy link
Copy Markdown
Member

Scope

Refs #1332. Bundled obs-sys no longer hardcodes RelWithDebInfo. This is one configuration milestone; CMake remains authoritative and the full application/platform/packaging acceptance remains outstanding.

  • Shared NativeProfile model supports all effective Cargo optimization levels (0/1/2/3/s/z), debug symbols, and independent native assertions.
  • Use effective OPT_LEVEL/DEBUG instead of Cargo PROFILE names. Named OBS_SYS_NATIVE_PROFILE overrides retain the four standalone policies.
  • Native assertion default is on at opt-level 0, off otherwise; OBS_SYS_NATIVE_ASSERTIONS=0|1 overrides it independently of symbols and named profiles. This does not discover arbitrary Rust assertion settings: Cargo does not expose a reliable target setting to build scripts.
  • Build script tracks all four inputs and rejects invalid values before compilation.
  • Swift receives matching optimization and explicit assertion configuration. Existing standalone profile behavior is preserved.

Evidence

  • RED f3ada61: configuration selector stub failed the focused contract (/tmp/obs-1332-cargo-native-profiles-red.log). GREEN 97d1847 selects effective settings.
  • Two focused tests passed: selection/invalid inputs/all optimization levels plus real same-output library rebuilds and fresh-process assertion checks (/tmp/obs-1332-cargo-native-profile-compiler-green.log). Covers optimized/assertions-on and unoptimized/assertions-off combinations.
  • Actual bundled obs-sys build and all four existing contracts passed under Xvfb in the bounded Linux Docker harness: parsing/mode checks, C API version, startup and shutdown (/tmp/obs-1332-bundled-profile-green.log). The first attempt lacked DISPLAY and failed hotkey initialization; rerunning with the existing Xvfb harness fixed the environment, without weakening the test.
  • Review found Swift assertion defaults still coupled to optimization. Test commit d2827be extends the real native macOS fixture; e2c42d4 sets -assert-config explicitly. This fixture cannot run on the Linux host: native Swift RED/GREEN execution is unproven locally and required in macOS CI.
  • Same sole primary review is clean after the Swift fix, including docs.

No existing C/C++ test sources or public headers changed. No new test binary, workflow, worktree or admin merge. Unrelated browser submodule mismatch excluded.

@zackees

zackees commented Oct 23, 2026

Copy link
Copy Markdown
Member Author

Native macOS Rust validation passed on e2c42d4: all 57 obs-tests-app cases passed, including effective Cargo profile selection, same-output native assertion-policy rebuilds, and swift_bridge_preserves_native_linkage_header_flags_and_source_rebuilds. The extended Swift fixture executes both optimized/assertions-enabled and unoptimized/assertions-disabled configurations through fresh-process library loads.

Completed native job: https://github.com/obs-rust/obs-studio/actions/runs/39888189228/job/120202202245
Log: /tmp/obs-1332-profile-macos-rust-success.log.

This resolves the native Swift execution gap stated in the PR body; it does not claim native RED execution was observed before the fix. Remaining platform compatibility checks are still running. Holding the branch unchanged for CI.

@zackees
zackees marked this pull request as ready for review October 23, 2026 02:29
@zackees
zackees added this pull request to the merge queue Oct 23, 2026
Merged via the queue into master with commit a72aa4a Oct 23, 2026
31 checks passed
@zackees
zackees deleted the infra/1332-cargo-native-profiles branch October 26, 2026 15:45
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