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

Issue running the trust install script with the latest version of cross #130

Open
cs97dah opened this issue Jun 22, 2020 · 5 comments
Open

Comments

@cs97dah
Copy link

cs97dah commented Jun 22, 2020

Hi there. I wonder if you might be able to help me?

I've noticed the following failure on Travis Linux builds when trying to install the binary release:

$  curl -LSfs https://japaric.github.io/trust/install.sh | \
>     sh -s -- --git japaric/cross

install.sh: GitHub repository: https://github.com/japaric/cross
install.sh: Crate: cross
install.sh: Tag: latest (latest)
install.sh: Target: x86_64-unknown-linux-gnu
install.sh: Installing to: /home/travis/.cargo/bin

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

It looks to me like the install.sh script might be incompatible with the latest tag of cross because specifying the previous tag works:

$ curl -LSfs https://japaric.github.io/trust/install.sh | \
>         sh -s -- \
>          --git japaric/cross \
>            --tag v0.1.16
install.sh: GitHub repository: https://github.com/japaric/cross
install.sh: Crate: cross
install.sh: Tag: v0.1.16
install.sh: Target: x86_64-unknown-linux-gnu
install.sh: Installing to: /home/travis/.cargo/bin

We also target mac OS and it looks like it has a similar issue:

$ curl -LSfs https://japaric.github.io/trust/install.sh | \
    sh -s -- --git japaric/cross

install.sh: GitHub repository: https://github.com/japaric/cross
install.sh: Crate: cross
install.sh: Tag: latest (latest)
install.sh: Target: x86_64-apple-darwin
install.sh: Installing to: /Users/dean/.cargo/bin

tar: Unrecognized archive format
tar: Error exit delayed from previous errors.

Do you have any ideas what the problem might be here? I'm afraid I'm a bit of a Rust newbie so I must admit I'm not sure what to look for here. Let me know if I can get anything else to help with this, or if I should actually report this on this Cross project?

Thanks very much,
Dean

@samtay
Copy link

samtay commented Jun 25, 2020

I can at least answer the first part:

install.sh: Target: x86_64-unknown-linux-gnu
install.sh: Installing to: /home/travis/.cargo/bin

gzip: stdin: not in gzip format
tar: Child returned status 1

happens because the latest cross release doesn't have that -gnu binary. Not sure about the apple problem.

@cantino
Copy link

cantino commented Jan 31, 2021

I'm running into this problem as well.

@rossmacarthur
Copy link

@cantino I wrote a near drop-in replacement install script that will check for -musl, -gnu suffixes and also even doesn't require rustc to be present on the system to detect the platform (uses platform detection code take from rustup). It should work with the latest cross. Contributions welcome 😄.

https://github.com/rossmacarthur/install

curl -LSfs https://rossmacarthur.github.io/install/crate.sh \
    | bash -s -- --repo "japaric/cross" --to ~/.cargo/bin

@cantino
Copy link

cantino commented Feb 27, 2021

@rossmacarthur Appreciated! But I think what I need is an updated version of trust & cross that compiles for M1 Macs.

Edit: unless I'm misunderstanding what you're saying. I'm using trust to build my binary in CI.

@tyranron
Copy link

It looks to me like the install.sh script might be incompatible with the latest tag of cross because specifying the previous tag works:

It seems that default detection of the latest tag just doesn't work:

if [ -z $tag ]; then
    tag=$(curl -s "$url/latest" | cut -d'"' -f2 | rev | cut -d'/' -f1 | rev)
    say_err "Tag: latest ($tag)"
else
    say_err "Tag: $tag"
fi

In your log it outputs:

install.sh: Tag: latest (latest)

When it should be:

install.sh: Tag: latest (v0.1.17)

The workaround here would be to detect latest version correctly, but manually:

curl -LSfs https://japaric.github.io/trust/install.sh | \
sh -s -- --git japaric/cross \
         --tag $(curl -s https://api.github.com/repos/japaric/cross/releases/latest \
                 | jq -r '.tag_name')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants