diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7e1b829cd..9de4be100 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,6 +14,7 @@ variables: FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v22" COVERITY_IMAGE: "registry.gitlab.gnome.org/gnome/glib/coverity:v7" 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" MESON_TEST_TIMEOUT_MULTIPLIER: 4 G_MESSAGES_DEBUG: all @@ -210,6 +211,37 @@ hurd-i386: - "_build/glib/glibconfig.h" - "_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: extends: - .build-linux diff --git a/.gitlab-ci/alpine.Dockerfile b/.gitlab-ci/alpine.Dockerfile new file mode 100644 index 000000000..be9ecfa70 --- /dev/null +++ b/.gitlab-ci/alpine.Dockerfile @@ -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 diff --git a/gio/tests/meson.build b/gio/tests/meson.build index 187a60343..fd4c46fc6 100644 --- a/gio/tests/meson.build +++ b/gio/tests/meson.build @@ -64,7 +64,12 @@ gio_tests = { # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251 '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' : {}, 'data-input-stream' : {}, 'data-output-stream' : {}, @@ -993,6 +998,8 @@ if not meson.is_cross_build() 'resources' : { 'extra_sources' : resources_extra_sources, 'depends' : resource_plugin, + # FIXME: musl: https://gitlab.gnome.org/GNOME/glib/-/issues/3160 + 'can_fail' : linux_libc == 'musl', }, } endif diff --git a/glib/tests/meson.build b/glib/tests/meson.build index d401e759b..60eb31bff 100644 --- a/glib/tests/meson.build +++ b/glib/tests/meson.build @@ -12,14 +12,26 @@ glib_tests = { 'cache' : {}, 'charset' : {}, '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' : {}, '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' : {}, 'date' : { - # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 - 'can_fail' : host_system == 'darwin', + # FIXME: darwin: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 + # 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' : {}, 'environment' : { @@ -30,7 +42,10 @@ glib_tests = { 'fileutils' : {}, 'gdatetime' : { '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' : {}, 'gvariant' : { @@ -70,7 +85,11 @@ glib_tests = { 'node' : {}, 'once' : {}, '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' : {}, 'overflow' : {}, 'overflow-fallback' : { @@ -94,6 +113,8 @@ glib_tests = { 'regex' : { 'dependencies' : [pcre2], 'c_args' : use_pcre2_static_flag ? ['-DPCRE2_STATIC'] : [], + # FIXME: musl: https://gitlab.gnome.org/GNOME/glib/-/issues/3159 + 'can_fail' : linux_libc == 'musl', }, 'relation' : {}, 'rwlock' : {}, diff --git a/meson.build b/meson.build index 901ae6dfe..2b6f394c7 100644 --- a/meson.build +++ b/meson.build @@ -65,6 +65,17 @@ if host_system == 'darwin' endif endif +linux_libc = '' +if host_system == 'linux' + musl_test_code = '''#include + #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_api_version = '2.0' version_arr = glib_version.split('.') @@ -2552,6 +2563,12 @@ if build_machine.system() != host_system }, section: 'Build environment') endif +if linux_libc != '' + summary({ + 'linux_libc' : linux_libc + }, section: 'Build environment') +endif + summary({ 'prefix' : glib_prefix, 'bindir' : glib_bindir,