houseabsolute / ubi

The Universal Binary Installer
Apache License 2.0
190 stars 6 forks source link

Cannot install `direnv` with UBI #67

Closed jimeh closed 3 weeks ago

jimeh commented 1 month ago

It seems the release asset naming pattern used by direnv confuses UBI, making it think the only viable assets are the two .exe files for Windows.

Debug output:

$ ubi --debug -p direnv/direnv
[ubi][DEBUG] Parsed --project direnv/direnv = direnv / direnv
[ubi][DEBUG] exe name = direnv
[ubi][DEBUG] install path = /Users/jimeh/.dotfiles/bin/direnv
[reqwest::connect][DEBUG] starting new connection: https://api.github.com/
[ubi::picker][DEBUG] filtering out assets that do not have a valid extension
[ubi::picker][DEBUG] skipping asset with invalid extension: direnv.darwin-amd64
[ubi::picker][DEBUG] skipping asset with invalid extension: direnv.darwin-arm64
[ubi::picker][DEBUG] skipping asset with invalid extension: direnv.freebsd-386
[ubi::picker][DEBUG] skipping asset with invalid extension: direnv.freebsd-amd64
[ubi::picker][DEBUG] skipping asset with invalid extension: direnv.freebsd-arm
[ubi::picker][DEBUG] skipping asset with invalid extension: direnv.linux-386
[ubi::picker][DEBUG] skipping asset with invalid extension: direnv.linux-amd64
[ubi::picker][DEBUG] skipping asset with invalid extension: direnv.linux-arm
[ubi::picker][DEBUG] skipping asset with invalid extension: direnv.linux-arm64
[ubi::picker][DEBUG] skipping asset with invalid extension: direnv.linux-mips
[ubi::picker][DEBUG] skipping asset with invalid extension: direnv.linux-mips64
[ubi::picker][DEBUG] skipping asset with invalid extension: direnv.linux-mips64le
[ubi::picker][DEBUG] skipping asset with invalid extension: direnv.linux-mipsle
[ubi::picker][DEBUG] skipping asset with invalid extension: direnv.linux-ppc64
[ubi::picker][DEBUG] skipping asset with invalid extension: direnv.linux-ppc64le
[ubi::picker][DEBUG] skipping asset with invalid extension: direnv.linux-s390x
[ubi::picker][DEBUG] skipping asset with invalid extension: direnv.netbsd-386
[ubi::picker][DEBUG] skipping asset with invalid extension: direnv.netbsd-amd64
[ubi::picker][DEBUG] skipping asset with invalid extension: direnv.netbsd-arm
[ubi::picker][DEBUG] skipping asset with invalid extension: direnv.openbsd-386
[ubi::picker][DEBUG] skipping asset with invalid extension: direnv.openbsd-amd64
[ubi::picker][DEBUG] current OS = macos
[ubi::picker][DEBUG] matching assets against OS using (?i:(?:\b|_)(?:darwin|macos|osx)(?:\b|_))
[ubi::picker][DEBUG] matching OS against asset name = direnv.windows-386.exe
[ubi::picker][DEBUG] does not match our OS
[ubi::picker][DEBUG] matching OS against asset name = direnv.windows-amd64.exe
[ubi::picker][DEBUG] does not match our OS
[ubi][ERROR] could not find a release for this OS (aarch64-apple-darwin) from direnv.windows-386.exe, direnv.windows-amd64.exe
autarch commented 1 month ago

Ah, I see the problem. It's yet another case of developers releasing things with dots in the name, which makes software like ubi think it's an extension. I'll have to look into handling this case. I actually wrote a bit about this on my blog at https://blog.urth.org/2023/04/16/naming-your-binary-executable-releases/ in case you're curious.

jimeh commented 1 month ago

For what it's worth, I get the same error now for shfmt v3.10.0, while v3.9.0 using the same asset naming pattern worked fine.

autarch commented 3 weeks ago

Both of these issues (direnv & shfmt), should be fixed in v0.2.1, which I just released.