pnpm-shell-completion icon indicating copy to clipboard operation
pnpm-shell-completion copied to clipboard

Add support for aarch64-unknown-linux-gnu

Open tsingksan opened this issue 11 months ago • 7 comments
trafficstars

Issue: Add support for aarch64-unknown-linux-gnu

Environment

  • Host System: macOS M3
  • VM System: NixOS
  • Loading Method: Using zinit to load pnpm-shell-completion

Configuration:

zinit wait'1b' lucid for \
        id-as"pnpm-shell-completion" \
        nocompile"#!/*" \
        atload"zpcdreplay" \
        atclone"./zplug.zsh" \
        atpull"%atclone" \
    g-plane/pnpm-shell-completion \

Issue Description

pnpm-shell-completion works fine on the macOS host system. However, when attempting to use it on the NixOS virtual machine, the following error occurs:

_pnpm:17: exec format error: /pnpm-shell-completion/pnpm-shell-completion

This might be caused by downloading the incorrect target file when running ./zplug.zsh. I have tried downloading different release targets, but the issue persists.

I attempted to build with cargo build targeting aarch64-unknown-linux-gnu locally, and the issue was resolved.

Suggested Solution

I would like to request adding support for aarch64-unknown-linux-gnu in pnpm-shell-completion. Here is my suggested modification:

# zplug.zsh
if [ $(uname) = "Darwin" ]; then
    if [ $(uname -m) = "arm64" ]; then
        target="aarch64-apple-darwin"
    else
        target="x86_64-apple-darwin"
    fi
else
    if [ $(uname -m) = "aarch64" ]; then
        target="aarch64-unknown-linux-gnu"
    else
        target="x86_64-unknown-linux-musl"
    fi
fi

tsingksan avatar Dec 20 '24 17:12 tsingksan

GitHub Actions doesn't provide ARM Linux at the moment.

g-plane avatar Dec 23 '24 02:12 g-plane

@g-plane why you need ARM Linux on CI? We can compile on another machine as I understand

ai avatar Nov 12 '25 21:11 ai

We need to build it on CI when publishing.

g-plane avatar Nov 13 '25 14:11 g-plane

We can’t we build ARM Linux binary on x86 environment? You should run argo build --target=aarch64-unknown-linux-gnu (you may need extra packages for compiler to do it)

ai avatar Nov 13 '25 14:11 ai

Here is how other project are building multi-arch builds on CI https://github.com/sharkdp/bat/blob/master/.github/workflows/CICD.yml#L156

ai avatar Nov 13 '25 14:11 ai

I'm not sure if I can simply add a Rust target without setting up QEMU.

g-plane avatar Nov 13 '25 14:11 g-plane

Other projects use these steps https://github.com/sharkdp/bat/blob/master/.github/workflows/CICD.yml#L196-L205

ai avatar Nov 13 '25 14:11 ai