olets / zsh-abbr

The zsh manager for auto-expanding abbreviations, inspired by fish. ~23,000 clones by ~15,000 unique cloners as of Nov '24, and averaging ~60 Homebrew installs monthly since June 2023
https://zsh-abbr.olets.dev
Other
575 stars 20 forks source link

[Bug report] "There was a problem finishing installing dependencies" #156

Open alexbarton opened 1 day ago

alexbarton commented 1 day ago

Is there an existing issue for this?

Update the issue title

Expected Behavior

source /opt/homebrew/share/zsh-abbr/zsh-abbr.zsh should return no errors and "just work" ;-)

Actual Behavior

❯ brew install olets/tap/zsh-abbr
[ … no errors … ]
❯ source /opt/homebrew/share/zsh-abbr/zsh-abbr.zsh
abbr: There was a problem finishing installing dependencies

Steps To Reproduce

  1. macOS 14.7.1
  2. Homebrew 4.4.5
  3. zsh-abbr installed via brew install olets/tap/zsh-abbr
  4. source /opt/homebrew/share/zsh-abbr/zsh-abbr.zsh

Environment

❯ abbr profile
abbr:905: no such file or directory: /opt/homebrew/Cellar/zsh-abbr/6.0.0/share/zsh-abbr/zsh-job-queue/zsh-job-queue.zsh
abbr:906: no such file or directory: /opt/homebrew/Cellar/zsh-abbr/6.0.0/share/zsh-abbr/zsh-job-queue/zsh-job-queue.zsh
abbr:925: no such file or directory: /opt/homebrew/Cellar/zsh-abbr/6.0.0/share/zsh-abbr/zsh-job-queue/zsh-job-queue.zsh
zsh-abbr version 6.0.0
zsh 5.9 (x86_64-apple-darwin23.0)
OSTYPE darwin23.0

Installation method

Homebrew

Installation method details

No response

Anything else?

Thanks for zsh-abbr, worked really great for me for the last years and makes working with ZSH so much more comfortable!

Please let me know if I can test so0mething or which additional info is needed – the error message itself is not very verbose …

Chekote commented 1 day ago

The same thing happened to me this morning after running my brew update script. Seems abbr broke when updating to the latest major release. I read the migration guide and the installation guide for v6 but nothing helped.

I tried reinstalling via brew reinstall olets/tap/zsh-abbr, but it did not help.

Environment

Mac OS 15.1 Brew 4.4.5-14-gb421c2f

$ abbr profile
abbr:905: no such file or directory: /opt/homebrew/Cellar/zsh-abbr/6.0.0/share/zsh-abbr/zsh-job-queue/zsh-job-queue.zsh
abbr:906: no such file or directory: /opt/homebrew/Cellar/zsh-abbr/6.0.0/share/zsh-abbr/zsh-job-queue/zsh-job-queue.zsh
abbr:925: no such file or directory: /opt/homebrew/Cellar/zsh-abbr/6.0.0/share/zsh-abbr/zsh-job-queue/zsh-job-queue.zsh
zsh-abbr version 6.0.0
zsh 5.9 (arm64-apple-darwin24.0)
OSTYPE darwin24.0
olets commented 23 hours ago

Thanks for reporting. Oversight in updating the formula to point to v6. Should be fixed.

This might work

brew update && brew reinstall zsh-abbr

This probably will

brew uninstall zsh-abbr && brew update && brew install zsh-abbr

This definitely should

brew uninstall --force zsh-abbr && brew update && brew install zsh-abbr

Lmk which if any of those work for you. Thanks!

LangLangBart commented 12 hours ago

Hi, I followed the manual[^1] instructions and encountered this issue.

Below is a Docker command to consistently reproduce the issue.

docker run --rm --tty --interactive alpine:latest sh -uec '
apk add zsh git
git clone https://github.com/olets/zsh-abbr --single-branch --branch main --depth 1 /olet-abbr
echo "source /olet-abbr/zsh-abbr.zsh" > ~/.zshrc
/bin/zsh'
fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/community/x86_64/APKINDEX.tar.gz
(1/18) Installing ca-certificates (20240705-r0)
(2/18) Installing brotli-libs (1.1.0-r2)
...
Resolving deltas: 100% (5/5), done.
abbr: Finishing installing dependencies
abbr: There was a problem finishing installing dependencies

8d860058da6f# abbr --version
abbr:905: no such file or directory: /olet-abbr/zsh-job-queue/zsh-job-queue.zsh
abbr:906: no such file or directory: /olet-abbr/zsh-job-queue/zsh-job-queue.zsh
abbr:925: no such file or directory: /olet-abbr/zsh-job-queue/zsh-job-queue.zsh
zsh-abbr version 6.0.0

[^1]: Installation :: zsh-abbr

LangLangBart commented 10 hours ago

Using the --recurse-submodules flag with git clone does the trick.

         --recurse-submodules[=<pathspec>]
             After the clone is created, initialize and clone submodules within
             based on the provided <pathspec>. If no =<pathspec> is provided,
             all submodules are initialized and cloned. This option can be given
             multiple times for pathspecs consisting of multiple entries. The
             resulting clone has submodule.active set to the provided pathspec,
             or "." (meaning all submodules) if no pathspec is provided.

             Submodules are initialized and cloned using their default settings.
             This is equivalent to running git submodule update --init
             --recursive <pathspec> immediately after the clone is finished.
             This option is ignored if the cloned repository does not have a
             worktree/checkout (i.e. if any of --no-checkout/-n, --bare, or
             --mirror is given)

The problem is that I use zsh4humans[^1] to install plugins, and there is no option I can pass to the installation process to update the submodules.

# auto-expanding abbreviations - https://github.com/olets/zsh-abbr
z4h install olets/zsh-abbr || return

[^1]: GitHub - romkatv/zsh4humans: A turnkey configuration for Zsh

olets commented 10 hours ago

Thanks for the report @LangLangBart.

Make this change:

- git clone https://github.com/olets/zsh-abbr --single-branch --branch main --depth 1 /olet-abbr
+ git clone https://github.com/olets/zsh-abbr --recurse-submodules --single-branch --branch main --depth 1 /olet-abbr

Can fix an existing v6 clone with

cd path/to/zsh-abbr
git submodule update --init

I've updated the docs.

olets commented 10 hours ago

Crossing comments!

Can you clone manually and then have z4h load that? If not, recommend opening a z4h issue to ask.

LangLangBart commented 10 hours ago

Thanks @olets

I switched to the brew install method, and it works well.

bartlibert commented 8 hours ago

The dependencies are also missing in the source distribution files, will you add them there?