Skip to content
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

solc 0.5.x compatibility, ability to change compilers as needed #65

Closed
wants to merge 20 commits into from

Conversation

iamdefinitelyahuman
Copy link

@iamdefinitelyahuman iamdefinitelyahuman commented Dec 5, 2018

What was wrong?

  • py-solc is incompatible with solc v0.5.0 due to depeciation of "--combined-json clone-bin"
  • solc v0.5.0 introduces many breaking changes and cannot compile v0.4.x contracts

Over the next few months, I'd imagine may of us will be working with contracts on both 0.4.x and 0.5.x simultaneously. To that end, it would be useful to be able to easily switch compiler versions.

How was it fixed?

  • Modified wrapper.py - line 87, added a check for version 0.5.x to remove the clone-bin argument if needed
  • Modified install.py - can now install versions 0.5.0 and 0.5.1, and each version of solc is installed into py-solc/bin/solc/
  • Added main.set_solc_version - modifies which compiler py-solc is actively using, and installs if necessary
  • Added main.get_installed_solc_versions - to see which versions of solc have been installed
  • Modified __init__.py so that on the first import it installs solc v0.5.1

fixes #63
fixes #64

Cute Animal Picture

baby llama approves

@pryce-turner
Copy link

Didn't see this one when I made mine. Fixes everything on my machine.

@iamdefinitelyahuman
Copy link
Author

Didn't see this one when I made mine. Fixes everything on my machine.

This PR is also failing the travis checks, and like you I'm not familiar with it's use. I think the issue is because the tests are written assuming that solc is installed to /usr/bin but with how I've modified it, solc is now installed elsewhere. Also this PR will need some more work to support windows users. As suggested in the community guidelines, this is more meant to open a discussion as to whether this approach is one that's worth working on further.

@pryce-turner
Copy link

Yeah it looks like @pipermerriam and co are pretty busy over at web3.py getting it up to speed with Sol 0.5.x, hopefully the wrapper fixes are fairly easy and we can bring this up to spec soon as well. As far as I know, the clone-bin issue was the only breaking change for the wrapper.

@kaisert
Copy link

kaisert commented Dec 18, 2018

Any updates on this?

@pipermerriam
Copy link
Member

It's very likely that py-solc is going to be formally deprecated and no longer maintained in the very near term future. It's an old carry-over from populus and wrapping solidity APIs like this has a large maintenance load that we can't justify.

@ritzdorf
Copy link

ritzdorf commented Jan 3, 2019

@pipermerriam Thanks for the update. Do you see any alternative to py-solc?

@pipermerriam
Copy link
Member

Not that we plan to build/maintain but it should be quite trivial to fork this repository and maintain/update it yourself if it is an important part of your stack.

@iamdefinitelyahuman
Copy link
Author

iamdefinitelyahuman commented Jan 6, 2019

@pipermerriam thanks for letting us know, and for your work on this project to date. I rely on py-solc a fair bit, so I will continue to maintain the repo I have forked and upload it to pypi under a similar name.

Update - my forked repo is now available on pypi:

pip install py-solc-x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

py-solc is incompatible with Solidity compiler 0.5.0 Add support for solc 0.5.0
5 participants