Skip to content

Commit 4e6c67b

Browse files
fix: detect Node.js arch for Tauri CLI native module
Use Node's process.arch instead of uname -m since npm may run under Rosetta 2 (x64 emulation on arm64 host). This ensures we install the correct platform-specific Tauri CLI binary. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 450cfcb commit 4e6c67b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/actions/setup-tauri-build/action.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,15 @@ runs:
4545
run: |
4646
# Deno doesn't install optional dependencies (platform-specific native modules)
4747
# Install the Tauri CLI native module explicitly for the current platform
48-
ARCH=$(uname -m)
49-
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
50-
if [[ "$ARCH" == "arm64" || "$ARCH" == "aarch64" ]]; then
51-
TAURI_NATIVE_PKG="@tauri-apps/cli-${OS}-arm64"
48+
# Use Node.js to detect arch since npm may run under Rosetta (x64 on arm64 host)
49+
NODE_ARCH=$(node -p "process.arch")
50+
NODE_OS=$(node -p "process.platform")
51+
if [[ "$NODE_ARCH" == "arm64" ]]; then
52+
TAURI_NATIVE_PKG="@tauri-apps/cli-${NODE_OS}-arm64"
5253
else
53-
TAURI_NATIVE_PKG="@tauri-apps/cli-${OS}-x64"
54+
TAURI_NATIVE_PKG="@tauri-apps/cli-${NODE_OS}-x64"
5455
fi
55-
echo "Installing $TAURI_NATIVE_PKG..."
56+
echo "Installing $TAURI_NATIVE_PKG (Node arch: $NODE_ARCH, OS: $NODE_OS)..."
5657
npm install "$TAURI_NATIVE_PKG" --no-save
5758
5859
- name: Setup Rust (iOS)

0 commit comments

Comments
 (0)