From 6f70cd545f638947b64eb0693db7669ff5413070 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 9 Dec 2024 09:52:58 +0100 Subject: [PATCH 1/4] Update ftl-build container to v3.21 Signed-off-by: DL6ER --- ftl-build/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ftl-build/Dockerfile b/ftl-build/Dockerfile index 358c2bc..9ad2e58 100644 --- a/ftl-build/Dockerfile +++ b/ftl-build/Dockerfile @@ -1,4 +1,4 @@ -ARG CONTAINER="alpine:latest" +ARG CONTAINER="alpine:3.21" FROM ${CONTAINER} AS builder ARG TARGETPLATFORM From 648dbba23467fe8ace4db8fcfb33fe0f46ac37c7 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 9 Dec 2024 10:11:45 +0100 Subject: [PATCH 2/4] As of Alpine 3.21 (Dec 2024), we need to patch the termcap library to include the standard headers as well as unistd.h for the write function Signed-off-by: DL6ER --- ftl-build/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ftl-build/Dockerfile b/ftl-build/Dockerfile index 9ad2e58..4d8f7c5 100644 --- a/ftl-build/Dockerfile +++ b/ftl-build/Dockerfile @@ -45,9 +45,12 @@ RUN apk add --no-cache \ ENV STATIC true ENV TEST true +# As of Alpine 3.21 (Dec 2024), we need to patch the termcap library to include +# the standard headers as well as unistd.h for the write function RUN curl -sSL https://ftl.pi-hole.net/libraries/termcap-${termcapversion}.tar.gz | tar -xz \ && cd termcap-${termcapversion} \ && ./configure --enable-static --disable-shared --disable-doc --without-examples \ + && sed -i '1i #define STDC_HEADERS 1\n#include ' termcap.c tparam.c \ && make -j $(nproc) \ && make install \ && ls /usr/local/lib/ \ From b0a478cd5cf490e61fdcde3b332685e68ea47afd Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 9 Dec 2024 10:54:49 +0100 Subject: [PATCH 3/4] Ensure that the TERM environment variable is set. Otherwise, the tests will fail with tput: No value for $TERM and no -T specified Signed-off-by: DL6ER --- ftl-build/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ftl-build/Dockerfile b/ftl-build/Dockerfile index 4d8f7c5..d046832 100644 --- a/ftl-build/Dockerfile +++ b/ftl-build/Dockerfile @@ -112,6 +112,9 @@ ARG CI_ARCH="$TARGETPLATFORM" ARG GIT_TAG="test-build" ARG GIT_BRANCH="special/CI_development" +# Ensure that the TERM environment variable is set +ENV TERM=${TERM:-xterm} + # Test compile FTL's development branch, the result is removed from the final container # Run the full test suite to ensure that the container is still capable of running the tests RUN git clone https://github.com/pi-hole/FTL.git --branch "${GIT_BRANCH}" \ From 32f60048d5053ba266afb1472919a33a4669fa55 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 9 Dec 2024 18:43:44 +0100 Subject: [PATCH 4/4] Apply https://github.com/pi-hole/FTL/commit/75f11f3f4fe97c685f2ac6e5f573b4edde9bfbd9 also here Signed-off-by: DL6ER --- ftl-build/Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ftl-build/Dockerfile b/ftl-build/Dockerfile index d046832..2825c1f 100644 --- a/ftl-build/Dockerfile +++ b/ftl-build/Dockerfile @@ -115,6 +115,11 @@ ARG GIT_BRANCH="special/CI_development" # Ensure that the TERM environment variable is set ENV TERM=${TERM:-xterm} +# Monkeypatch BATS to remove duplicate output of starting and finished test +# BATS uses ANSI escape codes to overwrite the line after the test has finished +# This is not supported by Github Actions as it does not provide a TTY to the docker build container +RUN sed -i '/buffer_with_truncation /d' /bats-core/libexec/bats-core/bats-format-pretty + # Test compile FTL's development branch, the result is removed from the final container # Run the full test suite to ensure that the container is still capable of running the tests RUN git clone https://github.com/pi-hole/FTL.git --branch "${GIT_BRANCH}" \