zdharma-continuum / zinit

🌻 Flexible and fast ZSH plugin manager
MIT License
3.15k stars 129 forks source link

[bug]: failed to find the correct GitHub release asset to download, modify bpick-ICE #385

Closed amanjitsk closed 2 years ago

amanjitsk commented 2 years ago

What happened?

The bpick-ICE does not work for the neovim/neovim repo with the github releases. This used to work before, but it just stopped working recently. And the nvim.appimage asset is indeed present in the latest version on neovim here

Steps to reproduce

  1. Enable plugin neovim using
    zinit ice wait lucid from"gh-r" ver"latest" bpick"nvim.appimage" \
    as"null" mv"nvim* -> $PREFIX/bin/nvim"
    zinit light neovim/neovim

Relevant output

Downloading neovim/neovim…
gh-r: failed to find the correct GitHub release asset to download, modify bpick-ICE (current bpick: nvim.appimage).

Screenshots and recordings

No response

Operating System & Version

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

Zsh version

zsh 5.8.1 (x86_64-ubuntu-linux-gnu)

Terminal emulator

xterm-kitty

If using WSL on Windows, which version of WSL

No response

Additional context

No response

Code of Conduct

vladdoster commented 2 years ago

@amanjitsk did you see https://github.com/zdharma-continuum/zinit/issues/228?

chalkygames123 commented 2 years ago

Although I'm not sure if it's relevant to this issue, today I noticed that cli/cli has not been getting updates for a while even though I run zinit update regularly, so I deleted it with zinit delete cli/cli and tried to reinstall it. However, the download fails if the ver ice, needed to avoid pre-releases, is present.

Originally, my setup was:

zinit wait lucid as'program' for \
    from'gh-r' ver'latest' pick'gh/bin/gh' mv'gh* -> gh' atclone'./gh/bin/gh completion --shell zsh > _gh' atpull'%atclone' \
        cli/cli \

And the download failed:

Downloading cli/cli…
gh-r: failed to find the correct GitHub release asset to download.

I tried removing the ver ice:

zinit wait lucid as'program' for \
    from'gh-r' pick'gh/bin/gh' mv'gh* -> gh' atclone'./gh/bin/gh completion --shell zsh > _gh' atpull'%atclone' \
        cli/cli \

Then it succeeded:

Downloading cli/cli…
(Requesting `gh_2.16.1_macOS_amd64.tar.gz'…)
######################################################################################################################################################### 100.0%
ziextract: Unpacking the files from: `gh_2.16.1_macOS_amd64.tar.gz'…
ziextract: Successfully extracted and assigned +x chmod to the file: `gh_2.16.1_macOS_amd64/bin/gh'.
gh_2.16.1_macOS_amd64 -> gh
Installed 0 completions. They are stored in the $INSTALLED_COMPS array.
Skipped installing 1 completions. They are stored in the $SKIPPED_COMPS array.
amanjitsk commented 2 years ago

@amanjitsk did you see #228?

The sbin approach doesn't work for me as it does not download the right version (the latest stable version using ver'latest' does not work. Furthermore, I can't even find nvim on my path with this approach. On top of that, with this approach, I have some libraries missing with the following error (this actually happens even with the appimage): image

Here is what I used to do before:

zinit ice wait lucid from"gh-r" ver"latest" bpick"nvim.appimage" \
   as"null" mv"nvim* -> $PREFIX/bin/nvim"
zinit light neovim/neovim

Would it not be possible to have this AppImage approach anymore?

vladdoster commented 2 years ago

Although I'm not sure if it's relevant to this issue, today I noticed that cli/cli has not been getting updates for a while even though I run zinit update regularly, so I deleted it with zinit delete cli/cli and tried to reinstall it. However, the download fails if the ver ice, needed to avoid pre-releases, is present.

Originally, my setup was:

zinit wait lucid as'program' for \
  from'gh-r' ver'latest' pick'gh/bin/gh' mv'gh* -> gh' atclone'./gh/bin/gh completion --shell zsh > _gh' atpull'%atclone' \
      cli/cli \

And the download failed:

Downloading cli/cli…
gh-r: failed to find the correct GitHub release asset to download.

I tried removing the ver ice:

zinit wait lucid as'program' for \
  from'gh-r' pick'gh/bin/gh' mv'gh* -> gh' atclone'./gh/bin/gh completion --shell zsh > _gh' atpull'%atclone' \
      cli/cli \

Then it succeeded:

Downloading cli/cli…
(Requesting `gh_2.16.1_macOS_amd64.tar.gz'…)
######################################################################################################################################################### 100.0%
ziextract: Unpacking the files from: `gh_2.16.1_macOS_amd64.tar.gz'…
ziextract: Successfully extracted and assigned +x chmod to the file: `gh_2.16.1_macOS_amd64/bin/gh'.
gh_2.16.1_macOS_amd64 -> gh
Installed 0 completions. They are stored in the $INSTALLED_COMPS array.
Skipped installing 1 completions. They are stored in the $SKIPPED_COMPS array.

@chalkygames123, latest isn't a version so it doesn't find anything. Version 2.16.1 is the latest version (see cli releases).

For example, to get v2.15.0 I'd use the following recipe:

zi for \                                                                                             <<<
    as'program' \
    atclone'./gh/bin/gh completion --shell zsh > _gh' \
    atpull'%atclone' \
    from'gh-r' \
    mv'gh* -> gh' \
    pick'gh/bin/gh' \
    ver'v2.15.0' \
  cli/cli

Which results in:

/usr/local/Cellar
ᐳ zi delete cli/cli --yes

Done (action executed, exit code: 0)

/usr/local/Cellar
ᐳ zi for \
    as'program' \
    atclone'./gh/bin/gh completion --shell zsh > _gh' \
    atpull'%atclone' \
    from'gh-r' \
    mv'gh* -> gh' \
    pick'gh/bin/gh' \
    ver'v2.15.0' \
  cli/cli

Downloading cli/cli…
(Requesting `gh_2.15.0_macOS_amd64.tar.gz'…)
#################################################################################################### 100.0%
ziextract: Unpacking the files from: `gh_2.15.0_macOS_amd64.tar.gz'…
ziextract: Successfully extracted and assigned +x chmod to the file: `gh_2.15.0_macOS_amd64/bin/gh'.
renamed 'gh_2.15.0_macOS_amd64' -> 'gh'
Installed 0 completions. They are stored in the $INSTALLED_COMPS array.
Skipped installing 1 completions. They are stored in the $SKIPPED_COMPS array.

/usr/local/Cellar 16s
ᐳ
vladdoster commented 2 years ago

@amanjitsk did you see #228?

The sbin approach doesn't work for me as it does not download the right version (the latest stable version using ver'latest' does not work. Furthermore, I can't even find nvim on my path with this approach. ~On top of that, with this approach, I have some libraries missing with the following error~ (this actually happens even with the appimage): image

Here is what I used to do before:

zinit ice wait lucid from"gh-r" ver"latest" bpick"nvim.appimage" \
   as"null" mv"nvim* -> $PREFIX/bin/nvim"
zinit light neovim/neovim

Would it not be possible to have this AppImage approach anymore?

The GLIBC version error is a dependency error. I discuss the cons of AppImages in the issue I linked (comment link). AppImages aren't self contained. They depend on the glibc of the host at the very least. You'll be unable to run Neovim (appimage, binary, compiled, etc.) until you update glibc.

Zinit currently filters out AppImages and I have yet to come across a project that releases an AppImage but no binary. Do you have a specific reason for using the AppImage?

amanjitsk commented 2 years ago

Makes sense, thanks for that link (I went back and read it again). The only issue is that with the recipe described above as

zinit from'gh-r' sbin'**/nvim' ver'stable' for neovim/neovim

I can't even find nvim on my PATH after this, not sure if this was intended (apart from the dependency issue). How can I do the same with the sbin approach (I thought that is what the sbin ice does)

chalkygames123 commented 2 years ago

@vladdoster While the documentation says the following, do you mean it's out of date?

Used with from"gh-r" (i.e. downloading a binary release, e.g. for use with as"program") – selects which version to download. Default is latest, can also be explicitly ver"latest". Works also with regular plugins and packages (pack ice) checkouts e.g. ver"abranch", i.e. a specific version. Does not work with snippets.<

I'm also not sure why a pre-release is selected if explicit ver'latest' is not present. While I can't reproduce it as the latest version is stable right now, I haven't experienced the same problem with any other plugin.

vladdoster commented 2 years ago

Makes sense, thanks for that link (I went back and read it again). The only issue is that with the recipe described above as

zinit from'gh-r' sbin'**/nvim' ver'stable' for neovim/neovim

I can't even find nvim on my PATH after this, not sure if this was intended (apart from the dependency issue). How can I do the same with the sbin approach (I thought that is what the sbin ice does)


Correct, you will not see it in $PATH. The whole purpose of sbin is to enable running programs and scripts without adding anything to $PATH.

Please see bin-gem-node annex documentation.