Symbol leakage after incremental build with unchanged Mergeable setting
0 reputation · 24 Jul 2022, 05:45 UTC
Goal: Ensure that only the intended public symbols are present in the dSYM and archive when an Xcode target links Swift packages and relies on incremental builds.
Uncertainty: The Mergeable build setting controls whether symbols from prior builds are retained; its behavior may differ across Xcode major versions, and changing the setting after a clean does not automatically regenerate existing dSYM files. Additionally, setting a target's public header visibility to Project can increase the risk of exposing types when the Mergeable setting retains old symbols.
Questions: Does toggling Mergeable to NO guarantee that previously exported symbols are stripped in the next incremental build on Xcode 15? How does the combination of Mergeable setting and Target Membership affect symbol visibility in the final archive? What verification steps can confirm that the dSYM contents reflect the intended public API after a change to Mergeable?