diff --git a/scripts/compiler_tests/build_all.sh b/scripts/compiler_tests/build_all.sh new file mode 100755 index 0000000..7f35951 --- /dev/null +++ b/scripts/compiler_tests/build_all.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +# Example usage: build_all.sh v4.8.1 + +cd "$(dirname "$0")" + +docker images | grep -q p2pool_compiler_tests_ubuntu + +if [ $? -ne 0 ]; then + echo "Build image not found, creating it" + images/ubuntu/build.sh +fi + +for i in 8 9 10 11 12 13 14 15; +do + gcc/build.sh $1 $i +done diff --git a/scripts/compiler_tests/gcc/Dockerfile b/scripts/compiler_tests/gcc/Dockerfile new file mode 100644 index 0000000..8842115 --- /dev/null +++ b/scripts/compiler_tests/gcc/Dockerfile @@ -0,0 +1,4 @@ +FROM p2pool_compiler_tests_ubuntu +ARG P2POOL_VERSION GCC_VERSION +ADD test.sh /p2pool/ +RUN /p2pool/test.sh ${P2POOL_VERSION} ${GCC_VERSION} diff --git a/scripts/compiler_tests/gcc/build.sh b/scripts/compiler_tests/gcc/build.sh new file mode 100755 index 0000000..bc4a70a --- /dev/null +++ b/scripts/compiler_tests/gcc/build.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# Example usage: ./build.sh v4.8.1 15 + +cd "$(dirname "$0")" + +docker build --build-arg P2POOL_VERSION=$1 --build-arg GCC_VERSION=$2 -t p2pool_compiler_test_gcc_$2 . + +docker create --name p2pool_compiler_test_gcc_$2_container p2pool_compiler_test_gcc_$2:latest +docker cp p2pool_compiler_test_gcc_$2_container:/p2pool/logs.tar.gz logs_$2.tar.gz +docker rm p2pool_compiler_test_gcc_$2_container + +docker image rm -f p2pool_compiler_test_gcc_$2 diff --git a/scripts/compiler_tests/gcc/test.sh b/scripts/compiler_tests/gcc/test.sh new file mode 100755 index 0000000..a52a5d9 --- /dev/null +++ b/scripts/compiler_tests/gcc/test.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +cd /p2pool +git fetch --jobs=$(nproc) +git checkout $1 +git submodule update --recursive --jobs $(nproc) + +COMPILER="-DCMAKE_C_COMPILER=/usr/local/gcc-$2/bin/gcc -DCMAKE_CXX_COMPILER=/usr/local/gcc-$2/bin/g++ -DCMAKE_AR=/usr/local/gcc-$2/bin/gcc-ar -DCMAKE_RANLIB=/usr/local/gcc-$2/bin/gcc-ranlib" + +cd /p2pool +mkdir build && cd build + +cmake .. -DCMAKE_BUILD_TYPE=Release $COMPILER 1>> /p2pool/output.log 2>&1 +make -j$(nproc) p2pool 1>> /p2pool/output.log 2>&1 +./p2pool --test 1>> /p2pool/output.log 2>&1 + +cd ../tests +mkdir build && cd build +cmake .. -DCMAKE_BUILD_TYPE=Release $COMPILER 1>> /p2pool/output.log 2>&1 +make -j$(nproc) p2pool_tests 1>> /p2pool/output.log 2>&1 +gunzip *.gz +./p2pool_tests 1>> /p2pool/output.log 2>&1 + +tar -czvf /p2pool/logs.tar.gz /p2pool/output.log diff --git a/scripts/compiler_tests/images/ubuntu/Dockerfile b/scripts/compiler_tests/images/ubuntu/Dockerfile new file mode 100644 index 0000000..2d4f537 --- /dev/null +++ b/scripts/compiler_tests/images/ubuntu/Dockerfile @@ -0,0 +1,3 @@ +FROM ubuntu:24.04 +ADD prepare.sh / +RUN /prepare.sh diff --git a/scripts/compiler_tests/images/ubuntu/build.sh b/scripts/compiler_tests/images/ubuntu/build.sh new file mode 100755 index 0000000..00be080 --- /dev/null +++ b/scripts/compiler_tests/images/ubuntu/build.sh @@ -0,0 +1,3 @@ +#!/bin/sh +cd "$(dirname "$0")" +docker build -t p2pool_compiler_tests_ubuntu . diff --git a/scripts/compiler_tests/images/ubuntu/prepare.sh b/scripts/compiler_tests/images/ubuntu/prepare.sh new file mode 100755 index 0000000..cb2e37c --- /dev/null +++ b/scripts/compiler_tests/images/ubuntu/prepare.sh @@ -0,0 +1,133 @@ +#!/bin/sh +set -e + +echo "Installing prerequisites" + +export DEBIAN_FRONTEND=noninteractive + +apt-get update && apt-get upgrade -yq --no-install-recommends +apt-get install -yq --no-install-recommends ca-certificates curl bzip2 flex git gcc g++ cmake make libuv1-dev libzmq3-dev libsodium-dev libpgm-dev libnorm-dev libgss-dev libcurl4-openssl-dev libidn2-0-dev + +echo "Installing GCC 8.5.0" + +cd /root + +git clone --depth 1 --branch releases/gcc-8.5.0 --jobs $(nproc) git://gcc.gnu.org/git/gcc.git gcc-8 + +cd gcc-8 +contrib/download_prerequisites + +mkdir build && cd build +../configure --enable-languages=c,c++ --disable-multilib --disable-bootstrap --prefix=/usr/local/gcc-8 +make -j$(nproc) +make install + +echo "Installing GCC 9.5.0" + +cd /root + +git clone --depth 1 --branch releases/gcc-9.5.0 --jobs $(nproc) git://gcc.gnu.org/git/gcc.git gcc-9 + +cd gcc-9 +contrib/download_prerequisites + +mkdir build && cd build +../configure --enable-languages=c,c++ --disable-multilib --disable-bootstrap --prefix=/usr/local/gcc-9 +make -j$(nproc) +make install + +echo "Installing GCC 10.5.0" + +cd /root + +git clone --depth 1 --branch releases/gcc-10.5.0 --jobs $(nproc) git://gcc.gnu.org/git/gcc.git gcc-10 + +cd gcc-10 +contrib/download_prerequisites + +mkdir build && cd build +../configure --enable-languages=c,c++ --disable-multilib --disable-bootstrap --prefix=/usr/local/gcc-10 +make -j$(nproc) +make install + +echo "Installing GCC 11.5.0" + +cd /root + +git clone --depth 1 --branch releases/gcc-11.5.0 --jobs $(nproc) git://gcc.gnu.org/git/gcc.git gcc-11 + +cd gcc-11 +contrib/download_prerequisites + +mkdir build && cd build +../configure --enable-languages=c,c++ --disable-multilib --disable-bootstrap --prefix=/usr/local/gcc-11 +make -j$(nproc) +make install + +echo "Installing GCC 12.4.0" + +cd /root + +git clone --depth 1 --branch releases/gcc-12.4.0 --jobs $(nproc) git://gcc.gnu.org/git/gcc.git gcc-12 + +cd gcc-12 +contrib/download_prerequisites + +mkdir build && cd build +../configure --enable-languages=c,c++ --disable-multilib --disable-bootstrap --prefix=/usr/local/gcc-12 +make -j$(nproc) +make install + +echo "Installing GCC 13.4.0" + +cd /root + +git clone --depth 1 --branch releases/gcc-13.4.0 --jobs $(nproc) git://gcc.gnu.org/git/gcc.git gcc-13 + +cd gcc-13 +contrib/download_prerequisites + +mkdir build && cd build +../configure --enable-languages=c,c++ --disable-multilib --disable-bootstrap --prefix=/usr/local/gcc-13 +make -j$(nproc) +make install + +echo "Installing GCC 14.3.0" + +cd /root + +git clone --depth 1 --branch releases/gcc-14.3.0 --jobs $(nproc) git://gcc.gnu.org/git/gcc.git gcc-14 + +cd gcc-14 +contrib/download_prerequisites + +mkdir build && cd build +../configure --enable-languages=c,c++ --disable-multilib --disable-bootstrap --prefix=/usr/local/gcc-14 +make -j$(nproc) +make install + +echo "Installing GCC 15.1.0" + +cd /root + +git clone --depth 1 --branch releases/gcc-15.1.0 --jobs $(nproc) git://gcc.gnu.org/git/gcc.git gcc-15 + +cd gcc-15 +contrib/download_prerequisites + +mkdir build && cd build +../configure --enable-languages=c,c++ --disable-multilib --disable-bootstrap --prefix=/usr/local/gcc-15 +make -j$(nproc) +make install + +echo "Cloning the repository" + +cd / +git clone --recursive --jobs $(nproc) https://github.com/SChernykh/p2pool + +echo "Deleting temporary files" + +cd /root +rm -rf * + +echo "All done" diff --git a/scripts/release/build_all.sh b/scripts/release/build_all.sh index f86f097..b4c74b5 100755 --- a/scripts/release/build_all.sh +++ b/scripts/release/build_all.sh @@ -1,12 +1,6 @@ #!/bin/sh -# Example usage: -# -# git clone --recursive https://github.com/SChernykh/p2pool -# cd p2pool -# git checkout v4.9 -# release_scripts/build_all.sh v4.9 -# +# Example usage: release_scripts/build_all.sh v4.8.1 cd "$(dirname "$0")"