diff --git a/Dockerfile b/Dockerfile index cfbb135d..cc933c4f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -181,6 +181,41 @@ RUN if [ "$TARGETARCH" = "arm64" ]; then \ git clean -d -x -f; \ fi +RUN if [ "$TARGETARCH" = "arm64" ]; then \ + # build solc-v0.8.15 + git checkout v0.8.15; \ + # the compiler throws warnings when compiling this version, and the warnings are treated as errors. + # we disable treating the warnings as errors, unless the build doesn't succeed + grep -rl '\-Werror' ./cmake/EthCompilerSettings.cmake | xargs sed -i 's/\-Werror/\-Wno\-error/g'; \ + # there is no sudo in the container, but we are under root so we do not need it + grep -rl 'sudo make install' ./scripts/build.sh | xargs sed -i 's/sudo make install/make install/g'; \ + # build solc faster + grep -rl 'make -j2' ./scripts/build.sh | xargs sed -i 's/make -j2/make -j4/g'; \ + ./scripts/build.sh; \ + mv /usr/local/bin/solc /root/.solcx/solc-v0.8.15; \ + /root/.solcx/solc-v0.8.15 --version | grep 'Version: 0.8.15+commit.e14f2714' || (echo "Incorrect solc-v0.8.15 version" && exit 1); \ + git checkout .; \ + git checkout develop; \ + git clean -d -x -f; \ + fi + +RUN if [ "$TARGETARCH" = "arm64" ]; then \ + # build solc-v0.7.6 + git checkout v0.7.6; \ + grep -rl '\-Werror' ./cmake/EthCompilerSettings.cmake | xargs sed -i 's/\-Werror/\-Wno\-error/g'; \ + grep -rl 'make -j2' ./scripts/build.sh | xargs sed -i 's/make -j2/make -j4/g'; \ + grep -rl 'sudo make install' ./scripts/build.sh | xargs sed -i 's/sudo make install/make install/g'; \ + grep -rl '#include ' ./liblangutil/SourceLocation.h | xargs sed -i 's/#include /#include \n#include /g'; \ + grep -rl 'size_t' ./tools/yulPhaser/PairSelections.h | xargs sed -i 's/size_t/std::size_t/g'; \ + grep -rl 'size_t' ./tools/yulPhaser/Selections.h | xargs sed -i 's/size_t/std::size_t/g'; \ + ./scripts/build.sh; \ + mv /usr/local/bin/solc /root/.solcx/solc-v0.7.6; \ + /root/.solcx/solc-v0.7.6 --version | grep 'Version: 0.7.6+commit.7338295f' || (echo "Incorrect solc-v0.7.6 version" && exit 1); \ + git checkout .; \ + git checkout develop; \ + git clean -d -x -f; \ + fi + RUN if [ "$TARGETARCH" = "arm64" ]; then \ # manually install vyper mkdir /root/.vvm; \