Re: Building with musl in CI and the build farm

Поиск
Список
Период
Сортировка
От walther@technowledgy.de
Тема Re: Building with musl in CI and the build farm
Дата
Msg-id cfd3d974-d3e7-4adf-9574-0094044e91a4@technowledgy.de
обсуждение исходный текст
Ответ на Building with musl in CI and the build farm  (Wolfgang Walther <walther@technowledgy.de>)
Ответы Re: Building with musl in CI and the build farm  (Peter Eisentraut <peter@eisentraut.org>)
Список pgsql-hackers
About building one of the CI tasks with musl:

Andres Freund:
> I'd rather adapt one of the existing tasks, to avoid increasing CI costs unduly.

I looked into this and I think the only task that could be changed is 
the SanityCheck. This is because this builds without any additional 
features enabled. I guess that makes sense, because otherwise those 
dependencies would first have to be built with musl-gcc as well.


> FWIW, except for one small issue, building postgres against musl works on debian and the tests pass if I install
first.

After the fix for LD_LIBRARY_PATH this now works as expected without 
installing first. I confirmed it works on debian with CC=musl-gcc.


> The small problem mentioned above is that on debian linux/fs.h isn't available
> when building with musl, which in turn causes src/bin/pg_upgrade/file.c to
> fail to compile.

According to [1], this can be worked around by linking some folders:

ln -s /usr/include/linux /usr/include/x86_64-linux-musl/
ln -s /usr/include/asm-generic /usr/include/x86_64-linux-musl/
ln -s /usr/include/x86_64-linux-gnu/asm /usr/include/x86_64-linux-musl/

Please find a patch to use musl-gcc in SanityCheck attached. Logs from 
the CI run are in [2]. It has this in the configure phase:

[13:19:52.712] Using 'CC' from environment with value: 'ccache musl-gcc'
[13:19:52.712] C compiler for the host machine: ccache musl-gcc (gcc 
10.2.1 "cc (Debian 10.2.1-6) 10.2.1 20210110")
[13:19:52.712] C linker for the host machine: musl-gcc ld.bfd 2.35.2
[13:19:52.712] Using 'CC' from environment with value: 'ccache musl-gcc'

So meson picks up musl-gcc properly. I also double checked that without 
the links above, the build does indeed fail with the linux/fs.h error.

I assume the installation of musl-tools should be done in the 
pg-vm-images repo instead of the additional script here?

Best,

Wolfgang

[1]: 

https://debian-bugs-dist.debian.narkive.com/VlFkLigg/bug-789789-musl-fails-to-compile-stuff-that-depends-on-kernel-headers
[2]: https://cirrus-ci.com/task/5741892590108672
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Yugo NAGATA
Дата:
Сообщение: Re: pgbnech: allow to cancel queries during benchmark
Следующее
От: Yugo NAGATA
Дата:
Сообщение: Re: Incremental View Maintenance, take 2