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

Support use with multiple compilers #338

Open
PaulRBerg opened this issue Dec 1, 2021 · 5 comments
Open

Support use with multiple compilers #338

PaulRBerg opened this issue Dec 1, 2021 · 5 comments

Comments

@PaulRBerg
Copy link
Contributor

PaulRBerg commented Dec 1, 2021

When running solidity-docgen in a project that uses multiple Solidity compilers, I am getting this error:

Error: Solidity was unable to compile. ParserError: Source file requires different compiler version (current compiler is
    0.8.9+commit.e5eed63a.Emscripten.clang) - note that nightly builds are considered to be strictly less than the released version
     --> contracts/uniswap-v2/UniswapV2Pair.sol:3:1:
      |
    3 | pragma solidity =0.5.16;
      | ^^^^^^^^^^^^^^^^^^^^^^^^

How could I use this tool with multiple Solidity compilers?

Side note: it might be worth it to enable discussions in this GitHub repository.

@frangio
Copy link
Contributor

frangio commented Dec 1, 2021

Thanks for the suggestion, I've enabled discussions.

Currently you would only be able to run in this context by keeping those contracts in separate directories, and including the option when running -i contracts/subdir.

@PaulRBerg
Copy link
Contributor Author

PaulRBerg commented Dec 1, 2021

Thanks for the suggestion, I've enabled discussions.

Nice. You can also convert this issue to a discussion - there's a button on the right-hand side of the screen.

Currently you would only be able to run in this context by keeping those contracts in separate directories, and including the option when running -i contracts/subdir.

Argh, yeah I'll have to refactor my code. Thanks anyway!

@frangio frangio changed the title How to use this with multiple compilers? Support use with multiple compilres Dec 1, 2021
@frangio frangio changed the title Support use with multiple compilres Support use with multiple compilers Dec 1, 2021
@frangio
Copy link
Contributor

frangio commented Dec 1, 2021

Argh, yeah I'll have to refactor my code.

Sorry about that!

Keeping this open as an issue because I recognize it's a legitimate problem we should solve, and it's going to happen more and more as projects mature.

Eventually the solution is I think to turn this into a Hardhat plugin where compilation is done by Hardhat which already supports multiple versions. We lose some generality by tying to Hardhat but we could add a fallback to something like what the tool does today.

@galekseev
Copy link

We've got the same problem. Hardhat plugin will do great for us.

@frangio
Copy link
Contributor

frangio commented Mar 21, 2022

Hardhat plugin is being worked on, see #350.

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

No branches or pull requests

3 participants