Merge branch 'muslc-ci' into 'main'

add muslc ci

See merge request GNOME/glib!3524
This commit is contained in:
Philip Withnall 2023-11-21 14:55:29 +00:00
commit 059618956b
5 changed files with 119 additions and 7 deletions

View File

@ -14,6 +14,7 @@ variables:
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v22" FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v22"
COVERITY_IMAGE: "registry.gitlab.gnome.org/gnome/glib/coverity:v7" COVERITY_IMAGE: "registry.gitlab.gnome.org/gnome/glib/coverity:v7"
DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v16" DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v16"
ALPINE_IMAGE: "registry.gitlab.gnome.org/gnome/glib/alpine-stable:v0"
MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v12" MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v12"
MESON_TEST_TIMEOUT_MULTIPLIER: 4 MESON_TEST_TIMEOUT_MULTIPLIER: 4
G_MESSAGES_DEBUG: all G_MESSAGES_DEBUG: all
@ -210,6 +211,37 @@ hurd-i386:
- "_build/glib/glibconfig.h" - "_build/glib/glibconfig.h"
- "_build/meson-logs" - "_build/meson-logs"
muslc-alpine-stable-x86_64:
extends:
- .build-linux
- .only-schedules
image: $ALPINE_IMAGE
stage: build
needs: []
script:
- meson setup ${MESON_COMMON_OPTIONS}
--werror
--default-library=both
--prefix=$HOME/glib-installed
--localstatedir=/var
--libdir=lib
-Dsystemtap=true
_build
- meson compile -C _build
- .gitlab-ci/run-tests.sh
artifacts:
reports:
junit:
- _build/meson-logs/testlog.junit.xml
- _build/meson-logs/testlog-*.junit.xml
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always
expire_in: 1 week
paths:
- "_build/config.h"
- "_build/glib/glibconfig.h"
- "_build/meson-logs"
installed-tests: installed-tests:
extends: extends:
- .build-linux - .build-linux

View File

@ -0,0 +1,35 @@
FROM alpine:latest
RUN apk add --no-cache \
bash \
build-base \
bzip2-dev \
dbus \
desktop-file-utils \
docbook-xml \
docbook-xsl \
gettext-dev \
git \
libffi-dev \
libxml2-utils \
libxslt \
meson \
musl-locales \
python3 \
pcre2-dev \
shared-mime-info \
tzdata \
util-linux-dev \
zlib-dev
ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8 MUSL_LOCPATH=/usr/share/i18n/locales/musl
ARG HOST_USER_ID=5555
ENV HOST_USER_ID ${HOST_USER_ID}
RUN adduser -D -u $HOST_USER_ID -s /bin/bash user
USER user
WORKDIR /home/user
COPY cache-subprojects.sh .
RUN ./cache-subprojects.sh

View File

@ -64,7 +64,12 @@ gio_tests = {
# FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251 # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
'can_fail' : host_system == 'darwin', 'can_fail' : host_system == 'darwin',
}, },
'converter-stream' : {}, 'converter-stream' : {
# musl: charset tests fail due to missing collation support in musl libc
# From https://wiki.musl-libc.org/roadmap#Open_future_goals
# "LC_COLLATE support for collation orders other than simple codepoint order"
'can_fail' : linux_libc == 'musl',
},
'credentials' : {}, 'credentials' : {},
'data-input-stream' : {}, 'data-input-stream' : {},
'data-output-stream' : {}, 'data-output-stream' : {},
@ -993,6 +998,8 @@ if not meson.is_cross_build()
'resources' : { 'resources' : {
'extra_sources' : resources_extra_sources, 'extra_sources' : resources_extra_sources,
'depends' : resource_plugin, 'depends' : resource_plugin,
# FIXME: musl: https://gitlab.gnome.org/GNOME/glib/-/issues/3160
'can_fail' : linux_libc == 'musl',
}, },
} }
endif endif

View File

@ -12,14 +12,26 @@ glib_tests = {
'cache' : {}, 'cache' : {},
'charset' : {}, 'charset' : {},
'checksum' : {}, 'checksum' : {},
'collate' : {}, 'collate' : {
# musl: collate fail due to missing collation support in musl libc
# From https://wiki.musl-libc.org/roadmap#Open_future_goals
# "LC_COLLATE support for collation orders other than simple codepoint order"
'can_fail' : linux_libc == 'musl',
},
'completion' : {}, 'completion' : {},
'cond' : {}, 'cond' : {},
'convert' : {}, 'convert' : {
# fails /conversion/illegal-sequence
# Possibly a bug or some POSIX incompatibility, not sure if here or in musl
'can_fail' : linux_libc == 'musl',
},
'dataset' : {}, 'dataset' : {},
'date' : { 'date' : {
# FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 # FIXME: darwin: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
'can_fail' : host_system == 'darwin', # musl: /date/month_substring should be skipped but it's not. The fix should
# be on musl side: https://www.openwall.com/lists/musl/2023/08/10/3
# FIXME: musl: /date/strftime: https://gitlab.gnome.org/GNOME/glib/-/issues/3171
'can_fail' : host_system == 'darwin' or linux_libc == 'musl',
}, },
'dir' : {}, 'dir' : {},
'environment' : { 'environment' : {
@ -30,7 +42,10 @@ glib_tests = {
'fileutils' : {}, 'fileutils' : {},
'gdatetime' : { 'gdatetime' : {
'suite' : ['slow'], 'suite' : ['slow'],
'can_fail' : host_system == 'windows', # musl: GDateTime/format_mixed/non_utf8_time_non_utf8_messages should be
# skipped but it's not. The fix should be on musl side:
# https://www.openwall.com/lists/musl/2023/08/10/3
'can_fail' : host_system == 'windows' or linux_libc == 'musl',
}, },
'guuid' : {}, 'guuid' : {},
'gvariant' : { 'gvariant' : {
@ -70,7 +85,11 @@ glib_tests = {
'node' : {}, 'node' : {},
'once' : {}, 'once' : {},
'onceinit' : {}, 'onceinit' : {},
'option-context' : {}, 'option-context' : {
# musl: /option/arg/repetition/locale should be skipped but it's not. The
# fix should be on musl side: https://www.openwall.com/lists/musl/2023/08/10/3
'can_fail' : linux_libc == 'musl',
},
'option-argv0' : {}, 'option-argv0' : {},
'overflow' : {}, 'overflow' : {},
'overflow-fallback' : { 'overflow-fallback' : {
@ -94,6 +113,8 @@ glib_tests = {
'regex' : { 'regex' : {
'dependencies' : [pcre2], 'dependencies' : [pcre2],
'c_args' : use_pcre2_static_flag ? ['-DPCRE2_STATIC'] : [], 'c_args' : use_pcre2_static_flag ? ['-DPCRE2_STATIC'] : [],
# FIXME: musl: https://gitlab.gnome.org/GNOME/glib/-/issues/3159
'can_fail' : linux_libc == 'musl',
}, },
'relation' : {}, 'relation' : {},
'rwlock' : {}, 'rwlock' : {},

View File

@ -65,6 +65,17 @@ if host_system == 'darwin'
endif endif
endif endif
linux_libc = ''
if host_system == 'linux'
musl_test_code = '''#include <stdlib.h>
#if defined __GLIBC__ || defined __UCLIBC__
#error "Not in glibc or uclibc"
#endif'''
if cc.compiles(musl_test_code, name : 'building for musl libc')
linux_libc = 'musl'
endif
endif
glib_version = meson.project_version() glib_version = meson.project_version()
glib_api_version = '2.0' glib_api_version = '2.0'
version_arr = glib_version.split('.') version_arr = glib_version.split('.')
@ -2552,6 +2563,12 @@ if build_machine.system() != host_system
}, section: 'Build environment') }, section: 'Build environment')
endif endif
if linux_libc != ''
summary({
'linux_libc' : linux_libc
}, section: 'Build environment')
endif
summary({ summary({
'prefix' : glib_prefix, 'prefix' : glib_prefix,
'bindir' : glib_bindir, 'bindir' : glib_bindir,