Closed oalders closed 1 year ago
I think it might need to do some special casing for macOS to fall back to downloading the x86 release if there's no arm release.
That sounds good.
There's a macos-arm
branch that implements this. Can you try this binary built from that branch and let me know if it works as expected for you? https://github.com/houseabsolute/ubi/suites/15266122330/artifacts/872071280
Looks great. Thanks!
$ ubi --debug --project sharkdp/bat --in ~/local/bin/ 2>&1 | pbcopy
[90m[ubi::ubi][[30mDEBUG[0m[90m] Parsed --project sharkdp/bat = sharkdp / bat[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] exe name = bat[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] matching = [0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] install path = /Users/olaf/local/bin/bat[0m
[90m[reqwest::connect][[30mDEBUG[0m[90m] starting new connection: https://api.github.com/[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] current OS = macos[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] matching assets against OS using (?i:(?:\b|_)(?:darwin|macos|osx)(?:\b|_))[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] current CPU architecture = aarch64[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] matching assets against CPU architecture using (?ix)
(?:
\b
|
_
)
(?:
aarch_?64
|
arm_?64
|
x86[_-]64
|
x64
|
amd64
)
(?:
\b
|
_
)
[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] matching against asset name = bat-musl_0.23.0_amd64.deb[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] it appears to have an invalid extension[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] matching against asset name = bat-musl_0.23.0_i686.deb[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] it appears to have an invalid extension[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] matching against asset name = bat-v0.23.0-aarch64-unknown-linux-gnu.tar.gz[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] does not match our OS[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] matching against asset name = bat-v0.23.0-arm-unknown-linux-gnueabihf.tar.gz[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] does not match our OS[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] matching against asset name = bat-v0.23.0-arm-unknown-linux-musleabihf.tar.gz[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] does not match our OS[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] matching against asset name = bat-v0.23.0-i686-pc-windows-msvc.zip[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] does not match our OS[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] matching against asset name = bat-v0.23.0-i686-unknown-linux-gnu.tar.gz[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] does not match our OS[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] matching against asset name = bat-v0.23.0-i686-unknown-linux-musl.tar.gz[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] does not match our OS[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] matching against asset name = bat-v0.23.0-x86_64-apple-darwin.tar.gz[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] matches our OS[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] matches our CPU architecture[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] matching against asset name = bat-v0.23.0-x86_64-pc-windows-gnu.zip[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] does not match our OS[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] matching against asset name = bat-v0.23.0-x86_64-pc-windows-msvc.zip[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] does not match our OS[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] matching against asset name = bat-v0.23.0-x86_64-unknown-linux-gnu.tar.gz[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] does not match our OS[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] matching against asset name = bat-v0.23.0-x86_64-unknown-linux-musl.tar.gz[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] does not match our OS[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] matching against asset name = bat_0.23.0_amd64.deb[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] it appears to have an invalid extension[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] matching against asset name = bat_0.23.0_arm64.deb[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] it appears to have an invalid extension[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] matching against asset name = bat_0.23.0_armhf.deb[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] it appears to have an invalid extension[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] matching against asset name = bat_0.23.0_i686.deb[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] it appears to have an invalid extension[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] only found one candidate asset[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] picked asset from matches named bat-v0.23.0-x86_64-apple-darwin.tar.gz[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] picked asset named bat-v0.23.0-x86_64-apple-darwin.tar.gz[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] downloading asset from https://api.github.com/repos/sharkdp/bat/releases/assets/100891186[0m
[90m[reqwest::connect][[30mDEBUG[0m[90m] starting new connection: https://api.github.com/[0m
[90m[reqwest::async_impl::client][[30mDEBUG[0m[90m] redirecting 'https://api.github.com/repos/sharkdp/bat/releases/assets/100891186' to 'https://objects.githubusercontent.com/github-production-release-asset-2e65be/130464961/52a50b71-fe88-4e31-880c-b6459d440071?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230819%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230819T230859Z&X-Amz-Expires=300&X-Amz-Signature=df7ba7134ae9ef890765e0e599ee556d10d676c73ad162ce9a29a6659b0e1195&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=130464961&response-content-disposition=attachment%3B%20filename%3Dbat-v0.23.0-x86_64-apple-darwin.tar.gz&response-content-type=application%2Foctet-stream'[0m
[90m[reqwest::connect][[30mDEBUG[0m[90m] starting new connection: https://objects.githubusercontent.com/[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] archive path is /var/folders/p6/h8_m7lg10fb8vz2rm_x_sgzm0000gn/T/.tmp3yRYXc/bat-v0.23.0-x86_64-apple-darwin.tar.gz[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] extracting binary from tarball at /var/folders/p6/h8_m7lg10fb8vz2rm_x_sgzm0000gn/T/.tmp3yRYXc/bat-v0.23.0-x86_64-apple-darwin.tar.gz[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] found tarball entry with path bat-v0.23.0-x86_64-apple-darwin/CHANGELOG.md[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] found tarball entry with path bat-v0.23.0-x86_64-apple-darwin/LICENSE-APACHE[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] found tarball entry with path bat-v0.23.0-x86_64-apple-darwin/LICENSE-MIT[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] found tarball entry with path bat-v0.23.0-x86_64-apple-darwin/README.md[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] found tarball entry with path bat-v0.23.0-x86_64-apple-darwin/autocomplete/bat.bash[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] found tarball entry with path bat-v0.23.0-x86_64-apple-darwin/autocomplete/bat.zsh[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] found tarball entry with path bat-v0.23.0-x86_64-apple-darwin/autocomplete/_bat.ps1[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] found tarball entry with path bat-v0.23.0-x86_64-apple-darwin/autocomplete/bat.fish[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] found tarball entry with path bat-v0.23.0-x86_64-apple-darwin/bat[0m
[90m[ubi::ubi][[30mDEBUG[0m[90m] extracting tarball entry to /Users/olaf/local/bin/bat[0m
[90m[ubi::ubi][[32mINFO[0m[90m] Installed binary into /Users/olaf/local/bin/bat[0m
Done in v0.0.27.
I was wondering if you had any thoughts on this one. For
sharkdp/bat
ubi
will DTRT on my Linux machines and on my older Mac. On my new Mac, it comes up empty. I guess this is becausebat
ships with only one Mac binary, which appears to run fine on both of my macs.My solution is to install via URL using https://github.com/sharkdp/bat/releases/download/v0.23.0/bat-v0.23.0-x86_64-apple-darwin.tar.gz
I was initially hoping that
--matching x86_64-apple-darwin
would have done the trick, but since there are 0 matches on the architecture, this doesn't work. Maybe a--matching-fallback
or something would help in this case?