diff --git a/cmux.xcodeproj/project.pbxproj b/cmux.xcodeproj/project.pbxproj index 98844b5e0041..dd11ef68d7c2 100644 --- a/cmux.xcodeproj/project.pbxproj +++ b/cmux.xcodeproj/project.pbxproj @@ -12610,7 +12610,6 @@ }; D1FF50000000000000000001 /* Build Diff Sidecar */ = { isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -12635,11 +12634,11 @@ ); outputPaths = ( "$(TARGET_BUILD_DIR)/$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/bin/cmux-diff-sidecar", + "$(TARGET_TEMP_DIR)/cmux-diff-sidecar.arch-$(ARCHS).min-$(MACOSX_DEPLOYMENT_TARGET).stamp", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/scripts/build-diff-sidecar.sh\"\n"; - }; + shellScript = "rm -f \"${TARGET_TEMP_DIR}\"/cmux-diff-sidecar.arch-*.min-*.stamp\nCMUX_DIFF_SIDECAR_ARCHS=\"${ARCHS}\" CMUX_DIFF_SIDECAR_MIN_MACOS=\"${MACOSX_DEPLOYMENT_TARGET}\" CMUX_DIFF_SIDECAR_STAMP=\"${TARGET_TEMP_DIR}/cmux-diff-sidecar.arch-${ARCHS}.min-${MACOSX_DEPLOYMENT_TARGET}.stamp\" \"${SRCROOT}/scripts/build-diff-sidecar.sh\"\n"; }; A9E030000000000000000009 /* Reject Bundled Provider Binaries */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; diff --git a/scripts/build-diff-sidecar.sh b/scripts/build-diff-sidecar.sh index 13ec8d1689fd..3eb644445b21 100755 --- a/scripts/build-diff-sidecar.sh +++ b/scripts/build-diff-sidecar.sh @@ -96,3 +96,22 @@ chmod +x "$destination" if [[ "${CODE_SIGNING_ALLOWED:-YES}" != "NO" && -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" ]]; then codesign --force --sign "$EXPANDED_CODE_SIGN_IDENTITY" "$destination" >/dev/null fi + +# Xcode's dependency-analysis output is keyed by the normal architecture and +# deployment-target settings. The Xcode phase pins the script overrides to +# those same build settings before invoking this script. The stamp is +# intentionally optional so direct script callers retain override support. +if [[ -n "${CMUX_DIFF_SIDECAR_STAMP:-}" ]]; then + stamp_tmp="$(mktemp "${CMUX_DIFF_SIDECAR_STAMP}.tmp.XXXXXX")" + cleanup_stamp_tmp() { + [[ -e "$stamp_tmp" ]] && rm -f "$stamp_tmp" + } + trap cleanup_stamp_tmp EXIT + { + printf 'requested_archs=%s\n' "$requested_archs" + printf 'min_macos=%s\n' "${CMUX_DIFF_SIDECAR_MIN_MACOS:-14.0}" + shasum -a 256 "$destination" + } > "$stamp_tmp" + mv -f "$stamp_tmp" "$CMUX_DIFF_SIDECAR_STAMP" + trap - EXIT +fi