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

--self-upgrade is funky on Intel Macs #45

Closed
oalders opened this issue Sep 4, 2023 · 8 comments
Closed

--self-upgrade is funky on Intel Macs #45

oalders opened this issue Sep 4, 2023 · 8 comments

Comments

@oalders
Copy link
Contributor

oalders commented Sep 4, 2023

I've run into this before but it took me a while to realize that it only happens on my older Macs and not on the new one and I don't believe I've seen it on Linux.

~/local/bin/ubi --self-upgrade --debug
[ubi][DEBUG] munged args for self-upgrade = [["/Users/olaf/local/bin/ubi", "--project", "houseabsolute/ubi", "--in", "/Users/olaf/local/bin"]]
[ubi::ubi][DEBUG] Parsed --project houseabsolute/ubi = houseabsolute / ubi
[ubi::ubi][DEBUG] exe name = ubi
[ubi::ubi][DEBUG] matching =
[ubi::ubi][DEBUG] install path = /Users/olaf/local/bin/ubi
[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] 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] matching against asset name = ubi-Darwin-aarch64.tar.gz
[ubi::ubi][DEBUG] matches our OS
[ubi::ubi][DEBUG] does not match our CPU architecture
[ubi::ubi][DEBUG] matching against asset name = ubi-Darwin-x86_64.tar.gz
[ubi::ubi][DEBUG] matches our OS
[ubi::ubi][DEBUG] matches our CPU architecture
[ubi::ubi][DEBUG] matching against asset name = ubi-FreeBSD-x86_64.tar.gz
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = ubi-Linux-aarch64-musl.tar.gz
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = ubi-Linux-arm-musl.tar.gz
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = ubi-Linux-i686-musl.tar.gz
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = ubi-Linux-mips.tar.gz
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = ubi-Linux-mips64.tar.gz
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = ubi-Linux-mips64el.tar.gz
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = ubi-Linux-mipsel.tar.gz
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = ubi-Linux-powerpc-gnu.tar.gz
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = ubi-Linux-powerpc64-gnu.tar.gz
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = ubi-Linux-powerpc64le.tar.gz
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = ubi-Linux-riscv64gc-gnu.tar.gz
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = ubi-Linux-s390x-gnu.tar.gz
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = ubi-Linux-x86_64-musl.tar.gz
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = ubi-NetBSD-x86_64.tar.gz
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = ubi-Windows-aarch64.zip
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = ubi-Windows-i686.zip
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] matching against asset name = ubi-Windows-x86_64.zip
[ubi::ubi][DEBUG] does not match our OS
[ubi::ubi][DEBUG] only found one candidate asset
[ubi::ubi][DEBUG] picked asset from matches named ubi-Darwin-x86_64.tar.gz
[ubi::ubi][DEBUG] picked asset named ubi-Darwin-x86_64.tar.gz
[ubi::ubi][DEBUG] downloading asset from https://api.github.com/repos/houseabsolute/ubi/releases/assets/122258412
[reqwest::connect][DEBUG] starting new connection: https://api.github.com/
[reqwest::async_impl::client][DEBUG] redirecting 'https://api.github.com/repos/houseabsolute/ubi/releases/assets/122258412' to 'https://objects.githubusercontent.com/github-production-release-asset-2e65be/327105217/5cb33681-cc6d-4952-a317-12aa72b88bfd?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230904%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230904T163304Z&X-Amz-Expires=300&X-Amz-Signature=755ee9a45830252bd20afbf5d49752fe1bc8996bfb2d3878f8a781dcdddcd6a1&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=327105217&response-content-disposition=attachment%3B%20filename%3Dubi-Darwin-x86_64.tar.gz&response-content-type=application%2Foctet-stream'
[reqwest::connect][DEBUG] starting new connection: https://objects.githubusercontent.com/
[ubi::ubi][DEBUG] archive path is /var/folders/fx/nhlkqy9s1gj0x98s1k3gxcgr0000gn/T/.tmpmEipfp/ubi-Darwin-x86_64.tar.gz
[ubi::ubi][DEBUG] extracting binary from tarball at /var/folders/fx/nhlkqy9s1gj0x98s1k3gxcgr0000gn/T/.tmpmEipfp/ubi-Darwin-x86_64.tar.gz
[ubi::ubi][DEBUG] found tarball entry with path GNUSparseFile.0/ubi
[ubi::ubi][DEBUG] extracting tarball entry to /Users/olaf/local/bin/ubi
[ubi::ubi][INFO] Installed binary into /Users/olaf/local/bin/ubi
ubi --version
/Users/olaf/local/bin/ubi: line 1: 2: command not found
/Users/olaf/local/bin/ubi: line 2: 0: command not found
/Users/olaf/local/bin/ubi: line 3: 5484544: command not found
/Users/olaf/local/bin/ubi: line 4: 5488640: command not found
/Users/olaf/local/bin/ubi: line 5: 2090208: command not found
/Users/olaf/local/bin/ubi: line 6: syntax error near unexpected token `('
/Users/olaf/local/bin/ubi: line 6: `��h
H__PAGEZERO�__TEXT@N@__text__TEXT�__⎽├┤␉⎽__TEXT__⎽├┤␉_␤␊┌⎻␊⎼__TEXT���__±␌␌_␊│␌␊⎻├_├▒␉__TEXT���__␌⎺┼⎽├__TEXT@�@^@�__␌⎽├⎼␋┼±__TEXT6M┘6M__┤┼┬␋┼␍_␋┼°⎺__TEXT�M,�M__␊␤_°⎼▒└␊__TEXT?N?N�_DATA_CONST@N@N__±⎺├__DATA_CONST@N@@N__␌⎺┼⎽├__DATA_CONST@@N(␤@@N│__DATASS@__┌▒_⎽≤└␉⎺┌_⎻├⎼__DATAS│S__␍▒├▒__DATA�84�__├␤⎼␊▒␍_┴▒⎼⎽__DATAS�S__├␤⎼␊▒␍_␍▒├▒__DATASH__LINKEDIT@TT�"0TP)P)T�TH89TX$Wk�]�
                                                                       P``�jjH�f
                                                                                 /┤⎽⎼/┌␋␉/␍≤┌␍4▒␊Z3#┴┐Hѥ2
4*(�
    @'
@autarch
Copy link
Member

autarch commented Sep 4, 2023

Any idea what that file is? Can you run file on it to find out?

@autarch
Copy link
Member

autarch commented Sep 4, 2023

Also, can you manually download the release ubi downloaded and see if it works? Maybe the release itself is just broken for some reason.

@oalders
Copy link
Contributor Author

oalders commented Sep 4, 2023

file ~/local/bin/ubi
/Users/olaf/local/bin/ubi: data

If I just download the release, I get:

file ~/local/bin/ubi
/Users/olaf/local/bin/ubi: Mach-O 64-bit executable x86_64
in="$HOME/local/bin"
mkdir -p "$in"

if [ ! "$(command -v "$in/ubi")" ]; then
    curl --silent --location \
        https://raw.githubusercontent.com/houseabsolute/ubi/master/bootstrap/bootstrap-ubi.sh |
        TARGET=$in sh

fi

@oalders
Copy link
Contributor Author

oalders commented Sep 4, 2023

$ ls -al ~/local/bin/ubi
-rwxr-xr-x@ 1 olaf  staff  7578848 Aug 19 20:30 /Users/olaf/local/bin/ubi
$ ~/local/bin/ubi --self-upgrade
-rwxr-xr-x@ 1 olaf  staff  7575264 Aug 19 20:30 /Users/olaf/local/bin/ubi

@oalders
Copy link
Contributor Author

oalders commented Sep 4, 2023

No clue if this helps, but more ~/local/bin/ubi provides different results with working vs not.

Broken install:
Screenshot 2023-09-04 at 4 39 11 PM

Working install:

Screenshot 2023-09-04 at 4 39 17 PM

@autarch
Copy link
Member

autarch commented Sep 9, 2023

Ok, this looks like a known bug in the tar crate - alexcrichton/tar-rs#295 and alexcrichton/tar-rs#322

There's a fork of the tar crate I could use, but I'd really like to see this fixed in the original.

@autarch
Copy link
Member

autarch commented Sep 10, 2023

This should be fixed in v0.0.28.

@oalders
Copy link
Contributor Author

oalders commented Sep 10, 2023

Looks great. Thanks!

@oalders oalders closed this as completed Sep 10, 2023
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