Skip to content

Use dwarf debug info for Debug builds, as Xcode's project template does - #265

Open
Dharin-shah wants to merge 1 commit into
react-native-community:mainfrom
Dharin-shah:debug-dwarf
Open

Dharin-shah wants to merge 1 commit into
react-native-community:mainfrom
Dharin-shah:debug-dwarf

Conversation

@Dharin-shah

Copy link
Copy Markdown

Summary:

The template's project doesn't set DEBUG_INFORMATION_FORMAT, so Debug picks up dwarf-with-dsym from the iOS and iOS Simulator platform defaults, and every Debug build that relinks the app runs dsymutil over HelloWorld.debug.dylib near the end, mostly on its own. Xcode's own new-project template sets dwarf for Debug and dwarf-with-dsym for Release, and this does the same at the project level. Both values give clang and swiftc the same -g, so the object files don't change and lldb still finds the debug info through them; a Debug build just stops writing a .dSYM. Release doesn't change.

I measured it on a React Native 0.87.1 app with 114 pods and the core built from source, Simulator Debug on an M5 Pro with Xcode 27.2, three interleaved pairs of a build into a fresh DerivedData and three of a clean build. In each default build GenerateDSYMFile took 6.7 to 8.6 s of task time, 4.0 to 6.2 s of it with nothing else running, and it ran in none of the dwarf ones. The whole builds are noisier: the fresh ones went from 55.6 to 44.5 s (medians) and the clean ones from 45.8 to 40.3 s, but one pair of three went the other way in each, so I'd go by the dSYM seconds. Hmm, one more thing: those builds had Xcode's compilation cache on with a warm store, so in the fresh-DerivedData builds all 3,521 cacheable tasks were cache hits, and the dSYM step is a much bigger share of them than of a normal build. I haven't timed an uncached build, or one with the prebuilt core, where dsymutil has less to read.

I saw #244 got moved into React Native's scripts instead. If you'd rather have this one there too, I think it's one set_build_setting(..., config_name: "Debug") line next to the SWIFT_ACTIVE_COMPILATION_CONDITIONS one in react_native_post_install, happy to move it 🙂

Changelog:

[IOS] [CHANGED] - Debug builds use DEBUG_INFORMATION_FORMAT = dwarf and no longer generate a dSYM

Test Plan:

xcodebuild -project template/ios/HelloWorld.xcodeproj -target HelloWorld -configuration Debug -sdk iphonesimulator -showBuildSettings | grep ' DEBUG_INFORMATION_FORMAT ' before and after this change:

Debug, before: DEBUG_INFORMATION_FORMAT = dwarf-with-dsym
Debug, after: DEBUG_INFORMATION_FORMAT = dwarf
Release, before and after: DEBUG_INFORMATION_FORMAT = dwarf-with-dsym

The same with -sdk iphoneos.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant