Deivitto / auditor-docker

https://hackmd.io/7zriwLB0SD6-3AUDv3pBBg?view
GNU General Public License v3.0
123 stars 11 forks source link

Issues installing solidity `0.8.20` with `solc-select` on M1 mac #56

Open eugenioclrc opened 9 months ago

eugenioclrc commented 9 months ago

Reproducing steps:

whitehat@4cfb79db3f7b:~/test/echidna$  solc-select install 0.8.20
Installing solc '0.8.20'...
solVersion '0.8.20' installed.
whitehat@4cfb79db3f7b:~/test/echidna$ solc-select use 0.8.20
Switched global version to 0.8.20
whitehat@4cfb79db3f7b:~/test/echidna$ solc --version
qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory
whitehat@4cfb79db3f7b:~/test/echidna$ 
Deivitto commented 8 months ago
eugenioclrc commented 8 months ago

Gonna reupdate everything and re checke, stay tunned

eugenioclrc commented 8 months ago

Similar issue after reinstalling:

Screenshot 2023-12-18 at 10 22 24
magnetto90 commented 8 months ago

Having a similar issue when executing brownie test image

Deivitto commented 8 months ago

Dunno if maybe one of these answers from solc-select will help:

Also there are people that uses version 0.2.0 which seems less buggy:

pip3 uninstall solc-select 
pip3 install solc-select==0.2.0
solc-select install 

WSL ubuntu issue (may be related)

TomasCImach commented 8 months ago

Succeded to replicate the error on mac M1, and solved by building the docker image the following flag:

docker build --platform linux/amd64 -t whitehat-machine . Then follow the rest of the instructions.

Make sure you have Rosetta installed on your macOS.

elopez commented 6 months ago

solc binaries are built for x86_64 linux, so if you're building arm64 linux containers (e.g. on a M1 Mac) they won't normally run. Older solc versions were fully static binaries, so they work fine if you're using Docker Desktop on M1 because the Intel emulation handles them nicely. Newer solc builds are not static though, and will fail to run on an arm64 container without the proper x86_64 libraries installed.

If you're using Docker Desktop with Rosetta off (i.e, with the classic QEMU user-space emulation), you can use something like this to be able to run newer solc binaries: https://github.com/crytic/slither/blob/master/Dockerfile#L30-L36