Skip to content

Commit

Permalink
GHA: Fix Alpine LibreSSL
Browse files Browse the repository at this point in the history
First, the icinga_legacytimeperiod/dst test was excluded, as it fails on
Alpine most likely due to some differences between musl and glibc. After
some debugging, I disabled the test as the Alpine packages does.

More build dependencies were added from the Alpine package, allowing to
only disable MySQL and PostgreSQL support as these libraries have fixed
dependencies on OpenSSL, conflicting with LibreSSL.

In addition, I have added comments where I was first puzzled.
  • Loading branch information
oxzi committed Jan 10, 2025
1 parent 1a57508 commit 366ed45
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/alpine-bash.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# This Dockerfile is used in the linux job for Alpine Linux.
#
# As the linux.bash script is, in fact, a bash script and Alpine does not ship
# a bash by default, the "alpine:bash" container will be built using this
# Dockerfile in the GitHub Action.

FROM alpine:3
RUN ["apk", "--no-cache", "add", "bash"]
14 changes: 12 additions & 2 deletions .github/workflows/linux.bash
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,19 @@ CMAKE_OPTS=''

case "$DISTRO" in
alpine:*)
apk add bison {boost,libressl}-dev ccache cmake flex g++ ninja-build tzdata
# Packages inspired by the Alpine package, just
# - LibreSSL instead of OpenSSL 3 and
# - no MariaDB or libpq as they depend on OpenSSL.
# https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/community/icinga2/APKBUILD
apk add bison boost-dev ccache cmake flex g++ libedit-dev libressl-dev ninja-build tzdata
ln -vs /usr/lib/ninja-build/bin/ninja /usr/local/bin/ninja
CMAKE_OPTS="-DUSE_SYSTEMD=OFF $(echo -DICINGA2_WITH_{MYSQL,PGSQL,COMPAT,LIVESTATUS,PERFDATA,ICINGADB}=OFF)"

CMAKE_OPTS="-DUSE_SYSTEMD=OFF -DICINGA2_WITH_MYSQL=OFF -DICINGA2_WITH_PGSQL=OFF"

# This test fails due to some glibc/musl mismatch regarding timezone PST/PDT.
# - https://www.openwall.com/lists/musl/2024/03/05/2
# - https://gitlab.alpinelinux.org/alpine/aports/-/blob/b3ea02e2251451f9511086e1970f21eb640097f7/community/icinga2/disable-failing-tests.patch
sed -i '/icinga_legacytimeperiod\/dst$/d' /icinga2/test/CMakeLists.txt
;;

amazonlinux:2)
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ jobs:
max-parallel: 2
matrix:
distro:
- alpine:bash # LibreSSL, used on OpenBSD
# Alpine Linux to build Icinga 2 with LibreSSL, OpenBSD's default.
# The "alpine:bash" image will be built below based on "alpine:3".
- alpine:bash

- amazonlinux:2
- amazonlinux:2023

Expand Down Expand Up @@ -60,7 +63,7 @@ jobs:
path: ccache
key: ccache/${{ matrix.distro }}

- name: Build Docker image
- name: Build Alpine Docker Image
if: "matrix.distro == 'alpine:bash'"
run: >-
docker build --file .github/workflows/alpine-bash.Dockerfile
Expand Down

0 comments on commit 366ed45

Please sign in to comment.