ApeWorX / py-solc-x

Python wrapper and version management tool for the solc Solidity compiler.

Home Page:https://solcx.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setting version with `set_solc_version_pragma` will cause `get_executable` to fail

p-lucero opened this issue · comments

Environment information

  • py-solc-x Version: 0.7.2
  • solc Version: 0.6.4
  • Python Version: 3.7.5
  • OS: Linux

What was wrong?

When the version is set with set_solc_version_pragma, it strips the v from the version number. If the version is, for example, "v0.6.4", it will set the global solc_version variable to simply "0.6.4". However, install_solc will install an execuable such as solc-v0.6.4, which means that get_executable will expect solc_version to be of the form "v0.6.4". This means that calling set_solc_version_pragma before get_executable will cause the latter call to fail, even if the executable is installed.

How can it be fixed?

Calling _check_version in set_solc_version_pragma as in #49 should fix the issue.

Good catch!

This issue is a good argument for implementing #17 and doing a 1.0.0 release.