-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
feat(CI): contracts compilers cached in a docker image #1888
Conversation
Signed-off-by: tomg10 <lemures64@gmail.com>
Signed-off-by: tomg10 <lemures64@gmail.com>
Signed-off-by: tomg10 <lemures64@gmail.com>
Signed-off-by: tomg10 <lemures64@gmail.com>
Signed-off-by: tomg10 <lemures64@gmail.com>
Signed-off-by: tomg10 <lemures64@gmail.com>
Signed-off-by: tomg10 <lemures64@gmail.com>
Signed-off-by: tomg10 <lemures64@gmail.com>
Signed-off-by: tomg10 <lemures64@gmail.com>
Signed-off-by: tomg10 <lemures64@gmail.com>
Signed-off-by: tomg10 <lemures64@gmail.com>
Signed-off-by: tomg10 <lemures64@gmail.com>
i see that in this pr you are simply copying binaries from docker to others. |
Just to understand: Is using the GitHub |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I share @slowli's concern that we will need to manually update the images with this approach. Moreover, it will be very easy to upgrade solc version and forget about this Dockerfile as having the compiler here is not a hard requirement for CI.
Ideally I am envisioning some way to share this env-paths
-based directory between builds so kind of what @slowli is talking about above.
export async function prepareCompilersCache() { | ||
// TODO(tomek) remove line below as soon as there is at least one pushed docker image | ||
await utils.spawn('zk docker build compilers'); | ||
await utils.spawn('docker create --name temp matterlabs/compilers:latest2.0'); | ||
await utils.spawn('mkdir -p /root/.cache/hardhat-nodejs/compilers-v2'); | ||
await utils.spawn('docker cp temp:./.cache/hardhat-nodejs/compilers-v2/ /root/.cache/hardhat-nodejs/'); | ||
await utils.spawn('chmod -R +x /root/.cache/hardhat-nodejs/'); | ||
await utils.spawn('docker rm temp'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems very environment-specific. Also, can we at least reuse whatever hardhat is using to derive this directories? env-paths
AFAIR
# This matches COMPILER_REPOSITORY_URL from hardhat-core. | ||
RUN wget -nv -O $COMPILER_DIR/linux-amd64/list.json https://binaries.soliditylang.org/linux-amd64/list.json | ||
|
||
RUN (for ver in solc-linux-amd64-v0.8.20+commit.a1b79de6 solc-linux-amd64-v0.8.23+commit.f704f362 solc-linux-amd64-v0.8.24+commit.e11b9ed9; do \ | ||
wget -nv -O $COMPILER_DIR/linux-amd64/$ver https://binaries.soliditylang.org/linux-amd64/$ver; \ | ||
done) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also have some arm runners, do you plan to cross-build this to support them too?
Closing this for now until we switch from foundry to hardhat |
No description provided.