pnpm-shell-completion
pnpm-shell-completion copied to clipboard
Add support for aarch64-unknown-linux-gnu
Issue: Add support for aarch64-unknown-linux-gnu
Environment
- Host System: macOS M3
- VM System: NixOS
- Loading Method: Using
zinitto loadpnpm-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
GitHub Actions doesn't provide ARM Linux at the moment.
@g-plane why you need ARM Linux on CI? We can compile on another machine as I understand
We need to build it on CI when publishing.
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)
Here is how other project are building multi-arch builds on CI https://github.com/sharkdp/bat/blob/master/.github/workflows/CICD.yml#L156
I'm not sure if I can simply add a Rust target without setting up QEMU.
Other projects use these steps https://github.com/sharkdp/bat/blob/master/.github/workflows/CICD.yml#L196-L205