From df0f144ced9b4587d651ee114ac9e39a33086b5c Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Fri, 8 May 2026 07:40:32 +0200 Subject: [PATCH] Make Strip Sparkle build phase resilient to rm -rf races The post-embed strip script was intermittently failing with "Directory not empty" when rm -rf raced against codesign/Spotlight/Xcode touching the freshly-embedded framework. Atomically rename the framework out of the embed path first, then rm -rf with a short retry loop, so a clean build is no longer needed to recover. --- Yattee.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Yattee.xcodeproj/project.pbxproj b/Yattee.xcodeproj/project.pbxproj index 6fe9c2fe..35b138f6 100644 --- a/Yattee.xcodeproj/project.pbxproj +++ b/Yattee.xcodeproj/project.pbxproj @@ -384,7 +384,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "if [ \"${CONFIGURATION}\" != \"Release-DeveloperID\" ]; then\n FW=\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Sparkle.framework\"\n if [ -d \"$FW\" ]; then\n echo \"Stripping Sparkle.framework (config=${CONFIGURATION})\"\n rm -rf \"$FW\"\n fi\nfi\n"; + shellScript = "if [ \"${CONFIGURATION}\" != \"Release-DeveloperID\" ]; then\n FW=\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Sparkle.framework\"\n if [ -d \"$FW\" ]; then\n echo \"Stripping Sparkle.framework (config=${CONFIGURATION})\"\n chflags -R nouchg \"$FW\" 2>/dev/null || true\n chmod -R u+w \"$FW\" 2>/dev/null || true\n TMP=\"${FW}.stripping.$$\"\n if mv \"$FW\" \"$TMP\" 2>/dev/null; then\n TARGET=\"$TMP\"\n else\n TARGET=\"$FW\"\n fi\n for i in 1 2 3 4 5; do\n rm -rf \"$TARGET\" && break\n sleep 0.2\n done\n if [ -e \"$TARGET\" ]; then\n echo \"warning: failed to fully remove $TARGET\" >&2\n exit 1\n fi\n fi\nfi\n"; }; /* End PBXShellScriptBuildPhase section */