Skip to content

Commit 8e8fcc2

Browse files
committed
ci(portable): Skip execution checks for cross-arch artifacts
Make portable verification architecture-aware by checking the packaged\nnode-runtime architecture before running wrapper binaries. When host and\nartifact architectures do not match, keep structural validation and skip\nexecution checks to avoid cross-arch runner failures.\n\nCo-Authored-By: Claude <noreply@anthropic.com>
1 parent bf2ff4e commit 8e8fcc2

1 file changed

Lines changed: 35 additions & 3 deletions

File tree

scripts/verify-portable-install.sh

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,40 @@ if [[ ! -d "$PORTABLE_ROOT/libexec/bundled/Frameworks" ]]; then
8888
exit 1
8989
fi
9090

91-
"$PORTABLE_ROOT/bin/xcodebuildmcp" --help >/dev/null
92-
"$PORTABLE_ROOT/bin/xcodebuildmcp-doctor" --help >/dev/null
91+
HOST_ARCH="$(uname -m)"
92+
NODE_RUNTIME="$PORTABLE_ROOT/libexec/node-runtime"
93+
if [[ ! -x "$NODE_RUNTIME" ]]; then
94+
echo "Missing executable Node runtime under libexec"
95+
exit 1
96+
fi
9397

94-
echo "Portable install verification passed for: $PORTABLE_ROOT"
98+
RUNTIME_ARCHS="$(lipo -archs "$NODE_RUNTIME" 2>/dev/null || true)"
99+
if [[ -z "$RUNTIME_ARCHS" ]]; then
100+
if file "$NODE_RUNTIME" | grep -q "x86_64"; then
101+
RUNTIME_ARCHS="x86_64"
102+
elif file "$NODE_RUNTIME" | grep -q "arm64"; then
103+
RUNTIME_ARCHS="arm64"
104+
fi
105+
fi
106+
107+
NORMALIZED_HOST_ARCH="$HOST_ARCH"
108+
if [[ "$HOST_ARCH" == "x86_64" ]]; then
109+
NORMALIZED_HOST_ARCH="x86_64"
110+
fi
95111

112+
CAN_EXECUTE="false"
113+
for runtime_arch in $RUNTIME_ARCHS; do
114+
if [[ "$runtime_arch" == "$NORMALIZED_HOST_ARCH" ]]; then
115+
CAN_EXECUTE="true"
116+
break
117+
fi
118+
done
119+
120+
if [[ "$CAN_EXECUTE" == "true" ]]; then
121+
"$PORTABLE_ROOT/bin/xcodebuildmcp" --help >/dev/null
122+
"$PORTABLE_ROOT/bin/xcodebuildmcp-doctor" --help >/dev/null
123+
else
124+
echo "Skipping binary execution checks: host arch ($HOST_ARCH) not in runtime archs ($RUNTIME_ARCHS)"
125+
fi
126+
127+
echo "Portable install verification passed for: $PORTABLE_ROOT"

0 commit comments

Comments
 (0)