Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 8dbc0c8

Browse files
committed
Allow setting of a specific solc binary
Via the use of the `SOLC_BINARY` environment variable the user can now set a specific path to his solc executable if for example said user is compiling solidity from source.
1 parent 586e53b commit 8dbc0c8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ethereum/_solidity.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ def get_compiler_path():
2222
This funtion will search for the solc binary in the $PATH and return the
2323
path of the first executable occurence.
2424
"""
25+
# If the user provides a specific solc binary let's use that
26+
given_binary = os.environ.get('SOLC_BINARY')
27+
if given_binary:
28+
return given_binary
29+
2530
for path in os.getenv('PATH', '').split(os.pathsep):
2631
path = path.strip('"')
2732
executable_path = os.path.join(path, BINARY)

0 commit comments

Comments
 (0)