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

Does not detect solc built from source (even when solc is on path) #40

Closed maurelian closed 4 years ago

maurelian commented 4 years ago

Version Info

The Issue

I cloned and built 0.5.16 from source, then symlinked it to my path, because I've had trouble installing with Homebrew. However py-solc-x doesn't seem to find it.

% which solc
/usr/local/bin/solc
% solc --version
solc, the solidity compiler commandline interface
Version: 0.5.16+commit.9c3226ce.Darwin.appleclang
% python
Python 3.7.5 (default, Nov 25 2019, 17:09:49)
[Clang 11.0.0 (clang-1100.0.33.12)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from solcx import get_solc_version, set_solc_version
>>> get_solc_version()
Version('0.6.2+commit.bacdbe57.Darwin.appleclang')

I ran into this issue while trying to use mythx-cli.

iamdefinitelyahuman commented 4 years ago

In OSX, the check for already installed versions only looks at /usr/local/Cellar. It should be straightforward to call which solc and also add the returned path, if any.

I can hopefully add this check and push a new release tomorrow. For now, if you copy /usr/local/bin/solc to ~/.solcx/solc-v0.5.16 it should be available from solcx.

Thanks for letting me know!