pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: walther@technowledgy.de
To: Andres Freund <andres@anarazel.de>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Subject: Re: Building with musl in CI and the build farm
Date: Sat, 30 Mar 2024 15:05:19 +0100
Message-ID: <0c16a4ee-c20a-420e-81ed-84ae506aea59@technowledgy.de> (raw)
In-Reply-To: <0a48d551-50e1-4bd3-8d46-8421e3b1b724@technowledgy.de>
References: <4093813.1710899588@sss.pgh.pa.us>
	<CA+hUKGKNK5V8XwwJJZm36s3EUy8V51xu4XiE8=26n=Wq3OGd4A@mail.gmail.com>
	<4095435.1710900216@sss.pgh.pa.us>
	<CA+hUKGK2cSx3dveMqBD+E9N=zJ0WawBcbk_jnPqmdWBM0DT_3Q@mail.gmail.com>
	<477fa513-6bf0-456d-8d24-1e22a19df671@technowledgy.de>
	<ZfrmN4WHuJgD95fw@momjian.us>
	<CA+hUKGJzC4rr2Yr=QZyx9W83Wv=TVJHndKF1anjNLNXVUM7TqQ@mail.gmail.com>
	<f98cd8de-1c66-491a-8409-e62c09932080@technowledgy.de>
	<20240322001948.atp2eetusylgjyw2@awork3.anarazel.de>
	<40543180-a0a2-495b-8d34-23b46c28f533@technowledgy.de>
	<20240326001447.wcatfvx45tkmizji@awork3.anarazel.de>
	<0a48d551-50e1-4bd3-8d46-8421e3b1b724@technowledgy.de>

Here's an update on the progress to run musl (Alpine Linux) in the 
buildfarm.

Wolfgang Walther:
> The animal runs in a docker container via GitHub Actions in [2]. Right 
> now it's still running with --test, until I get the credentials to 
> activate it.

The animals have been activated and are reporting now. Thanks, Andrew!


> I tried to enable everything (except systemd, because Alpine doesn't 
> have it) and run all tests. The LDAP tests are failing right now, but 
> that is likely something that I need to fix in the Dockerfile - it's 
> failing to start the slapd, IIRC. There are other issues, though - all 
> of them have open pull requests in that repo [3].

ldap tests are enabled, just a missing package.


> I also had to skip the recovery check. Andrew mentioned that he had to 
> do that, too, when he was still running his animal on Alpine. Not sure 
> what this is about, yet.

This was about a missing init process in the docker image. Without an 
init process reaping zombie processes, the recovery tests end up with 
some supposed-to-be-terminated backends still running and can't start 
them up again. Fixed by adding a minimal init process with "tinit".


> Building --with-icu fails two tests. One of them (001_initdb) is fixed 
> by having the "locale" command in your PATH, which is not the case on 
> Alpine by default. I assume this will not break on your debian/musl 
> build, Andres - but it will also probably not return any sane values, 
> because it will run glibc's locale command.
> I haven't looked into that in detail, yet, but I think the other test 
> (icu/010_database) fails because it expects that setlocale(LC_COLLATE, 
> <illegal_value>) throws an error. I think it doesn't do that on musl, 
> because LC_COLLATE is not implemented.
> Those failing tests are not "just failing", but probably mean that we 
> need to do something about how we deal with locale/setlocale on musl.

I still need to look into this in depth.


> The last failure is about building --with-nls. This fails with something 
> like:
> 
> ld: src/port/strerror.c:72:(.text+0x2d8): undefined reference to 
> `libintl_gettext'
> 
> Of course, gettext-dev is installed, libintl.so is available in /usr/lib 
> and it also contains the symbol. So not sure what's happening here.

This is an Alpine Linux packaging issue. Theoretically, it could be made 
to work by introducing some configure/meson flag like "--with-gettext" 
or so, to prefer gettext's libintl over the libc-builtin. However, NixOS 
/ nixpkgs with its pkgsMusl overlay manages to solve this issue just 
fine, builds with --enable-nls and gettext work. Thus, I conclude this 
is best solved upstream in Alpine Linux.

TLDR: The only real issue which is still open from PostgreSQL's side is 
around locales and ICU - certainly the pain point in musl. Will look 
into it further.

Best,

Wolfgang





view thread (10+ messages)  latest in thread

Message-ID: <0c16a4ee-c20a-420e-81ed-84ae506aea59@technowledgy.de>
Permalink:  ../0c16a4ee-c20a-420e-81ed-84ae506aea59@technowledgy.de/
Also on:    postgresql.org/message-id/0c16a4ee-c20a-420e-81ed-84ae506aea59@technowledgy.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: walther@technowledgy.de, andres@anarazel.de, pgsql-hackers@postgresql.org, andrew@dunslane.net, tgl@sss.pgh.pa.us
  Subject: Re: Building with musl in CI and the build farm
  In-Reply-To: <0c16a4ee-c20a-420e-81ed-84ae506aea59@technowledgy.de>
  References: <4093813.1710899588@sss.pgh.pa.us> <CA+hUKGKNK5V8XwwJJZm36s3EUy8V51xu4XiE8=26n=Wq3OGd4A@mail.gmail.com> <4095435.1710900216@sss.pgh.pa.us> <CA+hUKGK2cSx3dveMqBD+E9N=zJ0WawBcbk_jnPqmdWBM0DT_3Q@mail.gmail.com> <477fa513-6bf0-456d-8d24-1e22a19df671@technowledgy.de> <ZfrmN4WHuJgD95fw@momjian.us> <CA+hUKGJzC4rr2Yr=QZyx9W83Wv=TVJHndKF1anjNLNXVUM7TqQ@mail.gmail.com> <f98cd8de-1c66-491a-8409-e62c09932080@technowledgy.de> <20240322001948.atp2eetusylgjyw2@awork3.anarazel.de> <40543180-a0a2-495b-8d34-23b46c28f533@technowledgy.de> <20240326001447.wcatfvx45tkmizji@awork3.anarazel.de> <0a48d551-50e1-4bd3-8d46-8421e3b1b724@technowledgy.de> <0c16a4ee-c20a-420e-81ed-84ae506aea59@technowledgy.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox