ApeWorX / py-solc-x

Python wrapper and version management tool for the solc Solidity compiler.
https://solcx.readthedocs.io/
MIT License
138 stars 48 forks source link

Unclear error message when OSX installation fails #26

Closed maurelian closed 4 years ago

maurelian commented 4 years ago

This is an issue from an upstream tool: https://github.com/dmuhs/mythx-cli/issues/34, which I've been asked to report here:

Description

mythx analyze --mode quick contracts/**/*.sol
Unsupported macOS version.
We only support Mavericks, Yosemite, El Capitan, Sierra, High Sierra and Mojave.
Usage: mythx analyze [OPTIONS] [TARGET]...

Error: Error installing solc version v0.5.10: Command '['sh', '/var/folders/vk/01zl87497jx6bq66fhhhd9zm0000gn/T/py-solc-x-tmp/solidity_0.5.10/scripts/install_deps.sh']' returned non-zero exit status 1.
iamdefinitelyahuman commented 4 years ago

This looks like a compatibility issue between solc and OSX 10.15. Seems it was fixed in https://github.com/ethereum/solidity/pull/7367 and first included in solc v0.5.12.

If you can install solc v0.5.10 manually via brew, py-solc-x will use that version rather than attempting to install it's own copy, and you can avoid this issue. Unfortunately I don't have a copy of OSX 10.15 available to experiment with, so not certain if this is actually an option.

maurelian commented 4 years ago

Yeah, fortunately Solidity does support previous version using brew.

To leave a breadcrumb, instructions to do so are towards the end of this section: https://solidity.readthedocs.io/en/v0.6.0/installing-solidity.html#binary-packages

iamdefinitelyahuman commented 4 years ago

Good idea - I'll improve the verbosity when an OSX install fails, to include mention of installing via brew. Thanks!

iamdefinitelyahuman commented 4 years ago

I took a closer look and realized I can just log a warning when the dependency script fails, there's no need to raise an exception. And I've improved the verbosity so users aren't left in the dark when it does fail.

Fix is on the v0.6.1 branch. I'm gonna deal with issues re: solc 0.6.0 and then will push a new version to pypi.

Thanks again for pointing this out!