z-shell/fzf

Fails on all but `pack'binary'` and `pack'bgn-binary'` due to `cannot determine $FZF_VERSION`

Closed this issue · 12 comments

I get the following error:

Package: fzf. Selected profile: bgn+keys. Available profiles: default, default+keys, bgn, bgn+keys, binary, binary+keys, bgn-binary, bgn-binary+keys.

Downloading (pack'') junegunn/fzf… (at label: fzf…)
▀ ███████████ OBJ: 100, PACK: 0/109, COMPR: 100%
'man/man1/fzf.1' -> '/home/kalle/.zi/polaris/man/man1/fzf.1'
'man/man1/fzf-tmux.1' -> '/home/kalle/.zi/polaris/man/man1/fzf-tmux.1'
make: Entering directory '/home/kalle/.zi/plugins/fzf'
Makefile:15: *** Not on git repository; cannot determine $FZF_VERSION.  Stop.
make: Leaving directory '/home/kalle/.zi/plugins/fzf'
Warning: ∞zi-make-hook hook returned with 2
bin-gem-node annex: Created the fzf-tmux shim and set +x on the fzf-tmux binary

The error from the Makefile there is from here: https://github.com/junegunn/fzf/blob/0.29.0/Makefile#L9-L13 where it's trying to get FZF's version from the Git tag.

My full .zshrc file:

# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=3000
SAVEHIST=5000
setopt autocd extendedglob nomatch notify
unsetopt beep
bindkey -e
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/kalle/.zshrc'

autoload -Uz compinit
compinit
# End of lines added by compinstall

if [[ ! -f $HOME/.zi/bin/zi.zsh ]]; then
  print -P "%F{33}▓▒░ %F{160}Installing (%F{33}z-shell/zi%F{160})…%f"
  command mkdir -p "$HOME/.zi" && command chmod g-rwX "$HOME/.zi"
  command git clone -q --depth=1 --branch "main" https://github.com/z-shell/zi "$HOME/.zi/bin" && \
    print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b" || \
    print -P "%F{160}▓▒░ The clone has failed.%f%b"
fi

source "$HOME/.zi/bin/zi.zsh"
autoload -Uz _zi
(( ${+_comps} )) && _comps[zi]=_zi
zicompinit

zi light-mode for \
  z-shell/z-a-meta-plugins \
  @annexes \
  @zsh-users+fast

zi pack"bgn+keys" git for fzf


zicompinit

It seems to be cloning the Git repo's latest version without the Git history. This repo's package.json suggest that it should be locked to 0.29.0, and not the latest:

fzf/package.json

Lines 45 to 52 in bd98c2a

},
"version": "0.29.0",
"zsh-data": {
"plugin-info": {
"user": "junegunn",
"plugin": "fzf",
"version": "0.29.0"
},

Workaround

Use the "pre-compiled binary" profiles instead, such as:

zi pack"binary+keys" for fzf

Or:

zi pack"bgn-binary+keys" for fzf
ss-o commented

Hey 👋

Thanks for taking the time to participate. In the details, you provided it's pretty clear that the installation method expects to be run in a git repository. :octocat:

I will review the possible ways to fix this. ☑️

Thanks, 🤝

ss-o commented

Could you verify that it works as expected? If yes I'll provide all details on changes :octocat:

@ss-o unsure what you mean, but I can verify that the workaround works, while all non-"binary" profiles does not work

ss-o commented

Stange as I tested multiple times on multiple devices with your given zshrc and all profiles.
I'll provide some visuals in 5min.

ss-o commented

asciicast

ss-o commented

With latest ZI version also no errors:

asciicast

ss-o commented

Are you having the same issue with no visible changes?

Super strange! I just posted this issue after a clean install of Fedora and latest version of Zi. I'll do some more testing later to try get a better repro

Yep, confirmed, it was that git ice that was hiding in there. I removed the git ice and it successfully built FZF from source. I didn't realize I had it there, sorry for the dead end, and big thank you for superb response!

Closing as resolved.

ss-o commented

Thanks for your participation as this is what makes communities great 🥇

ss-o commented

@jilleJr, I forgot to mention that you can use: https://github.com/z-shell/z-a-test to run the make and zunit tests automatically if it exists in the repository, and are re-tested when updating.

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.