crytic / solc-select

Manage and switch between Solidity compiler versions
GNU Affero General Public License v3.0
746 stars 99 forks source link

[Bug-Candidate]: Unable to install solc versions on wsl ubuntu 20.04.06 #208

Open JacobYiu opened 9 months ago

JacobYiu commented 9 months ago

Describe the issue:

Hi, I have successfully downloaded solc-select. I have added ppa for ethereum however, I am unable to download any compiler versions for solc. When I use the command solc-select install 0.8.20. It just hangs there indefinitely after 10 minutes of waiting which I am quite confident that should not happen.

Code example to reproduce the issue:

N/A

Version:

0.2.0 Screenshot 2023-12-12 121249

Relevant log output:

No response

elopez commented 9 months ago

Hi! Does your network connectivity in WSL work fine otherwise? Can you confirm both the following commands work and show you some JSON?

curl https://raw.githubusercontent.com/crytic/solc/new-list-json/linux/amd64/list.json -v
curl https://binaries.soliditylang.org/linux-amd64/list.json -v

If that works, can you confirm this downloads a binary correctly?

curl https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.8.20+commit.a1b79de6 -o test -v
JacobYiu commented 9 months ago

Hi, it seems when I run this command curl https://raw.githubusercontent.com/crytic/solc/new-list-json/linux/amd64/list.json -v

It works as expected. However when I try to run this command,

curl https://binaries.soliditylang.org/linux-amd64/list.json -v It does not work

elopez commented 9 months ago

If you have the possibility, could you try with a different internet provider/internet connection? Unfortunately that server that does not seem to work from your computer is an external server we don't have control over.

Zodomo commented 9 months ago

Hi! Does your network connectivity in WSL work fine otherwise? Can you confirm both the following commands work and show you some JSON?

curl https://raw.githubusercontent.com/crytic/solc/new-list-json/linux/amd64/list.json -v
curl https://binaries.soliditylang.org/linux-amd64/list.json -v

If that works, can you confirm this downloads a binary correctly?

curl https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.8.20+commit.a1b79de6 -o test -v

I am able to do all three of these things and am also encountering this same problem. I'm not using WSL Ubuntu, but I am running it in a VirtualBox VM. I've tried completely removing all forms of solc from my computer, whether it be installed from snap, npm, solc-select, etc. I've purged it all. which solc, which solcjs, and which solc-select all return nothing. When I perform a clean install of solc-select with pip3 install solc-select, it takes a while but eventually goes through. I then run solc --version to see that solc 0.8.20 is installed instead of the newest 0.8.23 version. When I run solc-select install or solc-select use 0.8.23 --always-install, it just hangs forever as described in the original issue.

HOLLYwyh commented 3 months ago

The http proxy setting in Windows CMD works for me. I encountered the same situation when connecting to an Ubuntu server using my personal computer(Windows). This can serve as a reference for everyone.

  1. As mentioned in the previous comment, make sure this command works in your personal computercurl https://binaries.soliditylang.org/linux-amd64/list.json -v
  2. Retrieve your own computer's IP by running ipconfig on your computer and confirm a proxy port. For example, 127.0.0.1:10809
  3. To set up a proxy in Ubuntu Server, enter the following command: EXTERNAL_PROXY="http://127.0.0.1:10809" export HTTP_PROXY="$EXTERNAL_PROXY" export http_proxy="$EXTERNAL_PROXY" export HTTPS_PROXY="$EXTERNAL_PROXY"
    export https_proxy="$EXTERNAL_PROXY"

Next, you can successfully run it in the terminal of the Ubuntu server.