[UBT][Apple] Shipping executables are never stripped of symbols by default — strip action is silently dropped unless bCreateStripFlagFile is enabled

Summary

On iOS and Mac, a default BuildCookRun Shipping build produces an executable that still contains its symbol table, even with -nodebuginfo. Two UBT settings control this: bStripSymbols (-stripsymbols) and bCreateStripFlagFile (-createstripflagfile). Their current behavior:

bCreateStripFlagFile = false (default) bCreateStripFlagFile = true
bStripSymbols = false (Development default) Not stripped Not stripped
bStripSymbols = true (forced in Shipping) Not stripped (strip action is created but dropped by the action graph) Stripped, plus <Exe>.stripped in Intermediate

Only the bottom-right cell actually strips, so a Shipping build is not stripped unless -createstripflagfile is also passed. Expected: Shipping, or any build with bStripSymbols = true, should strip by default, without needing bCreateStripFlagFile.

Expected behavior:

bCreateStripFlagFile = false (default) bCreateStripFlagFile = true
bStripSymbols = false (Development default) Not stripped Not stripped
bStripSymbols = true (forced in Shipping) Stripped in place, no extra file; up-to-date tracking based on the executable itself Stripped, plus <Exe>.stripped in Intermediate

Notes from investigating the cause:

  • In AppleToolChain.PostBuild, when bCreateStripFlagFile is false, the strip action has no produced items. ActionGraph.GatherPrerequisiteActions only schedules actions that produce a requested output, so the strip action is silently skipped. It cannot simply declare the executable as its output either, because the link action already produces it (ActionGraph.CheckForConflicts).

  • This appears to be a regression from CL 43273415 (“Update Mac Toolchain to strip symbols & consolidate shared Apple platform logic”, 2025-06-05). Before that change, the iOS strip action always produced a .stripped file and ran correctly.

  • Ordering with dSYM generation: strip removes the debug map that dsymutil relies on, and the strip action currently has no dependency on the dSYM / debug-info action. Once stripping actually runs, it can run before dsymutil when dSYMs are enabled, which produces an empty dSYM. This also applies to the bCreateStripFlagFile = true case today.

What Type of Bug are you experiencing?

Other

Steps to Reproduce

  1. On a Mac, take any C++ project, or a Blueprint project with a code target.
  2. Build the game target for Mac (or iOS) in Shipping, with no extra arguments:
    Build.sh Mac Shipping -Project=.uproject
  3. Check the build log. There is no Stripping symbols from … action.
  4. Inspect the executable:
    nm -a Binaries/Mac/-Mac-Shipping | wc -l
    (or check Binaries/IOS/-IOS-Shipping for iOS)
    Note the symbol count and the file size.
  5. Package with BuildCookRun -clientconfig=Shipping -nodebuginfo, and inspect the executable inside the .app / .ipa. The symbols are still present.
  6. Rebuild the same target with -createstripflagfile added, and repeat steps 3 and 4.

Expected Result

A Shipping (or -stripsymbols) Apple executable is stripped by default, the same as on Linux and Android, where the packaged binary never carries the full symbol table. bCreateStripFlagFile should only control whether a tracking file is written. It should not decide whether stripping happens at all.

Observed Result

Step 3: no strip action runs.
Step 4: the executable keeps its full local symbol table and debug map (high nm count, larger binary).
Step 5: the packaged app ships these symbols even though debug files were excluded.
Step 6: with -createstripflagfile, Stripping symbols from … appears, the nm count drops sharply, the binary shrinks, and .stripped is created.

Affects Versions

5.8

Platform(s)

iOS
Mac
visionOS