Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow --matching to match on all releases if none is found for architecture #54

Closed
oalders opened this issue May 8, 2024 · 7 comments
Closed

Comments

@oalders
Copy link
Contributor

oalders commented May 8, 2024

It would be nice if this worked:

$ ubi --project yt-dlp/yt-dlp --matching yt-dlp_macos --in /tmp/
[ubi][ERROR] could not find a release for this OS and architecture (x86_64-apple-darwin) from SHA2-256SUMS, SHA2-256SUMS.sig, SHA2-512SUMS, SHA2-512SUMS.sig, yt-dlp, yt-dlp.exe, yt-dlp.tar.gz, yt-dlp_linux, yt-dlp_linux.zip, yt-dlp_linux_aarch64, yt-dlp_linux_armv7l, yt-dlp_macos, yt-dlp_macos.zip, yt-dlp_macos_legacy, yt-dlp_min.exe, yt-dlp_win.zip, yt-dlp_x86.exe, _update_spec

Or even

ubi --project yt-dlp/yt-dlp --matching yt-dlp_macos.zip --in /tmp/

Maybe if a regex were allowed? --matching '^yt-dlp_macos.zip$'. I don't know. I'm not sure if I have great suggestions, but I had kind of expected the above incantation to work. The error output is quite clear on what the issue is, so that's helpful.

@autarch
Copy link
Member

autarch commented May 11, 2024

Could you run it with the --debug flag and paste the output here?

@oalders
Copy link
Contributor Author

oalders commented May 11, 2024

ubi --debug --project yt-dlp/yt-dlp --matching yt-dlp_macos --in /tmp/
[ubi::ubi][DEBUG] Parsed --project yt-dlp/yt-dlp = yt-dlp / yt-dlp
[ubi::ubi][DEBUG] exe name = yt-dlp
[ubi::ubi][DEBUG] matching = yt-dlp_macos
[ubi::ubi][DEBUG] install path = /tmp/yt-dlp
[reqwest::connect][DEBUG] starting new connection: https://api.github.com/
[ubi::ubi][DEBUG] current OS = macos
[ubi::ubi][DEBUG] matching assets against OS using (?i:(?:\b|_)(?:darwin|macos|osx)(?:\b|_))
[ubi::ubi][DEBUG] matching against asset name = SHA2-256SUMS
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = SHA2-256SUMS.sig
[ubi::ubi][DEBUG] it appears to have an invalid extension
[ubi::ubi][DEBUG] matching against asset name = SHA2-512SUMS
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = SHA2-512SUMS.sig
[ubi::ubi][DEBUG] it appears to have an invalid extension
[ubi::ubi][DEBUG] matching against asset name = yt-dlp
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = yt-dlp.exe
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = yt-dlp.tar.gz
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = yt-dlp_linux
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = yt-dlp_linux.zip
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = yt-dlp_linux_aarch64
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = yt-dlp_linux_armv7l
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = yt-dlp_macos
[ubi::ubi][DEBUG] matches our OS
[ubi::ubi][DEBUG] matching against asset name = yt-dlp_macos.zip
[ubi::ubi][DEBUG] matches our OS
[ubi::ubi][DEBUG] matching against asset name = yt-dlp_macos_legacy
[ubi::ubi][DEBUG] matches our OS
[ubi::ubi][DEBUG] matching against asset name = yt-dlp_min.exe
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = yt-dlp_win.zip
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = yt-dlp_x86.exe
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = _update_spec
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] current CPU architecture = x86_64
[ubi::ubi][DEBUG] matching assets against CPU architecture using (?ix)
        (?:
            \b
            |
            _
        )
        (?:
            386 | i586 | i686
            |
            x86[_-]32
            |
            x86[_-]64
            |
            x64
            |
            amd64
            |
            linux64
            |
            # This is gross but the OS matcher will reject this on non-Windows
            # platforms.
            win64
        )
        (?:
            \b
            |
            _
        )

[ubi::ubi][DEBUG] does not match our CPU architecture
[ubi::ubi][DEBUG] does not match our CPU architecture
[ubi::ubi][DEBUG] does not match our CPU architecture
[ubi][ERROR] could not find a release for this OS and architecture (x86_64-apple-darwin) from SHA2-256SUMS, SHA2-256SUMS.sig, SHA2-512SUMS, SHA2-512SUMS.sig, yt-dlp, yt-dlp.exe, yt-dlp.tar.gz, yt-dlp_linux, yt-dlp_linux.zip, yt-dlp_linux_aarch64, yt-dlp_linux_armv7l, yt-dlp_macos, yt-dlp_macos.zip, yt-dlp_macos_legacy, yt-dlp_min.exe, yt-dlp_win.zip, yt-dlp_x86.exe, _update_spec

@autarch
Copy link
Member

autarch commented May 11, 2024

Ugh, this one is tricky. The file names for this project's releases are a real jumble, with some having the arch name and others not, plus multiple releases for the same OS/arch combo.

@oalders
Copy link
Contributor Author

oalders commented May 11, 2024

Right, but for this case what would work for me is to be able to say "I know what I'm doing -- just match on the string even if you can't find an OS match".

@oalders
Copy link
Contributor Author

oalders commented May 11, 2024

It could be called --footgun

@autarch
Copy link
Member

autarch commented May 11, 2024

I think I have a different fix for this that doesn't require the --matching flag. You can see it in the more-arch-matching branch. In this case, there are multiple filenames that match the OS and some contain a CPU arch and some don't. Now it will match one of the arch-less options when none of the names with an arch match your architecture.

@autarch
Copy link
Member

autarch commented May 11, 2024

This should be fixed in v0.0.30.

@autarch autarch closed this as completed May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants