Files
xahaud/build-full.sh
Wietse Wind b0343d0509 Add full & partial release build
commit 2349db5aa9deec436d97169cd5ae58bc57f28093
Author: Wietse Wind <mail@wietse.com>
Date:   Tue Jan 31 13:37:58 2023 +0100

    Semver

commit 2969e6c31561be28fbb0979f21a61305ccb49be9
Author: Wietse Wind <mail@wietse.com>
Date:   Tue Jan 31 13:11:49 2023 +0100

    Small build works (?)

commit 3241f147c3dbbbf29d2a5c364b64bf42c0419450
Author: Wietse Wind <mail@wietse.com>
Date:   Tue Jan 31 13:01:32 2023 +0100

    Semver

commit 411f5c9c5042da16685d069cabe8318c239cf888
Author: Wietse Wind <mail@wietse.com>
Date:   Tue Jan 31 12:25:38 2023 +0100

    Start on path, need more info

commit 8ea7819bf7648cd81c434ff3b4826dd410047718
Author: Wietse Wind <mail@wietse.com>
Date:   Tue Jan 31 12:09:05 2023 +0100

    Change build, timestamp, branch, runner

commit 1579e540ff77b0517090a1ac7e32cd277f986d1e
Author: Richard Holland <richard.holland@starstone.co.nz>
Date:   Tue Jan 31 10:44:19 2023 +0000

    Change version string to 0.0.0 ahead of build numbers from GHActions

commit 1e78245e201bdeb1b238f23b6821da2ce8f3f171
Author: Wietse Wind <mail@wietse.com>
Date:   Tue Jan 31 11:39:26 2023 +0100

    Change compiler toolset

commit 47910f553ff5e4fe4ee90143ff097ac2e49ad281
Author: Wietse Wind <mail@wietse.com>
Date:   Tue Jan 31 11:35:17 2023 +0100

    Add docker unit tests

commit 7df50898d9dc8245fa766de74de0d4c85cf0259b
Author: Wietse Wind <mail@wietse.com>
Date:   Tue Jan 31 10:40:14 2023 +0100

    BUild full on new container

commit 174135fba27bbbf66d2b13c061851c47a9acb047
Author: Wietse Wind <mail@wietse.com>
Date:   Tue Jan 31 10:39:13 2023 +0100

    No full build on action runner

commit 96c7fe1f3e366a2eef9261d7f56b7889b1385daf
Author: Wietse Wind <mail@wietse.com>
Date:   Tue Jan 31 10:32:11 2023 +0100

    Fix auto clean

commit 2f7d707a6149181a7576cfab426e479c56713e97
Author: Wietse Wind <mail@wietse.com>
Date:   Tue Jan 31 10:25:39 2023 +0100

    clean container on GH action full build

commit 1b12c99b88ed253639826dc644af8d9b7fb16f72
Author: Wietse Wind <mail@wietse.com>
Date:   Tue Jan 31 10:25:02 2023 +0100

    Wrong logic

commit d0a08c27367ec7680a29e7ae2e0c64e1fa3866c4
Author: Wietse Wind <mail@wietse.com>
Date:   Tue Jan 31 10:23:17 2023 +0100

    Try to fix fast build

commit 1e2093821282aca904682942387645dabdc0dc1c
Author: Wietse Wind <mail@wietse.com>
Date:   Tue Jan 31 09:55:11 2023 +0100

    Persistent container

commit 68d9b4cf1c6e30c17a38e7259d71c642f3b7cd11
Author: Wietse Wind <mail@wietse.com>
Date:   Tue Jan 31 09:53:59 2023 +0100

    Persistent container

commit 651d5dec8aa4ab7cb4971861fbc67b9a3dc27313
Author: Wietse Wind <mail@wietse.com>
Date:   Tue Jan 31 09:46:32 2023 +0100

    Cached builder, unit tests

commit 50f7a901543faf34361b3d5d24826bad0dbb3b49
Author: Wietse Wind <mail@wietse.com>
Date:   Tue Jan 31 09:31:35 2023 +0100

    Add build cores

commit 841bf1c4fc0f432e35393f4bd393a772cc7f9ebc
Author: Wietse Wind <mail@wietse.com>
Date:   Tue Jan 31 09:26:07 2023 +0100

    Testing runner sh code
2023-01-31 13:39:42 +01:00

152 lines
5.7 KiB
Bash
Executable File

#!/bin/bash
echo "START INSIDE CONTAINER - FULL"
echo "-- BUILD CORES: $3"
echo "-- GITHUB_REPOSITORY: $1"
echo "-- GITHUB_SHA: $2"
echo "-- GITHUB_RUN_NUMBER: $4"
umask 0000;
cd /io;
mkdir src/certs;
curl --silent -k https://raw.githubusercontent.com/RichardAH/rippled-release-builder/main/ca-bundle/certbundle.h -o src/certs/certbundle.h;
if [ "`grep certbundle.h src/ripple/net/impl/RegisterSSLCerts.cpp | wc -l`" -eq "0" ]
then
cp src/ripple/net/impl/RegisterSSLCerts.cpp src/ripple/net/impl/RegisterSSLCerts.cpp.old
perl -i -pe "s/^{/{
#ifdef EMBEDDED_CA_BUNDLE
BIO *cbio = BIO_new_mem_buf(ca_bundle.data(), ca_bundle.size());
X509_STORE *cts = SSL_CTX_get_cert_store(ctx.native_handle());
if(!cts || !cbio)
JLOG(j.warn())
<< \"Failed to create cts\/cbio when loading embedded certs.\";
else
{
X509_INFO *itmp;
int i, count = 0, type = X509_FILETYPE_PEM;
STACK_OF(X509_INFO) *inf = PEM_X509_INFO_read_bio(cbio, NULL, NULL, NULL);
if (!inf)
{
BIO_free(cbio);
JLOG(j.warn())
<< \"Failed to read cbio when loading embedded certs.\";
}
else
{
for (i = 0; i < sk_X509_INFO_num(inf); i++)
{
itmp = sk_X509_INFO_value(inf, i);
if (itmp->x509)
{
X509_STORE_add_cert(cts, itmp->x509);
count++;
}
if (itmp->crl)
{
X509_STORE_add_crl(cts, itmp->crl);
count++;
}
}
sk_X509_INFO_pop_free(inf, X509_INFO_free);
BIO_free(cbio);
}
}
#endif/g" src/ripple/net/impl/RegisterSSLCerts.cpp &&
sed -i "s/#include <ripple\/net\/RegisterSSLCerts.h>/\0\n#include <certs\/certbundle.h>/g" src/ripple/net/impl/RegisterSSLCerts.cpp
fi
mkdir .nih_c;
mkdir .nih_toolchain;
cd .nih_toolchain &&
yum install -y wget lz4 lz4-devel git llvm13-static.x86_64 llvm13-devel.x86_64 devtoolset-10-binutils zlib-static ncurses-static -y \
devtoolset-7-gcc-c++ \
devtoolset-9-gcc-c++ \
devtoolset-10-gcc-c++ \
snappy snappy-devel \
zlib zlib-devel \
lz4-devel \
libasan &&
export PATH=`echo $PATH | sed -E "s/devtoolset-9/devtoolset-7/g"` &&
echo "-- Install ZStd 1.1.3 --" &&
yum install epel-release -y &&
ZSTD_VERSION="1.1.3" &&
( wget -nc -q -O zstd-${ZSTD_VERSION}.tar.gz https://github.com/facebook/zstd/archive/v${ZSTD_VERSION}.tar.gz; echo "" ) &&
tar xzvf zstd-${ZSTD_VERSION}.tar.gz &&
cd zstd-${ZSTD_VERSION} &&
make -j$3 install &&
cd .. &&
echo "-- Install Cmake 3.23.1 --" &&
pwd &&
( wget -nc -q https://github.com/Kitware/CMake/releases/download/v3.23.1/cmake-3.23.1-linux-x86_64.tar.gz; echo "" ) &&
tar -xzf cmake-3.23.1-linux-x86_64.tar.gz -C /hbb/ &&
echo "-- Install Boost 1.75.0 --" &&
pwd &&
( wget -nc -q https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.gz; echo "" ) &&
tar -xzf boost_1_75_0.tar.gz &&
cd boost_1_75_0 && ./bootstrap.sh && ./b2 link=static -j$3 && ./b2 install &&
cd ../ &&
echo "-- Install Protobuf 3.20.0 --" &&
pwd &&
( wget -nc -q https://github.com/protocolbuffers/protobuf/releases/download/v3.20.0/protobuf-all-3.20.0.tar.gz; echo "" ) &&
tar -xzf protobuf-all-3.20.0.tar.gz &&
cd protobuf-3.20.0/ &&
./autogen.sh && ./configure --prefix=/usr --disable-shared link=static && make -j$3 && make install &&
cd .. &&
echo "-- Build LLD --" &&
pwd &&
ln /usr/bin/llvm-config-13 /usr/bin/llvm-config &&
mv /opt/rh/devtoolset-9/root/usr/bin/ar /opt/rh/devtoolset-9/root/usr/bin/ar-9 &&
ln /opt/rh/devtoolset-10/root/usr/bin/ar /opt/rh/devtoolset-9/root/usr/bin/ar &&
( wget -nc -q https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.1/lld-13.0.1.src.tar.xz; echo "" ) &&
( wget -nc -q https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.1/libunwind-13.0.1.src.tar.xz; echo "" ) &&
tar -xf lld-13.0.1.src.tar.xz &&
tar -xf libunwind-13.0.1.src.tar.xz &&
cp -r libunwind-13.0.1.src/include libunwind-13.0.1.src/src lld-13.0.1.src/ &&
cd lld-13.0.1.src &&
rm -rf build CMakeCache.txt &&
mkdir build &&
cd build &&
cmake .. -DLLVM_LIBRARY_DIR=/usr/lib64/llvm13/lib/ -DCMAKE_INSTALL_PREFIX=/usr/lib64/llvm13/ -DCMAKE_BUILD_TYPE=Release &&
make -j$3 install &&
ln -s /usr/lib64/llvm13/lib/include/lld /usr/include/lld &&
cp /usr/lib64/llvm13/lib/liblld*.a /usr/local/lib/ &&
cd ../../ &&
echo "-- Build WasmEdge --" &&
( wget -nc -q https://github.com/WasmEdge/WasmEdge/archive/refs/tags/0.11.2.zip; unzip -o 0.11.2.zip; ) &&
cd WasmEdge-0.11.2 &&
( mkdir build; echo "" ) &&
cd build &&
export BOOST_ROOT="/usr/local/src/boost_1_75_0" &&
export Boost_LIBRARY_DIRS="/usr/local/lib" &&
export BOOST_INCLUDEDIR="/usr/local/src/boost_1_75_0" &&
export PATH=`echo $PATH | sed -E "s/devtoolset-7/devtoolset-9/g"` &&
cmake .. \
-DWASMEDGE_BUILD_SHARED_LIB=OFF \
-DWASMEDGE_BUILD_STATIC_LIB=ON \
-DWASMEDGE_BUILD_AOT_RUNTIME=ON \
-DWASMEDGE_FORCE_DISABLE_LTO=ON \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DWASMEDGE_LINK_LLVM_STATIC=ON \
-DWASMEDGE_BUILD_PLUGINS=OFF \
-DWASMEDGE_LINK_TOOLS_STATIC=ON \
-DBoost_NO_BOOST_CMAKE=ON -DLLVM_DIR=/usr/lib64/llvm13/lib/cmake/llvm/ -DLLVM_LIBRARY_DIR=/usr/lib64/llvm13/lib/ &&
make -j$3 install &&
export PATH=`echo $PATH | sed -E "s/devtoolset-9/devtoolset-10/g"` &&
cp -r include/api/wasmedge /usr/include/ &&
cd /io/ &&
echo "-- Build Rippled --" &&
pwd &&
cp Builds/CMake/deps/Rocksdb.cmake Builds/CMake/deps/Rocksdb.cmake.old &&
echo "MOVING TO [ build-core.sh ]"
cd /io;
./build-core.sh "$1" "$2" "$3" "$4"
echo "END [ build-core.sh ]"
echo "END INSIDE CONTAINER - FULL"
echo "-- Built with env vars:"
printenv