You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using Lerna in our monorepo, and we have 2 packages with contracts. A GitHub action is used to compile the packages when changes are pushed to the repo. This uses Lerna to concurrently compile the 2 packages with contracts. Both attempt to download the same compiler at the same time, and sometimes it fails. It seems a concurrency issue probably due to opening the file from 2 different threads.
We have a workaround in which we have a third dummy package with a dummy contract for the same compiler version. We first run the compilation of the dummy package, thus triggering the download of the compiler. Then when we compile the other 2 packages the compiler is already available and it works.
However this is a nasty approach that also adds a new dependency to our repo: every time we need to add a new compiler version to a package, we need to remember to add the same version to the dummy package so it downloads the proper compiler.
This bug was related, but it was never followed up: #1925
Minimal reproduction steps
Please find a reproduction repo with instructions here:
Hey @robercano, thanks for this. I believe it's a duplicate of #3722 though. But your reproduction repo is better than mine, so I'm going to comment it in that issue.
Version of Hardhat
2.17.3
What happened?
We are using Lerna in our monorepo, and we have 2 packages with contracts. A GitHub action is used to compile the packages when changes are pushed to the repo. This uses Lerna to concurrently compile the 2 packages with contracts. Both attempt to download the same compiler at the same time, and sometimes it fails. It seems a concurrency issue probably due to opening the file from 2 different threads.
We have a workaround in which we have a third dummy package with a dummy contract for the same compiler version. We first run the compilation of the dummy package, thus triggering the download of the compiler. Then when we compile the other 2 packages the compiler is already available and it works.
However this is a nasty approach that also adds a new dependency to our repo: every time we need to add a new compiler version to a package, we need to remember to add the same version to the dummy package so it downloads the proper compiler.
This bug was related, but it was never followed up: #1925
Minimal reproduction steps
Please find a reproduction repo with instructions here:
https://github.com/robercano/hardhat-concurrency-issue
Search terms
concurrent download lerna hardhat compiler
The text was updated successfully, but these errors were encountered: