Skip to content

Commit

Permalink
feat: add 2 solc versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita P committed Nov 9, 2024
1 parent 2001f67 commit 1bf3f96
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 <string>' ./liblangutil/SourceLocation.h | xargs sed -i 's/#include <string>/#include <string>\n#include <limits>/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; \
Expand Down

0 comments on commit 1bf3f96

Please sign in to comment.