From 7d34ca4bb368e7a896416c5dd913fa1d48764e5a Mon Sep 17 00:00:00 2001 From: "Louise K. Schmidtgen" Date: Thu, 8 Aug 2024 13:33:04 +0200 Subject: [PATCH] Update dqlite and deps (#580) --- src/k8s/go.mod | 2 +- src/k8s/go.sum | 4 ++-- src/k8s/hack/dynamic-dqlite.sh | 35 ++++++---------------------------- src/k8s/hack/env.sh | 10 ++++------ src/k8s/hack/static-dqlite.sh | 35 ++++++---------------------------- 5 files changed, 19 insertions(+), 67 deletions(-) diff --git a/src/k8s/go.mod b/src/k8s/go.mod index ded79ea9e..1eaa1fe97 100644 --- a/src/k8s/go.mod +++ b/src/k8s/go.mod @@ -3,7 +3,7 @@ module github.com/canonical/k8s go 1.22.5 require ( - github.com/canonical/go-dqlite v1.21.0 + github.com/canonical/go-dqlite v1.22.0 github.com/canonical/lxd v0.0.0-20240709081608-9df996e36bac github.com/canonical/microcluster v0.0.0-20240725000112-da36ecbd845e github.com/go-logr/logr v1.4.2 diff --git a/src/k8s/go.sum b/src/k8s/go.sum index 8bba835e0..f02720c45 100644 --- a/src/k8s/go.sum +++ b/src/k8s/go.sum @@ -95,8 +95,8 @@ github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b h1:otBG+dV+YK+Soembj github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0 h1:nvj0OLI3YqYXer/kZD8Ri1aaunCxIEsOst1BVJswV0o= github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= -github.com/canonical/go-dqlite v1.21.0 h1:4gLDdV2GF+vg0yv9Ff+mfZZNQ1JGhnQ3GnS2GeZPHfA= -github.com/canonical/go-dqlite v1.21.0/go.mod h1:Uvy943N8R4CFUAs59A1NVaziWY9nJ686lScY7ywurfg= +github.com/canonical/go-dqlite v1.22.0 h1:DuJmfcREl4gkQJyvZzjl2GHFZROhbPyfdjDRQXpkOyw= +github.com/canonical/go-dqlite v1.22.0/go.mod h1:Uvy943N8R4CFUAs59A1NVaziWY9nJ686lScY7ywurfg= github.com/canonical/lxd v0.0.0-20240709081608-9df996e36bac h1:WqXeS0uyAAmFB9aflCucb/pPZzIdivO9uG4tWw7CEAw= github.com/canonical/lxd v0.0.0-20240709081608-9df996e36bac/go.mod h1:S2MXobHv9Wh6cpr3biLo2Kq0vqK2/PxpFuE/8ZsNDic= github.com/canonical/microcluster v0.0.0-20240725000112-da36ecbd845e h1:a/YDYYSWFO/Z1AJAKnfkVLBunLLSauuCBRU23Jzd/Do= diff --git a/src/k8s/hack/dynamic-dqlite.sh b/src/k8s/hack/dynamic-dqlite.sh index 0758298a7..bca84e71e 100755 --- a/src/k8s/hack/dynamic-dqlite.sh +++ b/src/k8s/hack/dynamic-dqlite.sh @@ -70,27 +70,6 @@ if [ ! -f "${BUILD_DIR}/lz4/lib/liblz4.a" ] || [ ! -f "${BUILD_DIR}/lz4/lib/libl ) fi -# build raft -if [ ! -f "${BUILD_DIR}/raft/libraft.la" ]; then - ( - cd "${BUILD_DIR}" - rm -rf raft - git clone "${REPO_RAFT}" --depth 1 --branch "${TAG_RAFT}" > /dev/null - cd raft - autoreconf -i > /dev/null - ./configure \ - CFLAGS="-I${BUILD_DIR}/libuv/include -I${BUILD_DIR}/lz4/lib" \ - LDFLAGS="-L${BUILD_DIR}/libuv/.libs -L${BUILD_DIR}/lz4/lib" \ - UV_CFLAGS="-I${BUILD_DIR}/libuv/include" \ - UV_LIBS="-L${BUILD_DIR}/libuv/.libs" \ - LZ4_CFLAGS="-I${BUILD_DIR}/lz4/lib" \ - LZ4_LIBS="-L${BUILD_DIR}/lz4/lib" \ - > /dev/null - - make -j > /dev/null - ) -fi - # build sqlite3 if [ ! -f "${BUILD_DIR}/sqlite/libsqlite3.la" ]; then ( @@ -112,14 +91,14 @@ if [ ! -f "${BUILD_DIR}/dqlite/libdqlite.la" ]; then git clone "${REPO_DQLITE}" --depth 1 --branch "${TAG_DQLITE}" > /dev/null cd dqlite autoreconf -i > /dev/null - ./configure \ - CFLAGS="-I${BUILD_DIR}/raft/include -I${BUILD_DIR}/sqlite -I${BUILD_DIR}/libuv/include -I${BUILD_DIR}/lz4/lib -Werror=implicit-function-declaration" \ - LDFLAGS="-L${BUILD_DIR}/raft/.libs -L${BUILD_DIR}/libuv/.libs -L${BUILD_DIR}/lz4/lib -L${BUILD_DIR}/libnsl/src" \ - RAFT_CFLAGS="-I${BUILD_DIR}/raft/include" \ - RAFT_LIBS="-L${BUILD_DIR}/raft/.libs" \ + ./configure --enable-build-raft \ + CFLAGS="-I${BUILD_DIR}/sqlite -I${BUILD_DIR}/libuv/include -I${BUILD_DIR}/lz4/lib -Werror=implicit-function-declaration" \ + LDFLAGS=" -L${BUILD_DIR}/libuv/.libs -L${BUILD_DIR}/lz4/lib -L${BUILD_DIR}/libnsl/src" \ UV_CFLAGS="-I${BUILD_DIR}/libuv/include" \ UV_LIBS="-L${BUILD_DIR}/libuv/.libs" \ SQLITE_CFLAGS="-I${BUILD_DIR}/sqlite" \ + LZ4_CFLAGS="-I${BUILD_DIR}/lz4/lib" \ + LZ4_LIBS="-L${BUILD_DIR}/lz4/lib" \ > /dev/null make -j > /dev/null @@ -131,7 +110,6 @@ fi cd "${BUILD_DIR}" cp libuv/.libs/* "${INSTALL_DIR}/lib" cp lz4/lib/*.so* "${INSTALL_DIR}/lib" - cp raft/.libs/* "${INSTALL_DIR}/lib" cp sqlite/.libs/* "${INSTALL_DIR}/lib" cp dqlite/.libs/* "${INSTALL_DIR}/lib" ) @@ -140,13 +118,12 @@ fi ( cd "${BUILD_DIR}" cp -r libuv/include/* "${INSTALL_DIR}/include" - cp -r raft/include/* "${INSTALL_DIR}/include" cp -r sqlite/*.h "${INSTALL_DIR}/include" cp -r dqlite/include/* "${INSTALL_DIR}/include" ) export CGO_CFLAGS="-I${INSTALL_DIR}/include" -export CGO_LDFLAGS="-L${INSTALL_DIR}/lib -ldqlite -lraft -luv -llz4 -lsqlite3" +export CGO_LDFLAGS="-L${INSTALL_DIR}/lib -ldqlite -luv -llz4 -lsqlite3 -Wl,-z,stack-size=1048576" export LD_LIBRARY_PATH="${INSTALL_DIR}/lib" echo "Libraries are in '${INSTALL_DIR}/lib'" diff --git a/src/k8s/hack/env.sh b/src/k8s/hack/env.sh index 97b023a17..66af208c7 100755 --- a/src/k8s/hack/env.sh +++ b/src/k8s/hack/env.sh @@ -6,16 +6,14 @@ REPO_LIBTIRPC="https://salsa.debian.org/debian/libtirpc.git" REPO_LIBNSL="https://github.com/thkukuk/libnsl.git" REPO_LIBUV="https://github.com/libuv/libuv.git" REPO_LIBLZ4="https://github.com/lz4/lz4.git" -REPO_RAFT="https://github.com/canonical/raft.git" REPO_SQLITE="https://github.com/sqlite/sqlite.git" REPO_DQLITE="https://github.com/canonical/dqlite.git" ## Component versions -TAG_MUSL="v1.2.3" +TAG_MUSL="v1.2.4" TAG_LIBTIRPC="upstream/1.3.3" -TAG_LIBNSL="v2.0.0" +TAG_LIBNSL="v2.0.1" TAG_LIBUV="v1.48.0" TAG_LIBLZ4="v1.9.4" -TAG_RAFT="v0.18.0" -TAG_SQLITE="version-3.40.0" -TAG_DQLITE="v1.15.1" +TAG_SQLITE="version-3.45.1" +TAG_DQLITE="v1.16.7" diff --git a/src/k8s/hack/static-dqlite.sh b/src/k8s/hack/static-dqlite.sh index a1dcf122e..65583a696 100755 --- a/src/k8s/hack/static-dqlite.sh +++ b/src/k8s/hack/static-dqlite.sh @@ -100,27 +100,6 @@ if [ ! -f "${BUILD_DIR}/lz4/lib/liblz4.a" ] || [ ! -f "${BUILD_DIR}/lz4/lib/libl ) fi -# build raft -if [ ! -f "${BUILD_DIR}/raft/libraft.la" ]; then - ( - cd "${BUILD_DIR}" - rm -rf raft - git clone "${REPO_RAFT}" --depth 1 --branch "${TAG_RAFT}" > /dev/null - cd raft - autoreconf -i > /dev/null - ./configure --disable-shared \ - CFLAGS="${CFLAGS} -I${BUILD_DIR}/libuv/include -I${BUILD_DIR}/lz4/lib" \ - LDFLAGS="${LDFLAGS} -L${BUILD_DIR}/libuv/.libs -L${BUILD_DIR}/lz4/lib" \ - UV_CFLAGS="-I${BUILD_DIR}/libuv/include" \ - UV_LIBS="-L${BUILD_DIR}/libuv/.libs" \ - LZ4_CFLAGS="-I${BUILD_DIR}/lz4/lib" \ - LZ4_LIBS="-L${BUILD_DIR}/lz4/lib" \ - > /dev/null - - make -j > /dev/null - ) -fi - # build sqlite3 if [ ! -f "${BUILD_DIR}/sqlite/libsqlite3.la" ]; then ( @@ -143,14 +122,14 @@ if [ ! -f "${BUILD_DIR}/dqlite/libdqlite.la" ]; then git clone "${REPO_DQLITE}" --depth 1 --branch "${TAG_DQLITE}" > /dev/null cd dqlite autoreconf -i > /dev/null - ./configure --disable-shared \ - CFLAGS="${CFLAGS} -I${BUILD_DIR}/raft/include -I${BUILD_DIR}/sqlite -I${BUILD_DIR}/libuv/include -I${BUILD_DIR}/lz4/lib -I${INSTALL_DIR}/musl/include -Werror=implicit-function-declaration" \ - LDFLAGS="${LDFLAGS} -L${BUILD_DIR}/raft/.libs -L${BUILD_DIR}/libuv/.libs -L${BUILD_DIR}/lz4/lib -L${BUILD_DIR}/libnsl/src" \ - RAFT_CFLAGS="-I${BUILD_DIR}/raft/include" \ - RAFT_LIBS="-L${BUILD_DIR}/raft/.libs" \ + ./configure --disable-shared --enable-build-raft \ + CFLAGS="${CFLAGS} -I${BUILD_DIR}/sqlite -I${BUILD_DIR}/libuv/include -I${BUILD_DIR}/lz4/lib -I${INSTALL_DIR}/musl/include -Werror=implicit-function-declaration" \ + LDFLAGS="${LDFLAGS} -L${BUILD_DIR}/libuv/.libs -L${BUILD_DIR}/lz4/lib -L${BUILD_DIR}/libnsl/src" \ UV_CFLAGS="-I${BUILD_DIR}/libuv/include" \ UV_LIBS="-L${BUILD_DIR}/libuv/.libs" \ SQLITE_CFLAGS="-I${BUILD_DIR}/sqlite" \ + LZ4_CFLAGS="-I${BUILD_DIR}/lz4/lib" \ + LZ4_LIBS="-L${BUILD_DIR}/lz4/lib" \ > /dev/null make -j > /dev/null @@ -163,7 +142,6 @@ fi cp libuv/.libs/* "${INSTALL_DIR}/lib" cp lz4/lib/*.a "${INSTALL_DIR}/lib" cp lz4/lib/*.so* "${INSTALL_DIR}/lib" - cp raft/.libs/*.a "${INSTALL_DIR}/lib" cp sqlite/.libs/*.a "${INSTALL_DIR}/lib" cp dqlite/.libs/*.a "${INSTALL_DIR}/lib" ) @@ -172,10 +150,9 @@ fi ( cd "${BUILD_DIR}" cp -r libuv/include/* "${INSTALL_DIR}/include" - cp -r raft/include/* "${INSTALL_DIR}/include" cp -r sqlite/*.h "${INSTALL_DIR}/include" cp -r dqlite/include/* "${INSTALL_DIR}/include" ) export CGO_CFLAGS="-I${INSTALL_DIR}/include" -export CGO_LDFLAGS="-L${INSTALL_DIR}/lib -luv -lraft -ldqlite -llz4 -lsqlite3" +export CGO_LDFLAGS="-L${INSTALL_DIR}/lib -luv -ldqlite -llz4 -lsqlite3 -Wl,-z,stack-size=1048576"