Skip to content

Commit

Permalink
Add animal to build with meson
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgangwalther committed Mar 23, 2024
1 parent f8b6d9b commit 68d7c62
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 8 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ jobs:
strategy:
fail-fast: false
matrix:
builder:
- autoconf
- meson
branch:
- REL_12_STABLE
- REL_13_STABLE
- REL_14_STABLE
- REL_15_STABLE
- REL_16_STABLE
- HEAD
name: ${{ matrix.branch }}
name: ${{ matrix.branch }} (${{ matrix.builder }})
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Docker Buildx
Expand All @@ -36,7 +39,7 @@ jobs:
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: buildroot
key: run-alpine-autoconf-${{ matrix.branch }}
key: run-alpine-${{ matrix.builder }}-${{ matrix.branch }}
- name: Run buildfarm client
run: |
mkdir -p buildroot
Expand All @@ -45,7 +48,7 @@ jobs:
-u "$(id -u):$(id -g)" \
buildfarm-client:alpine \
--test \
--config autoconf.conf \
--config ${{ matrix.builder }}.conf \
--delay-check \
${{ matrix.branch }}
# TODO: Remove --delay-check once this is fixed:
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ on:
jobs:
test:
runs-on: ubuntu-latest
name: Test autoconf
strategy:
fail-fast: false
matrix:
builder:
- autoconf
- meson
name: Test ${{ matrix.builder }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Docker Buildx
Expand All @@ -26,16 +32,16 @@ jobs:
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: buildroot
key: test-alpine-autoconf
- name: Test autoconf.conf
key: test-alpine-${{ matrix.builder }}
- name: Test ${{ matrix.builder }}.conf
run: |
mkdir -p buildroot
docker run --rm \
-v ./buildroot:/home/alpine \
-u "$(id -u):$(id -g)" \
buildfarm-client:alpine \
--test \
--config autoconf.conf \
--config ${{ matrix.builder }}.conf \
--delay-check
# TODO: Remove --delay-check once this is fixed:
# https://www.postgresql.org/message-id/flat/fddd1cd6-dc16-40a2-9eb5-d7fef2101488%40technowledgy.de
23 changes: 22 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ RUN apk add \
libxslt-dev \
linux-headers \
linux-pam-dev \
lz4-dev \
meson \
ninja \
nss_wrapper \
openldap-dev \
openssl-dev \
Expand All @@ -27,13 +30,31 @@ RUN apk add \
python3-dev \
readline-dev \
tcl-dev \
zlib-dev
zlib-dev \
zstd-dev

# renovate: datasource=github-tags depName=buildfarm-client lookupName=PGBuildFarm/client-code versioning=redhat extractVersion=REL_(?<version>.*)
ARG BUILDFARM_CLIENT_VERSION=REL_17

RUN git clone --depth 1 --branch ${BUILDFARM_CLIENT_VERSION} https://github.com/PGBuildFarm/client-code /usr/src

WORKDIR /usr/src

# TODO: Upstream this patch to PGBuildFarm/client-code
RUN git apply - <<EOF
--- a/run_build.pl
+++ b/run_build.pl
@@ -1620,7 +1620,7 @@ sub _meson_env
# these should be safe to appear on the log and could be required
# for running tests
my @safe_set = qw(
- PATH
+ PATH LD_PRELOAD NSS_WRAPPER_PASSWD NSS_WRAPPER_GROUP
PGUSER PGHOST PG_TEST_PORT_DIR PG_TEST_EXTRA
PG_TEST_USE_UNIX_SOCKETS PG_REGRESS_SOCK_DIR
SystemRoot TEMP TMP MSYS
EOF

COPY docker-entrypoint.sh /
COPY *.conf /usr/src

Expand Down
27 changes: 27 additions & 0 deletions meson.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
require 'shared.conf';

@PGBuild::conf{animal} = $ENV{MESON_ANIMAL} // @PGBuild::conf{animal};
@PGBuild::conf{secret} = $ENV{MESON_SECRET} // @PGBuild::conf{secret};

@PGBuild::conf{using_meson} = true;
@PGBuild::conf{meson_jobs} = 2;

push(@{@PGBuild::conf{meson_opts}}, (
'-Dlz4=enabled',
'-Dpam=enabled',
'-Duuid=ossp',
'-Dzstd=enabled'
));

# TODO: Building with --enable-nls currently fails with:
# ld: ../../src/port/libpgport.a(strerror.o): in function `pg_strerror_r':
# src/port/strerror.c:72:(.text+0x260): undefined reference to `libintl_gettext'
# ld: src/port/strerror.c:72:(.text+0x2d8): undefined reference to `libintl_gettext'
push(@{@PGBuild::conf{meson_opts}}, '-Dnls=disabled');

# TODO: Currently failing two tests:
# initdb/001_initdb
# icu / icu/010_database
push(@{@PGBuild::conf{meson_opts}}, '-Dicu=disabled');

1;

0 comments on commit 68d7c62

Please sign in to comment.