Empty dSYMs on macOS with Strip Local Symbols (8.0.13+)

Hi JUCE Team,

since version 8.0.13, macOS Release builds with Strip Local Symbols enabled are producing nearly empty dSYM files, around 200 KB.

I believe this may be caused by the PACE-related change that sets DEPLOYMENT_POSTPROCESSING=NO and moves stripping into a post-build strip -x script. Previously, Xcode appeared to run dsymutil before stripping; now it seems the strip step may be happening before the dSYM is generated.

As a workaround, I patched Projucer’s StripTarget function so that dsymutil runs before strip:

const auto stripTarget = [&]
        {
            ScriptBuilder script;

            for (ConstConfigIterator config (*this); config.next();)
            {
                auto& xcodeConfig = static_cast<const XcodeBuildConfiguration&> (*config);

                if (! xcodeConfig.isStripLocalSymbolsEnabled())
                    continue;

                script.ifEqual ("${CONFIGURATION}", doubleQuoted (config->getName()),
                                ScriptBuilder{}
                                    .run ("dsymutil",
                                          doubleQuoted ("${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}"),
                                          "-o",
                                          doubleQuoted ("${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"))
                                    .run ("strip", "-x",
                                          doubleQuoted ("${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}"))
                                    .toString());
            }

            if (! script.isEmpty())
                target.addShellScriptBuildPhase ("Strip Target", script.toStringWithDefaultShellOptions());
        };

I’m not sure whether this is the correct fix so I’d appreciate your guidance on the best approach.

If you need any additional tests or logs from my side, I’d be happy to provide them. If possible, please let me know whether a fix can be added soon.

Thanks,
Samuele

2 Likes

Hi there,
Just following up to see if you have any news by chance.

Best,
Samuele

Sorry for not posting back on here but I believe this issue was fixed here Projucer (Xcode): Fix an issue with debug symbol file generation · juce-framework/JUCE@f42363a · GitHub

If it’s not working for you please let me know.

In the end we made sure that the strip command only runs after the dwarf file is generated (if it is generated at all) this way Xcode ensures that the strip command always runs after dsymutil runs. That way we could still rely on Xcode to add the dsymutil command.