devops-works / binenv

One binary to rule them all. Manage all those pesky binaries (kubectl, helm, terraform, ...) easily.
MIT License
375 stars 44 forks source link

rg in latest version broken (installs completion script) #239

Closed axgkl closed 1 year ago

axgkl commented 1 year ago

Hi, ty for binenv!

Issue:

rg (ripgrep) used to work always but with 13.0.0 something is broken in the unpacking - it puts the shell completion script into the place where the binary should be:

~ ❯ binenv install -v rg
2023-09-25T10:01:35+02:00 DBG setting configuration bindir=/home/gk/.binenv/
2023-09-25T10:01:35+02:00 DBG setting configuration linkdir=/home/gk/.binenv/
2023-09-25T10:01:35+02:00 DBG setting configuration configdir=/home/gk/.config/binenv
2023-09-25T10:01:35+02:00 DBG setting configuration cachedir=/home/gk/.cache/binenv
2023-09-25T10:01:35+02:00 DBG final configuration bindir=/home/gk/.binenv/ cachedir=/home/gk/.cache/binenv configdir=/home/gk/.config/binenv linkdir=/home/gk/.binenv/
2023-09-25T10:01:36+02:00 DBG finding binaries for rg in /home/gk/.binenv/binaries/rg
2023-09-25T10:01:36+02:00 WRN version for "rg" not specified; using "13.0.0"
2023-09-25T10:01:36+02:00 DBG fetching version "13.0.0" for arch "amd64" and OS "linux" at https://github.com/BurntSushi/ripgrep/releases/download/13.0.0/ripgrep-13.0.0-x86_64-unknown-linux-musl.tar.gz func=GithubRelease.Get
fetching rg version 13.0.0 100% |███████████████████████████████| (2.0/2.0 MB, 2.636 MB/s)
2023-09-25T10:01:37+02:00 DBG finding binaries for rg in /home/gk/.binenv/binaries/rg
2023-09-25T10:01:37+02:00 DBG finding binaries for rg in /home/gk/.binenv/binaries/rg
2023-09-25T10:01:37+02:00 DBG finding binaries for rg in /home/gk/.binenv/binaries/rg
2023-09-25T10:01:37+02:00 INF "rg" (13.0.0) installed
~ ❯ rg -v
2023-09-25T10:01:49+02:00 FTL unable to execute rg error="exec format error"
~ ❯ head .binenv/binaries/rg/13.0.0
#compdef rg

##
# zsh completion function for ripgrep
#
# Run ci/test-complete after building to ensure that the options supported by
# this function stay in synch with the `rg` binary.
#
# For convenience, a completion reference guide is included at the bottom of
axgkl commented 1 year ago

older version work as said, e.g.

~ ❯ rm -rf .binenv/binaries/rg
~ ❯ binenv install -v rg 12.0.0
2023-09-25T10:04:32+02:00 DBG setting configuration bindir=/home/gk/.binenv/
2023-09-25T10:04:32+02:00 DBG setting configuration linkdir=/home/gk/.binenv/
2023-09-25T10:04:32+02:00 DBG setting configuration configdir=/home/gk/.config/binenv
2023-09-25T10:04:32+02:00 DBG setting configuration cachedir=/home/gk/.cache/binenv
2023-09-25T10:04:32+02:00 DBG final configuration bindir=/home/gk/.binenv/ cachedir=/home/gk/.cache/binenv configdir=/home/gk/.config/binenv linkdir=/home/gk/.binenv/
2023-09-25T10:04:32+02:00 DBG finding binaries for rg in /home/gk/.binenv/binaries/rg
2023-09-25T10:04:32+02:00 DBG fetching version "12.0.0" for arch "amd64" and OS "linux" at https://github.com/BurntSushi/ripgrep/releases/download/12.0.0/ripgrep-12.0.0-x86_64-unknown-linux-musl.tar.gz func=GithubRelease.Get
fetching rg version 12.0.0 100% |███████████████████████████████| (2.1/2.1 MB, 2.261 MB/s)
2023-09-25T10:04:34+02:00 DBG finding binaries for rg in /home/gk/.binenv/binaries/rg
2023-09-25T10:04:34+02:00 DBG finding binaries for rg in /home/gk/.binenv/binaries/rg
2023-09-25T10:04:34+02:00 DBG finding binaries for rg in /home/gk/.binenv/binaries/rg
2023-09-25T10:04:34+02:00 INF "rg" (12.0.0) installed
~ ❯ rg -v
error: The following required arguments were not provided:
    <PATTERN>

USAGE:

    rg [OPTIONS] PATTERN [PATH ...]

and I can't see a fundamental difference in the contents of the downloaded .tgz - completion scripts had been in also before, at same location => extended headscratching on my side ;-)

leucos commented 1 year ago

Thanks a lot for the detailed bug report :pray: . I am looking into this.

leucos commented 1 year ago

@AXGKl it should be fixed in binenv v0.19.9

Could you try:

binenv uninstall rg 13.0.0
binenv update
binenv install binenv
binenv install rg
rg
axgkl commented 1 year ago

worx. Nice fix btw & cool to have regex possibility for the matcher.