zdharma-continuum / zinit

🌻 Flexible and fast ZSH plugin manager
MIT License
2.77k stars 123 forks source link

[bug]: gh-r linux wrong arch binary -- downloads aarch64 instead of x86_64 #539

Closed mojolo closed 10 months ago

mojolo commented 1 year ago

What happened?

On my x86_64 system running Kubuntu 23.04, znit gh-r downloads the wrong arch version for navi. It downloads navi-v2.22.1-aarch64-unknown-linux-gnu.tar.gz instead of navi-v2.22.1-x86_64-unknown-linux-musl.tar.gz.

Similar bug report: #374

Steps to reproduce

I'm using the binary-symlink annex to load navi. It downloads the correct arch for all the other bins I load. Here's the snippet from my .zshrc:

zi lucid from"gh-r" lbin'!' nocompile atpull'%atclone' for \
    pemistahl/grex \
    denisidoro/navi \
  atclone'mkdir -p $ZPFX/{bin,man/man1} ;
      cp -vf fd*/fd.1 $ZINIT[MAN_DIR]/man1/' \
    @sharkdp/fd \
  atclone'mkdir -p $ZPFX/{bin,man/man1} ;
      cp -vf lsd*/lsd.1 $ZINIT[MAN_DIR]/man1/' \
    lsd-rs/lsd \
  atclone'mkdir -p $ZPFX/{bin,man/man1,man/man5} ;
      cp -vf completions/exa.zsh completions/_exa ;
      cp -vf man/exa.1 $ZINIT[MAN_DIR]/man1/ ;
      cp -vf man/exa_colors.5 $ZINIT[MAN_DIR]/man5/' \
    ogham/exa \
  atclone'mkdir -p $ZPFX/{bin,man/man1}' \
  dl"$GH_RAW_URL/junegunn/fzf/master/shell/completion.zsh -> _fzf_completion ;
     $GH_RAW_URL/junegunn/fzf/master/man/man1/fzf.1 -> $ZINIT[MAN_DIR]/man1/fzf.1" \
    junegunn/fzf \
  atclone'mkdir -p $ZPFX/{bin,man/man1} ;
      cp -vf ripgrep*/doc/rg.1 $ZINIT[MAN_DIR]/man1/' \
  lbin'!ripgrep*/rg' \
    BurntSushi/ripgrep \
  atclone'mv cheat-linux-amd64 cheat' \
  dl"$GH_RAW_URL/cheat/cheat/master/scripts/cheat.zsh -> _cheat_completion" \
    cheat/cheat \
  atclone'mkdir -p $ZPFX/{bin,man/man1} ;
      cp -vf micro*/micro.1 $ZINIT[MAN_DIR]/man1/' \
    zyedidia/micro

Relevant output

Here's the zinit output when installing:

Downloading denisidoro/navi…
(Requesting `navi-v2.22.1-aarch64-unknown-linux-gnu.tar.gz'…)
######################################################################## 100.0%                                                               
[ziextract] Unpacking the files from: `navi-v2.22.1-aarch64-unknown-linux-gnu.tar.gz'…
[ziextract] Successfully extracted and assigned +x chmod to the file: navi.
==> linkbin annex: Created navi soft link & set +x on the navi binary

Here's the zsh output when trying to execute the aarch64 version of navi:

$ navi
zsh: exec format error: navi

Operating System & Version

OS: linux-gnu | Vendor: ubuntu | Machine: x86_64 | CPU: x86_64 | Processor: x86_64 | Hardware: x86_64

Zsh version

zsh 5.9 (x86_64-ubuntu-linux-gnu)

Terminal emulator

xterm-256color (tilix)

Code of Conduct

Xunop commented 11 months ago

I have the same problem on my x86_64 Arch Linux.

znit gh-r downloads the wrong arch version for mcfly. It downloads mcfly-v0.8.1-aarch64-unknown-linux-gnu.tar.gz.

Here's the install code (from mcfly doc):

zinit ice lucid wait"0a" from"gh-r" as"program" atload'eval "$(mcfly init zsh)"'
zinit light cantino/mcfly

zinit output:

Downloading cantino/mcfly…
(Requesting `mcfly-v0.8.1-aarch64-unknown-linux-gnu.tar.gz'…)
####################################################################################################################### 100.0%
[ziextract] Unpacking the files from: `mcfly-v0.8.1-aarch64-unknown-linux-gnu.tar.gz'…
[ziextract] Successfully extracted and assigned +x chmod to the file: mcfly.

When I run mcfly, zsh outputs the following:

❯ mcfly
zsh: exec format error: mcfly

mcfly_prompt_command:14: exec format error: /home/xun/.local/share/zinit/plugins/cantino---mcfly/mcfly

Some info

Operating System & Version:

OS: linux-gnu | Vendor: pc | Machine: x86_64 | CPU: x86_64 | Processor: unknown | Hardware: x86_64

Zsh version:

zsh 5.9 (x86_64-pc-linux-gnu)

Terminal emulator:

xterm-256color (alacritty)

vladdoster commented 10 months ago

@Xunop,

Thank you for reporting! I have added a mcfly test.

Screenshot 2023-08-29 at 20 31 31
vladdoster commented 10 months ago

@mojolo,

I have fixed this bug.

Screenshot 2023-08-29 at 20 34 29
github-actions[bot] commented 10 months ago

:tada: This issue has been resolved in version 3.12.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: