[RUM-18034] fix: tvOS build issue - #1367
Merged
marco-saia-datadog merged 2 commits intoAug 13, 2026
Merged
Conversation
3 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the tvOS build by ensuring iOS-only WebView tracking symbols and the consumeWebviewEvent React Native bridge entrypoint are not compiled on tvOS, and adds a unit test to prevent future unguarded references in iOS native sources.
Changes:
- Remove an unguarded
DatadogWebViewTrackingimport fromDdSdkImplementation.swift(keep iOS-only usage behind#if os(iOS)). - Guard the
consumeWebviewEventReact Native bridge method inDdSdk.mmwith#if TARGET_OS_IOS. - Add
TvOSCompatibilityTeststo statically scanios/Sourcesfor unguarded references to iOS-only symbols.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/core/ios/Tests/TvOSCompatibilityTests.swift | Adds a static source-scan test to detect unguarded iOS-only symbol usage that would break tvOS builds. |
| packages/core/ios/Sources/DdSdkImplementation.swift | Removes an unguarded iOS-only framework import to avoid tvOS compilation failures. |
| packages/core/ios/Sources/DdSdk.mm | Wraps the WebView event bridge export in an iOS-only compile-time guard. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (2)
packages/core/ios/Tests/TvOSCompatibilityTests.swift:82
XCTFailis being reported withfile: #filePath(this test file) butline: UInt(lineNumber)from the scanned source file. This mismatch can make the failure location misleading (or point to a non-existent line in the test file). The message already includes the scanned file/line, so let XCTest report the failure at the call site.
XCTFail(
"\(url.lastPathComponent):\(lineNumber) references iOS-only symbol " +
"'\(symbol)' without a '\(guardPattern)' guard. This will break the tvOS " +
"build: wrap this reference in the appropriate platform guard.",
file: #filePath,
line: UInt(lineNumber)
)
packages/core/ios/Tests/TvOSCompatibilityTests.swift:62
- The
#elsehandling in this guard scanner flipsmatches(matches: !top.matches). This makes any#elsebranch under an unrelated#if/#ifdef(e.g.#ifdef RCT_NEW_ARCH_ENABLEDinSources/DdSdk.mm) look "guarded" and therefore skip symbol checks, which can hide unguarded iOS-only references.
if line.hasPrefix("#else") {
if let top = stack.last {
stack[stack.count - 1] = (matches: !top.matches, parentGuarded: top.parentGuarded)
}
continue
sbarrio
approved these changes
Aug 13, 2026
marco-saia-datadog
deleted the
marcosaia/rum-18034/ios-tv-os-build-issue
branch
August 13, 2026 15:04
4 tasks
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.
What does this PR do?
Fixes the tvOS build (ref #1361) by guarding the remaining iOS-only
DatadogWebViewTrackingreferences: an import inDdSdkImplementation.swiftand an unguardedconsumeWebviewEventbridge method inDdSdk.mm. Also adds a unit test that scans the native iOS sources for unguarded references to these symbols, to catch this kind of regression before it ships.Additional Notes
Original PR by @MaeIg, thank you for your contribution!
Review checklist (to be filled by reviewers)