Open MPV opened 1 year ago
Seems there's no tar.gz, only a zip nowadays for macOS? i.e. this one works: https://github.com/cli/cli/releases/download/v2.28.0/gh_2.28.0_macOS_amd64.zip
Not understanding yet why, but there's details here: https://github.com/cli/cli/issues/7470#issuecomment-1556986607
First of all, thank you for your work.
It seems there is an issue in the return of get_ext()
and get_arch()
functions when we use it via asdf, the extension is still set to tar.gz
, when I tried to debug it locally (running the install
file locally), I got a properly downloaded zip
extension file.
Tested with the 2.31.0 version (macOS Ventura 13.4.1 (22F82) on m2 proc), on my mac, running uname -m
return arm64
and:
version_as_number=$(echo "$version" | tr -d .)
return properly 2310
, if [ ${version_as_number} -ge 2280 ]; then local ext="zip" fi
seems to working properly, tar.gz
and the arch seems to be amd64
.download_url
is set to https://github.com/cli/cli/releases/download/v2.31.0/gh_2.31.0_macOS_amd64.tar.gz
.But, running locally the install file (manually adding ASDF_INSTALL_VERSION=2.31.0
& ASDF_INSTALL_PATH=./temp_install
just above the ASDF_INSTALL_TYPE=${ASDF_INSTALL_TYPE:-version }
line) is working fine, but running it via asdf fail.
When you tested it on a local script did you clone the repo or did you test it from ~/.asdf/plugins/github-cli/bin/install
?
I would try removing the plugin and re-adding and see if that still fails.
When you tested it on a local script did you clone the repo or did you test it from
~/.asdf/plugins/github-cli/bin/install
?I would try removing the plugin and re-adding and see if that still fails.
I cloned the repo.
OMG!!! Removing/Re-adding fix the issue! Thank you (asdf plugin remove github-cli && asdf plugin add github-cli
)
I have the same issue:
asdf install github-cli 2.34.0
Downloading github-cli from https://github.com/cli/cli/releases/download/v2.34.0/gh_2.34.0_macOS_arm64.zip
Extracting /var/folders/6x/n3txt2p104j975rykvmh5v3m0000gn/T//gh_2.34.0_macOS_arm64.zip
pigz: warning: <stdin>: entries after the first were ignored
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Child returned status 1
tar: Error is not recoverable: exiting now
Looking at the source code, it seems that the installer is always trying to use tar, regardless of the type of archive. Maybe that is the issue?
Tar version:
tar --version
tar (GNU tar) 1.34
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by John Gilmore and Jay Fenlason.
GitHub-Cli archive:
file gh_2.34.0_macOS_arm64.zip
gh_2.34.0_macOS_arm64.zip: Zip archive data, at least v2.0 to extract, compression method=deflate
It works with
~ ❯ tar --version
bsdtar 3.5.3 - libarchive 3.5.3 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8
The install script would need to be updated to use unzip
for .zip
if you're using GNU tar
A workaround for those on MacOS with gnu-tar
installed, is to add the following to ~/.asdfrc
:
pre_asdf_install_github-cli = export PATH=/usr/bin:${PATH}
Install should then use bsdtar
for extracting:
[~]λ asdf install github-cli latest
Downloading github-cli from https://github.com/cli/cli/releases/download/v2.44.0/gh_2.44.0_macOS_arm64.zip
Extracting /var/folders/0n/qs1x3zyn2kb9y_cqks96fr8r0000gn/T//gh_2.44.0_macOS_arm64.zip
Moving bin to /Users/frealmyr/.asdf/installs/github-cli/2.44.0/bin/gh
Cleaning tmps...
Run: asdf <global | local> github-cli 2.44.0
@frealmyr saved my day, works like a charm with bsdtar
.
Nevertheless it's just a workaround, proper fix is still needed.
We really need a fix for this as we cannot rely on workarounds like this for CI/CD.
FYI, I have an updated plugin:
Any ideas?
Have they moved?