Repository navigation
Fix dev-build.sh clobbering Datadog's SPM_BUILD flag - #11
Merged
Merged
Conversation
scripts/dev-build.sh passed SWIFT_ACTIVE_COMPILATION_CONDITIONS=DEBUG on
the xcodebuild command line to strip UITEST_HOOKS from a local build. A
command-line build-setting override applies to EVERY target in the graph
— including SwiftPM dependencies — and replaces (not appends to) their
value. That silently dropped the SPM_BUILD flag dd-sdk-ios's package
targets set via .define("SPM_BUILD"), so DatadogCore/CrashReporting never
imported the DatadogPrivate ObjC module and failed with "cannot find type
'__dd_private_AppLaunchHandler'" (and UIApplicationNotificationCallback,
__dd_private_ObjcExceptionHandler).
CI never caught it: check.sh builds the app without that override, so the
dependency kept SPM_BUILD. dev-build.sh is local-only, and Datadog (#8)
was the first dependency to rely on a custom compilation condition, so a
pre-existing override in dev-build.sh only just started breaking builds.
Fix: add a Debug-Local build configuration (debug, UITEST_HOOKS off) and
have dev-build.sh select it with -configuration instead of overriding the
setting globally. A per-config setting only touches the app target, so
SwiftPM dependencies keep their own flags. The "Install to /Applications"
postBuildScript now installs for Debug-Local as well as Debug.
Verified: full app build with -configuration Debug-Local succeeds with
-DSPM_BUILD present on the DatadogCore compile; Debug-Local drops
UITEST_HOOKS while Debug keeps it; generated scheme unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
alexkroman
enabled auto-merge
July 1, 2026 19:24
alexkroman
added this pull request to the merge queue
Jul 1, 2026
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.
Problem
scripts/dev-build.shfailed to build locally with:…even though CI (
check.sh) was green on the same dd-sdk-ios revision, Xcode, and Swift toolchain.Root cause
dev-build.shpassedSWIFT_ACTIVE_COMPILATION_CONDITIONS=DEBUGon thexcodebuildcommand line to stripUITEST_HOOKSfrom a clean local build. A command-line build-setting override applies to every target in the graph — including SwiftPM dependencies — and replaces (not appends to) their value.dd-sdk-ios's
Package.swiftcompilesDatadogCore/DatadogCrashReportingwith.define("SPM_BUILD"). The global override wiped that out, so this guard went false:Why CI didn't catch it:
check.sh'sxcodebuildnever passes that override, so the dependency keptSPM_BUILD.dev-build.shis local-only, and Datadog (#8) was the first dependency to rely on a custom compilation condition — so a long-standing override indev-build.shonly just started breaking builds.Fix
Debug-Localbuild configuration (debug type,UITEST_HOOKSoff) inproject.yml.dev-build.shselects it with-configuration Debug-Localinstead of overriding the global setting — a per-config setting only touches the app target, so SwiftPM dependencies keep their own flags.Debug-Localas well asDebug.project.pbxprojviaxcodegen(keeps the drift gate green).Verification
-configuration Debug-Local→ BUILD SUCCEEDED, with-DSPM_BUILDpresent on theDatadogCorecompile.Debug-Local→SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG(noUITEST_HOOKS);Debug→DEBUG UITEST_HOOKS.Debug, archiveRelease).🤖 Generated with Claude Code