-
Notifications
You must be signed in to change notification settings - Fork 554
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
Cannot build solc on macOS #487
Comments
Hi, Thank you for opening this issue! This is an unfortunate limitation with OSX. Because there are no first-party OSX binaries being served, The contract in question (0xf79d6afbb6da890132f9d7c355e3015f15f3406f) was compiled using import solcx
solcx.install_solc('v0.4.24', allow_osx=True) Alternatively: I can see how all of the steps given above are less than ideal for dealing with the issue, especially from the perspective of a would-be new user. I will add a platform-specific check where contracts using |
Thanks for the quick reply! I already have version 0.4.26 of solc installed via homebrew, but the contract requires 0.4.24 - does the patch version need to match exactly? |
Yeah, what's happening is brownie tries to locally compile the contract with the exact compiler settings given by etherscan. This way we have access to information such the source map and AST, which are required for the debugging functionality. Changes in the patch version generate different bytecode, and even a slight variation can result in very strange and misleading trace outputs. All that said, it's not mission critical. If brownie can't verify, you can still interact with the contract using the ABI. It just becomes more "trust me" exercise that etherscan is serving an accurate ABI. A warning is raised in this case. |
OK that makes sense, thanks for the explanation. It would be a little more user-friendly if the error message could include the exact version of solc that is missing instead of just (in this case) 0.4.x, as that gave me the impression that installing any 0.4.x version manually would make the error go away. Overall I'm having a much easier time using brownie on Ubuntu, it all works really well so far! |
Excellent. Thanks for the feedback! I will address it in |
Environment information
brownie
Version: 1.8.2ganache-cli
Version: 6.9.1solc
Version: 0.4.26+commit.4563c3fc.Darwin.appleclangWhat was wrong?
I'm trying to use Brownie on macOS Catalina 10.15.4, following this guide: https://medium.com/@iamdefinitelyahuman/ethereum-mainnet-testing-with-python-and-brownie-82a61dee0222
Unfortunately, when I try and construct a Contract it seems to fail to install solc, due to a limitation in py-solc-x. I already have solc version 0.4.26 installed via homebrew, so I'm not quite sure why brownie is trying to reinstall solc for me.
How can it be fixed?
I think probably there is a bug with detecting and using my installed version of
solc
. If it really does need to install a different version, then maybe try passing theallow_osx=True
flag as suggested in the error message?The text was updated successfully, but these errors were encountered: