zdharma-continuum / zinit

🌻 Flexible and fast ZSH plugin manager
MIT License
2.74k stars 122 forks source link

[bug]: bad cpu type for executables exa and jq #574

Closed rrpolanco closed 6 months ago

rrpolanco commented 10 months ago

What happened?

zinit is downloading the wrong binary for exa and jq.

Downloading jqlang/jq… (at label: jq…)

(Requesting `jq-osx-amd64'…)
############################################################################################################################################################################# 100.0%
[ziextract] Successfully extracted and assigned +x chmod to the file: jq-osx-amd64.
jq-osx-amd64 -> jq

Downloading ogham/exa… (at label: exa…)

(Requesting `exa-macos-x86_64-v0.10.1.zip'…)
############################################################################################################################################################################# 100.0%
[ziextract] Unpacking the files from: `exa-macos-x86_64-v0.10.1.zip'…
Archive:  exa-macos-x86_64-v0.10.1.zip
  inflating: completions/exa.bash    
  inflating: completions/exa.zsh     
  inflating: completions/exa.fish    
  inflating: man/exa.1               
  inflating: man/exa_colors.5        
  inflating: bin/exa                 
[ziextract] Successfully extracted and assigned +x chmod to the file: bin/exa.
/Users/rafael/.local/share/zinit/polaris/man/man1/exa.1 -> /Users/rafael/.local/share/zinit/plugins/exa/man/exa.1
/Users/rafael/.local/share/zinit/polaris/man/man5/exa_colors.5 -> /Users/rafael/.local/share/zinit/plugins/exa/man/exa_colors.5
/Users/rafael/.local/share/zinit/completions/_exa -> /Users/rafael/.local/share/zinit/plugins/exa/completions/exa.zsh
.zinit-json-get-value:4: bad CPU type in executable: jq

Steps to reproduce

zinit wait lucid light-mode for \
  from'gh-r' \
  as'program' \
  pick'bin/exa' \
  atclone'ln -nsvf "$PWD/man/"*.1 "${ZINIT[MAN_DIR]}/man1"' \
  atclone'ln -nsvf "$PWD/man/"*.5 "${ZINIT[MAN_DIR]}/man5"' \
  atclone'ln -nsvf "$PWD/completions/exa.zsh" "${ZINIT[COMPLETIONS_DIR]}/_exa"' \
  atload'alias ls="exa --icons --time-style=iso --git --classify --color-scale --color=auto"' \
  atload'alias ll="exa --icons --time-style=iso --git --classify --color-scale --color=auto --long -i --extended"' \
  atload'alias tree="exa --icons --time-style=iso --git --classify --color-scale --color=auto --tree"' \
  id-as'auto' \
  @ogham/exa

zinit wait lucid light-mode for \
  from'gh-r' \
  as'program' \
  mv'jq-* -> jq' \
  id-as'auto' \
  @jqlang/jq

Relevant output

No response

Screenshots and recordings

No response

Operating System & Version

OS: darwin22.1.0 | Vendor: apple | Machine: arm | CPU: arm64 | Processor: arm | Hardware: arm64

Zsh version

zsh 5.9 (arm-apple-darwin22.1.0)

Terminal emulator

Terminal | xterm-256color

If using WSL on Windows, which version of WSL

None

Additional context

No response

Code of Conduct

rrpolanco commented 10 months ago

Upon close inspection, it turns out that for jq there is no arm64 binary for jq-1.6 (latest stable release):

Downloading jqlang/jq… (at label: jq…)
[gh-r] Error: bpick ice found no release assets. To fix, modify the bpick glob pattern *macos-arm*
[gh-r] Error: No GitHub release assets found for jq-1.6

Fixed it by bpicking the pre-release version of jq where macos-arm64 binary is published.

For exa I had to resort to using zinit-annex-rust to fix my issue since exa does not publish macos-arm64 binaries to github releases:

zinit ice rustup cargo'exa' as"command" pick"bin/exa"
zinit load zdharma-continuum/null
vladdoster commented 9 months ago

@rrpolanco,

Exa is unmaintained and the maintained fork is exa-community/eza. Unfortunately, it does not yet have macOS binaries (I'm working on a PR to add it as a build target).

You shouldn't have any issue using the x86_64 exa binary.

I use the follwing recipe (GitHub link):

zi aliases from'gh-r' lbin'!' light-mode nocompile for \
    atload"!(){setopt no_aliases;alias l='eza -blF';alias la='eza -abghilmu';alias ll='eza -al';alias ls='eza --git --group-directo
ries-first';}" \
    if'[[ $VENDOR != apple ]]' \
  @eza-community/eza \
    atload"!(){setopt no_aliases;alias l='exa -blF';alias la='exa -abghilmu';alias ll='exa -al';alias ls='exa --git --group-directo
ries-first';}" \
    if'[[ $VENDOR = apple ]]' \
  @ogham/exa

You can simplify your jq recipe by using the binary-symlink annex.

zi load @zdharma-continuum/zinit-annex-binary-symlink
zi from'gh-r' lbin'!' for @jqlang/jq

[!NOTE]
Ignore the debug logging (set via export ZINIT[DEBUG]='1')

Screenshot 2023-10-01 at 7 39 07 PM



Screenshot 2023-10-01 at 7 54 50 PM
vladdoster commented 6 months ago

@rrpolanco,

Issue closed and locked due to lack of activity. If you encounter this same issue, please open a new issue and refer to this closed one.