From 1dc45ba120efefe9b31dd79e69a063d31186e2f0 Mon Sep 17 00:00:00 2001 From: Cole Miller Date: Thu, 29 Aug 2024 20:39:25 -0400 Subject: [PATCH] Fix the build when liblz4 is missing and test it Signed-off-by: Cole Miller --- .github/workflows/nolz4.yaml | 39 ++++++++++++++++++++++++++++++++++++ configure.ac | 2 +- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/nolz4.yaml diff --git a/.github/workflows/nolz4.yaml b/.github/workflows/nolz4.yaml new file mode 100644 index 000000000..40f8f2f71 --- /dev/null +++ b/.github/workflows/nolz4.yaml @@ -0,0 +1,39 @@ +name: CI Tests (no liblz4) + +on: + - push + - pull_request + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up dependencies + run: | + sudo apt update + sudo apt install -y libsqlite3-dev libuv1-dev + sudo apt remove -y liblz4-dev + + - name: Build dqlite (liblz4 not present) + run: | + autoreconf -i + ./configure --enable-build-raft + make -j$(nproc) + make clean + + - name: Build dqlite (liblz4 requested and not present) + run: | + autoreconf -i + ! ./configure --enable-build-raft --with-lz4 + - name: Install liblz4 + run: | + sudo apt install liblz4-dev + + - name: Build dqlite (liblz4 present but ignored) + run: | + ./configure --enable-build-raft --without-lz4 + make -j$(nproc) + ! ldd .libs/libdqlite.so | grep lz4 diff --git a/configure.ac b/configure.ac index 6bc4afebc..1d7839441 100644 --- a/configure.ac +++ b/configure.ac @@ -70,7 +70,7 @@ AS_IF([test "x$enable_build_raft" = "xyes"], [AS_IF([test "x$with_lz4" != "xno"], [PKG_CHECK_MODULES(LZ4, [liblz4 >= 1.7.1], [have_lz4=yes], [have_lz4=no])], [have_lz4=no]) - AS_IF([test "x$with_lz4" != "xno" -a "x$have_lz4" = "xno"], + AS_IF([test "x$with_lz4" = "xyes" -a "x$have_lz4" = "xno"], [AC_MSG_ERROR([liblz4 required but not found])], [])], # Not building raft