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

Solidity 0.8.18 binaries built with too new version of GLIBC for support of Ubuntu 20.04.5 LTS on WSL #13921

Closed
pcaversaccio opened this issue Feb 2, 2023 · 18 comments
Assignees
Labels
bug 🐛 high impact Changes are very prominent and affect users or the project in a major way. low effort There is not much implementation work to be done. The task is very easy or tiny. must have Something we consider an essential part of Solidity 1.0. solcbin

Comments

@pcaversaccio
Copy link

Description

While installing the new Solidity version 0.8.18 (via solc-select) on my WSL instance that uses Ubuntu 20.04.5 LTS I ran into the following problem:

~$ solc-select install 0.8.18
Installing '0.8.18'...
Version '0.8.18' installed.

~$ solc-select use 0.8.18
Switched global version to 0.8.18

~$ solc --version
/home/user/.solc-select/artifacts/solc-0.8.18/solc-0.8.18: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /home/user/.solc-select/artifacts/solc-0.8.18/solc-0.8.18)
/home/user/.solc-select/artifacts/solc-0.8.18/solc-0.8.18: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/user/.solc-select/artifacts/solc-0.8.18/solc-0.8.18)
/home/user/.solc-select/artifacts/solc-0.8.18/solc-0.8.18: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /home/user/.solc-select/artifacts/solc-0.8.18/solc-0.8.18)

For 0.8.17 everything works as intended, so I guess the binaries have been built using a too recent version of GLIBC that is not yet supported. Not sure how to fix this tbh. FYI, on Windows everything works smoothly.

@github-actions github-actions bot added this to Triage in Solidity Feb 2, 2023
@cameel
Copy link
Member

cameel commented Feb 2, 2023

I can reproduce that with docker, so it's not specific to WSL (see below). We switched to building the Linux version on Ubuntu 22.04 in this release. Some time ago we added a mechanism to load Z3 dynamically (#10483) so the binary is no longer completely static and glibc is actually linked dynamically. This appears to be an incompatibility caused by that.

We maintain the ethereum/ethereum-static PPA that provides completely static builds that should work on any Ubuntu version (see below).

Still, the main argument in #10483 was that glibc should be compatible way back to 2.14, released in 2011 and it's unlikely to break compatibility again. @ekpyron, did they actually break compatibility now?

Installing from our PPA

apt install software-properties-common
add-apt-repository ppa:ethereum/ethereum-static
apt install solc

Repro with Docker

docker run -it --rm ubuntu:focal
apt update
apt install --assume-yes wget
cd /tmp
wget https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.8.18+commit.87f61d96
chmod +x solc-linux-amd64-v0.8.18+commit.87f61d96
./solc-linux-amd64-v0.8.18+commit.87f61d96 --version
./solc-linux-amd64-v0.8.18+commit.87f61d96: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./solc-linux-amd64-v0.8.18+commit.87f61d96)
./solc-linux-amd64-v0.8.18+commit.87f61d96: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by ./solc-linux-amd64-v0.8.18+commit.87f61d96)
./solc-linux-amd64-v0.8.18+commit.87f61d96: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./solc-linux-amd64-v0.8.18+commit.87f61d96)

@pcaversaccio
Copy link
Author

Yes the PPA approach indeed works and is a temporary fix for anyone who wants to quickly install 0.8.18. The problem is that I switch a lot between different solc versions (e.g. for reviewing different contracts, using slither on different repos etc.) and therefore I want to use the solc-select env. In any case, for the moment I can use Windows solc-select & solc 0.8.18 for which I obviously don't encounter this problem. But yes it seems some compatibility broke...

@cameel
Copy link
Member

cameel commented Feb 2, 2023

After discussing this with @ekpyron - looks like glibc indeed must have broken compatibility, which is a very rare thing. We'll need to discuss whether we want to continue with these not entirely static builds going forward.

For the moment, we're going to fix the problem with this particular release by rebuilding on 20.04 and swapping the binaries in the release.

@cameel cameel added bug 🐛 solcbin low effort There is not much implementation work to be done. The task is very easy or tiny. high impact Changes are very prominent and affect users or the project in a major way. must have Something we consider an essential part of Solidity 1.0. labels Feb 2, 2023
@cameel cameel removed this from Triage in Solidity Feb 2, 2023
@pcaversaccio
Copy link
Author

@cameel thanks a lot for the swift action - yeah this is a really rare scenario and must be analysed in-depth.

@cameel
Copy link
Member

cameel commented Feb 2, 2023

The binary in solc-bin and on the github release page has been replaced (ethereum/solc-bin#129).

We also added a note about it in the release blog post

@0xicingdeath
Copy link

Would you be able to confirm that the new 0.8.18 binary should have a sha256 hash of 0x95e6ed4949a63ad89afb443ecba1fb8302dd2860ee5e9baace3e674a0f48aa77?

On solc-select, we are executing checks against sha256 and keccak256. These are mismatched as below:

sha256 from solidity lang website manifest: 0x95e6ed4949a63ad89afb443ecba1fb8302dd2860ee5e9baace3e674a0f48aa77
downloaded file sha256: 0xa1c0f33eb4482c26f56719ecf62b0ee05d7d7a4f8264ffbddf9ebcd9095c32bd
keccak256 from solidity lang website manifest 0x932901581a2ef0795851363522811fa160db5561e34cbb306e7105b6bbc3834d
downloaded file keccak256 0x265ad8479d7c5d30ef3556c5c23efddbf1718c1112abd219a6add420489cf930

I executed a manual test on the binary available at the specified path, and I am still getting the old checksum.

$ sha256sum solc08
a1c0f33eb4482c26f56719ecf62b0ee05d7d7a4f8264ffbddf9ebcd9095c32bd  solc08

@pcaversaccio
Copy link
Author

@0xicingdeath can confirm the same behaviour and actually pinged 5 mins ago @0xalpharush about that lol. You will always run into the following issue:
image

@0xicingdeath
Copy link

It's possible that the old binary is being cached and being sent back when we try to retrieve. I just tried a curl on the most recent binary and I am still getting the old a1...bd checksum:

$ curl -o solc08 https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.8.18+commit.87f61d96
$sha256sum solc08
a1c0f33eb4482c26f56719ecf62b0ee05d7d7a4f8264ffbddf9ebcd9095c32bd  solc08

@pcaversaccio
Copy link
Author

definitely cached imho - I just downloaded it and it works:

image

funny enough, if I use solc-select it somehow fails...

@0xicingdeath
Copy link

I tried downloading the most recent from the link too, and I'm getting the 95...77 hash on OS X; but a1...bd on Linux

@pcaversaccio
Copy link
Author

very very weird - some cloudflare/cloudfront issue?

@pcaversaccio
Copy link
Author

If I do nix-prefetch-url --type sha256 https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.8.18+commit.87f61d96 I still get the old hash which is 1g9jbh4xkg4yvyyzyr429xx7spg01qmzdv0rczsjcb28nhzg7h51. I think that one should have changed as well in the meantime...

@0xicingdeath
Copy link

Agreed, I'm getting inconsistent binaries across platforms when I try to curl from that link.

@0xicingdeath
Copy link

0xicingdeath commented Feb 3, 2023

@pcaversaccio Built a hotfix into solc-select to let you use the most up to date solidity version. Checkout the latest dev otherwise 1.0.3 release for pip is also incoming https://github.com/crytic/solc-select

@pcaversaccio
Copy link
Author

cool, will check it out. Btw now my error changed to a 404 error with the current solc-select version :)

~$ solc-select install 0.8.18
Installing '0.8.18'...
Traceback (most recent call last):
  File "/home/user/.local/bin/solc-select", line 8, in <module>
    sys.exit(solc_select())
  File "/home/user/.local/lib/python3.8/site-packages/solc_select/__main__.py", line 58, in solc_select
    install_artifacts(args.get(INSTALL_VERSIONS))
  File "/home/user/.local/lib/python3.8/site-packages/solc_select/solc_select.py", line 84, in install_artifacts
    urllib.request.urlretrieve(url, artifact_file_dir.joinpath(f"solc-{version}"))
  File "/usr/lib/python3.8/urllib/request.py", line 247, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

@pcaversaccio
Copy link
Author

@0xicingdeath I upgraded to solc-select 1.0.3 and can confirm that it works now.

@r0qs
Copy link
Member

r0qs commented Feb 3, 2023

It's possible that the old binary is being cached and being sent back when we try to retrieve. I just tried a curl on the most recent binary and I am still getting the old a1...bd checksum:

$ curl -o solc08 https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.8.18+commit.87f61d96
$sha256sum solc08
a1c0f33eb4482c26f56719ecf62b0ee05d7d7a4f8264ffbddf9ebcd9095c32bd  solc08

Hi @0xicingdeath and @pcaversaccio yes, indeed it was a cache problem. We invalided the cache for this binary now. So it should be working. Sorry for that.

wget -q https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.8.18+commit.87f61d96 && sha256sum solc-linux-amd64-v0.8.18+commit.87f61d96
95e6ed4949a63ad89afb443ecba1fb8302dd2860ee5e9baace3e674a0f48aa77  solc-linux-amd64-v0.8.18+commit.87f61d96

@pcaversaccio
Copy link
Author

Interestingly that the CI test for dapptools is failing now in my PR: dapphub/dapptools#969. Using the "older" version it was successful...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 high impact Changes are very prominent and affect users or the project in a major way. low effort There is not much implementation work to be done. The task is very easy or tiny. must have Something we consider an essential part of Solidity 1.0. solcbin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants