matter-labs / zksolc-bin

Releases of the Solidity compiler for ZKsync
https://github.com/matter-labs/zksolc-bin
Apache License 2.0
54 stars 26 forks source link

Error compiling 0.8.25 solidity version #20

Open agsola opened 4 months ago

agsola commented 4 months ago

When trying to compile 0.8.25 contracts, I'm getting this error:

Compiling contracts for zkSync Era with zksolc v1.4.0 and solc v0.8.25
Compiling 78 Solidity files
Error: write EPIPE
    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16)

IMHO it should alert if 0.8.25 is not supported, if it is the case.

janjakubnanista commented 2 months ago

Hey @agsola! The solution that worked for me, after debugging the solc JavaScript wrapper, was to explicitly add solc as a dependency to my package.json.

The issue comes from the fact that inside the solc JavaScript wrapper, a call is made to require a module. The module 's name is resolved dynamically from solc/wrapper - if you don't have solc installed, this will result in an undefined module name which will break the consequent require call

hedgar2017 commented 2 months ago

Sounds like a case Hardhat should handle.

cc @MexicanAce @githubdoramon