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

Provide a direct way to pass a custom solc binary path #76

Closed
dmuhs opened this issue May 21, 2020 · 1 comment
Closed

Provide a direct way to pass a custom solc binary path #76

dmuhs opened this issue May 21, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@dmuhs
Copy link
Contributor

dmuhs commented May 21, 2020

Overview

In some scenarios where I am applying py-solc-x, a user might want to specify a solc version that is already set up on their machine. This means that the automatic installation should not be executed.
I have seen that there is the SOLCX_BINARY_PATH env var, which allows the user to specify which directory to look in for a solc binary. There is also a platform-specific check using which to look for the solc binary on the PATH.
When using the library (which is absolutely amazing btw!), I expected a more explicit way. Please consider the following examples.

Specification

An addition to the compilation parameter set, such as:

solcx.compile_standard(
   ...
   solc_path="/foo/bar/solc"
)

This would effectively short-circuit any internal checks looking for the solc binary and simply take over the parameter's location if it has been set. Alternatively, and following the paradigm of explicit module-level calls, an explicit setting outside of a function call can be considered as well:

import solcx
solcx.set_solc_installation("/foo/bar/solc")

This would result in a global short circuit of the checking logic and always use the path set with set_solc_installation.

At first glance both ways seem to not cause any breaking changes.

@iamdefinitelyahuman
Copy link
Contributor

I really like this! It would essentially reconnect py-solc-x with the original py-solc by making the installation and version management an optional behavior.

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

No branches or pull requests

2 participants