solidity-docgen icon indicating copy to clipboard operation
solidity-docgen copied to clipboard

Support use with multiple compilers

Open PaulRBerg opened this issue 4 years ago • 5 comments

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.

PaulRBerg avatar Dec 01 '21 12:12 PaulRBerg

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.

frangio avatar Dec 01 '21 17:12 frangio

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!

PaulRBerg avatar Dec 01 '21 17:12 PaulRBerg

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.

frangio avatar Dec 01 '21 20:12 frangio

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

galekseev avatar Mar 18 '22 09:03 galekseev

Hardhat plugin is being worked on, see #350.

frangio avatar Mar 21 '22 04:03 frangio