ApeWorX / ApeWorX/py-solc-x

solcx wrapper misinterpreting solc --help return code

Open
#132 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
142
Forks
50
PR merge metrics
No merged PRs in 30d

Description

### Environment information

* `py-solc-x` Version: 1.1.1
* `solc` Version: 0.8.10
* Python Version: 3.9.7
* OS: osx

### What was wrong?

Code (pretty much straight from https://web3py.readthedocs.io/en/stable/contracts.html):

```
source = open('solidity/contracts/Greeter.sol').read()
compiled_sol = solcx.compile_source(source)
```

Expected output: no errors
Actual output: solc returned 0, solc_wrapper expected 1 from help, so it throws an error

Abbreviated output:

```
solcx.exceptions.SolcError: An error occurred during execution
> command: `/Users/zzz/.solcx/solc-v0.8.10 --help -`
> return code: `0`
> stdout:
solc, the Solidity commandline compiler.

...
```

Test outside of solcx showing solc returns 0:

```
$ /Users/zzz/.solcx/solc-v0.8.10 --help -
solc, the Solidity commandline compiler.
...

$ echo $?
0
```

Full output attached:
[eth1.txt](https://github.com/iamdefinitelyahuman/py-solc-x/files/7507243/eth1.txt)

### How can it be fixed?

Change solc_wrapper to always expect 0 at this [line](https://github.com/iamdefinitelyahuman/py-solc-x/blob/master/solcx/wrapper.py#L101)?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.