Open outdoteth opened 3 years ago
Thanks for reporting this @Dylan-Kerler,
Both of the things you mentioned seem correct.
Unfortunately, we don't have much time at the moment, so we can't fix them just yet. Would you consider sending a PR? We can help you thinking through it and reviewing it.
Ok, I'll open a PR later today.
https://github.com/nomiclabs/hardhat/blob/master/packages/hardhat-vyper/src/compilation.ts#L104
In
fsExtra.pathExists
the file lookup is not correct. It searches for<working dir>/artifacts/SomeContract.json
.If SomeContract.vy is in this folder:
<working dir>/contracts/SomeFolder/SomeContract.vy
Then
fsExtra.pathExists
should search for:<working dir>/artifacts/contracts/SomeFolder/SomeContract.vy/SomeContract.json
Because the lookup is incorrect, compilations are not cached.
By changing the path lookup to the below it works:
However there seems to be a secondary issue with the cTime comparison. Whenever one file changes, all of the files then seem to acquire a cTime that warrants a recompilation; So each time one file changes, all files are then compiled again.
https://github.com/nomiclabs/hardhat/blob/master/packages/hardhat-vyper/src/compilation.ts#L114