anza-xyz / platform-tools

Apache License 2.0
47 stars 32 forks source link

Connection timed out when downloading sbf-tools #51

Closed smacrineanu closed 1 year ago

smacrineanu commented 2 years ago

I am trying to build a Solana program using Anchor.

When I run anchor build, I get the following output:

Warning: cargo-build-bpf is deprecated. Please, use cargo-build-sbf
cargo-build-bpf child: /opt/solana-release/bin/cargo-build-sbf --arch bpf
[ERROR cargo_build_sbf] Failed to install sbf-tools: error sending request for url (https://github.com/solana-labs/bpf-tools/releases/download/v1.29/solana-bpf-tools-linux.tar.bz2): operation timed out

I tried installing rust & cargo by myself and building without anchor and I get the same error.

Is there any workaround around this, or a possible fix?

dmakarov commented 2 years ago

Can you use wget to download the tarball? The following command works for me

wget https://github.com/solana-labs/bpf-tools/releases/download/v1.29/solana-bpf-tools-linux.tar.bz2

Updated cargo-build-sbf tool will use the new url https://github.com/solana-labs/sbf-tools/releases/download/v1.29/solana-sbf-tools-linux.tar.bz2

smacrineanu commented 2 years ago

Can you use wget to download the tarball? The following command works for me

wget https://github.com/solana-labs/bpf-tools/releases/download/v1.29/solana-bpf-tools-linux.tar.bz2

Updated cargo-build-sbf tool will use the new url https://github.com/solana-labs/sbf-tools/releases/download/v1.29/solana-sbf-tools-linux.tar.bz2

It doesn't work for me. After reading on the internet, I realized it might have something to do with the fact that I'm using WSL. It seems multiple users reported this problem.

dmakarov commented 2 years ago

doesn't work because of url redirect? can you try

wget https://github.com/solana-labs/sbf-tools/releases/download/v1.29/solana-sbf-tools-linux.tar.bz2

would this work?

smacrineanu commented 2 years ago

doesn't work because of url redirect? can you try

wget https://github.com/solana-labs/sbf-tools/releases/download/v1.29/solana-sbf-tools-linux.tar.bz2

would this work?

No, sorry it does not work. I even tried with a fresh WSL install of an older Ubuntu distribution.

I already spent a lot of time on this and didn't find any relevant answer, guess I'll just install Ubuntu in a dual boot and try from there.

Update: Finally got it to work by downgrading WSL 2 to WSL1, with the Ubuntu 20.04 distribution.

dmakarov commented 2 years ago

Perhaps you could download the necessary tarball directly using a browser from here https://github.com/solana-labs/sbf-tools/releases/tag/v1.29 You could also try using our windows binaries.

smacrineanu commented 2 years ago

Perhaps you could download the necessary tarball directly using a browser from here https://github.com/solana-labs/sbf-tools/releases/tag/v1.29 You could also try using our windows binaries.

It's ok, I'm gonna work it out in the WSL environment for now. Thank you for the help, Dmitri

dmakarov commented 1 year ago

Can we close the issue?