Skip to content

Commit

Permalink
Merge branch 'feat/docker' into feat/aragon-nov
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita P committed Nov 9, 2024
2 parents 11caa26 + 53501de commit bdcc929
Showing 1 changed file with 138 additions and 7 deletions.
145 changes: 138 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,49 @@ RUN if [ "$TARGETARCH" = "arm64" ]; then \
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.4.24; \
/root/.solcx/solc-v0.4.24 --version | grep 'Version: 0.4.24+commit.e67f0147' || (echo "Incorrect solc-v0.4.24 version" && exit 1); \
git checkout .; \
git checkout develop; \
git clean -d -x -f; \
# build solc-v0.5.14
git checkout v0.5.14; \
grep -rl '\-Werror' ./cmake/EthCompilerSettings.cmake | xargs sed -i 's/\-Werror/\-Wno\-error/g'; \
# build solc faster
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'; \
./scripts/build.sh; \
mv /usr/local/bin/solc /root/.solcx/solc-v0.5.14; \
git checkout .; \
git checkout develop; \
git clean -d -x -f; \
# build solc-v0.5.12
git checkout v0.5.12; \
grep -rl '\-Werror' ./cmake/EthCompilerSettings.cmake | xargs sed -i 's/\-Werror/\-Wno\-error/g'; \
# build solc faster
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 <boost\/variant.hpp>' ./libyul/backends/wasm/EWasmAST.h | xargs sed -i 's/#include <boost\/variant.hpp>/#include <boost\/variant.hpp>\n#include <memory>/g'; \
./scripts/build.sh; \
mv /usr/local/bin/solc /root/.solcx/solc-v0.5.12; \
git checkout .; \
git checkout develop; \
git clean -d -x -f; \
fi

RUN if [ "$TARGETARCH" = "arm64" ]; then \
# build solc-v0.6.12
git checkout v0.6.12; \
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.6.12; \
git checkout .; \
git checkout develop; \
git clean -d -x -f; \
fi

RUN if [ "$TARGETARCH" = "arm64" ]; then \
# build solc-v0.8.28
Expand All @@ -62,7 +99,6 @@ RUN if [ "$TARGETARCH" = "arm64" ]; then \
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.28; \
/root/.solcx/solc-v0.8.28 --version | grep 'Version: 0.8.28+commit.7893614a' || (echo "Incorrect solc-v0.8.28 version" && exit 1); \
git checkout .; \git checkout .; \
git checkout develop; \
git clean -d -x -f; \
Expand All @@ -77,7 +113,6 @@ RUN if [ "$TARGETARCH" = "arm64" ]; then \
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.10; \
/root/.solcx/solc-v0.8.10 --version | grep 'Version: 0.8.10+commit.fc410830' || (echo "Incorrect solc-v0.8.10 version" && exit 1); \
git checkout .; \
git checkout develop; \
git clean -d -x -f; \
Expand All @@ -92,7 +127,6 @@ RUN if [ "$TARGETARCH" = "arm64" ]; then \
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.9; \
/root/.solcx/solc-v0.8.9 --version | grep 'Version: 0.8.9+commit.e5eed63a' || (echo "Incorrect solc-v0.8.9 version" && exit 1); \
git checkout .; \
git checkout develop; \
git clean -d -x -f; \
Expand All @@ -113,18 +147,102 @@ RUN if [ "$TARGETARCH" = "arm64" ]; then \
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.4; \
/root/.solcx/solc-v0.8.4 --version | grep 'Version: 0.8.4+commit.c7e474f2' || (echo "Incorrect solc-v0.8.4 version" && exit 1); \
git checkout .; \
git checkout develop; \
git clean -d -x -f; \
# build solc-v0.8.6
git checkout v0.8.6; \
# 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'; \
# there is a missed header in this version - we add it so that the code compiles
grep -rl '#include <string>' ./liblangutil/SourceLocation.h | xargs sed -i 's/#include <string>/#include <string>\n#include <limits>/g'; \
# there is a missed namespace in this version - we add it so that the code compiles
grep -rl 'size_t' ./tools/yulPhaser/PairSelections.h | xargs sed -i 's/size_t/std::size_t/g'; \
# there is a missed namespace in this version - we add it so that the code compiles
grep -rl 'size_t' ./tools/yulPhaser/Selections.h | xargs sed -i 's/size_t/std::size_t/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.6; \
git checkout .; \
git checkout develop; \
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; \
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; \
git checkout .; \
git checkout develop; \
git clean -d -x -f; \
fi

RUN if [ "$TARGETARCH" = "arm64" ]; then \
# build solc-v0.8.24
git checkout v0.8.24; \
# 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.24; \
git checkout .; \
git checkout develop; \
git clean -d -x -f; \
fi

RUN if [ "$TARGETARCH" = "arm64" ]; then \
# build solc-v0.6.11
git checkout v0.6.11; \
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.6.11; \
git checkout .; \
git checkout develop; \
git clean -d -x -f; \
fi

RUN if [ "$TARGETARCH" = "arm64" ]; then \
# manually install vyper
mkdir /root/.vvm; \
pip install vyper==0.3.7; \
ln -s /usr/local/bin/vyper /root/.vvm/vyper-0.3.7; \
/root/.vvm/vyper-0.3.7 --version | grep '0.3.7+' || (echo "Incorrect vyper-0.3.7 version" && exit 1); \
fi
# compilers for amd64 will be downloaded by brownie later in this Dockerfile

Expand Down Expand Up @@ -159,7 +277,20 @@ RUN node --version | grep 'v18.20.4' || (echo "Incorrect node version" && exit 1
RUN npm --version | grep '10.7.0' || (echo "Incorrect npm version" && exit 1)
RUN poetry --version | grep 'Poetry (version 1.8.2)' || (echo "Incorrect poetry version" && exit 1)
RUN yarn --version | grep '1.22.22' || (echo "Incorrect yarn version" && exit 1)

RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.4.24 --version | grep 'Version: 0.4.24+commit.e67f0147' || (echo "Incorrect solc-v0.4.24 version" && exit 1) fi
RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.5.14 --version | grep 'Version: 0.5.14+commit.01f1aaa4' || (echo "Incorrect solc-v0.5.14 version" && exit 1) fi
RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.5.12 --version | grep 'Version: 0.5.12+commit.7709ece9' || (echo "Incorrect solc-v0.5.12 version" && exit 1) fi
RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.6.12 --version | grep 'Version: 0.6.12+commit.27d51765' || (echo "Incorrect solc-v0.6.12 version" && exit 1) fi
RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.8.28 --version | grep 'Version: 0.8.28+commit.7893614a' || (echo "Incorrect solc-v0.8.28 version" && exit 1) fi
RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.8.10 --version | grep 'Version: 0.8.10+commit.fc410830' || (echo "Incorrect solc-v0.8.10 version" && exit 1) fi
RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.8.9 --version | grep 'Version: 0.8.9+commit.e5eed63a' || (echo "Incorrect solc-v0.8.9 version" && exit 1) fi
RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.8.4 --version | grep 'Version: 0.8.4+commit.c7e474f2' || (echo "Incorrect solc-v0.8.4 version" && exit 1) fi
RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.8.6 --version | grep 'Version: 0.8.6+commit.11564f7e' || (echo "Incorrect solc-v0.8.6 version" && exit 1) fi
RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.7.6 --version | grep 'Version: 0.7.6+commit.7338295f' || (echo "Incorrect solc-v0.7.6 version" && exit 1) fi
RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.8.15 --version | grep 'Version: 0.8.15+commit.e14f2714' || (echo "Incorrect solc-v0.8.15 version" && exit 1) fi
RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.8.24 --version | grep 'Version: 0.8.24+commit.e11b9ed9' || (echo "Incorrect solc-v0.8.24 version" && exit 1) fi
RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.6.11 --version | grep 'Version: 0.6.11+commit.5ef660b1' || (echo "Incorrect solc-v0.6.11 version" && exit 1) fi
RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.vvm/vyper-0.3.7 --version | grep '0.3.7+' || (echo "Incorrect vyper-0.3.7 version" && exit 1) fi

# open sshd port
EXPOSE 22
Expand Down

0 comments on commit bdcc929

Please sign in to comment.