]> git.ipfire.org Git - thirdparty/git.git/commitdiff
ci: switch linux-musl to use Meson
authorPatrick Steinhardt <ps@pks.im>
Tue, 28 Jan 2025 08:41:35 +0000 (09:41 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 Jan 2025 21:03:23 +0000 (13:03 -0800)
Switch over the "linux-musl" job to use Meson instead of Makefiles. This
is done due to multiple reasons:

  - It simplifies our CI infrastructure a bit as we don't have to
    manually specify a couple of build options anymore.

  - It verifies that Meson detects and sets those build options
    automatically.

  - It makes it easier for us to wire up a new CI job using zlib-ng as
    backend.

One platform compatibility that Meson cannot easily detect automatically
is the `GIT_TEST_UTF8_LOCALE` variable used in tests. Wire up a build
option for it, which we set via a new "MESONFLAGS" environment variable.

Note that we also drop the CC variable, which is set to "gcc". We
already default to GCC when CC is unset in "ci/lib.sh", so this is not
needed.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
.github/workflows/main.yml
.gitlab-ci.yml
ci/install-dependencies.sh
ci/lib.sh
ci/run-build-and-tests.sh
meson.build
meson_options.txt

index 7f55f8b3a91d6caf95934af308a2bd35a19a62f1..83bf9b918ba1b90c778d1a72cdbfa9a97ef86bdf 100644 (file)
@@ -394,7 +394,7 @@ jobs:
       fail-fast: false
       matrix:
         vector:
-        - jobname: linux-musl
+        - jobname: linux-musl-meson
           image: alpine
           distro: alpine-latest
         # Supported until 2025-04-02.
index 4976e18a0503298f38230f5ba7348675baf48664..f737e4177c24d21f08dfa5c2fba8aa082c4cf6b1 100644 (file)
@@ -67,7 +67,7 @@ test:linux:
         CC: clang
       - jobname: pedantic
         image: fedora:latest
-      - jobname: linux-musl
+      - jobname: linux-musl-meson
         image: alpine:latest
       - jobname: linux-meson
         image: ubuntu:latest
index d1cb9fa8785388b3674fcea4dd682abc0725c968..5ae80b0486c65833825352019b2873498e801db0 100755 (executable)
@@ -24,7 +24,7 @@ fi
 
 case "$distro" in
 alpine-*)
-       apk add --update shadow sudo build-base curl-dev openssl-dev expat-dev gettext \
+       apk add --update shadow sudo meson ninja-build gcc libc-dev curl-dev openssl-dev expat-dev gettext \
                pcre2-dev python3 musl-libintl perl-utils ncurses \
                apache2 apache2-http2 apache2-proxy apache2-ssl apache2-webdav apr-util-dbd_sqlite3 \
                bash cvs gnupg perl-cgi perl-dbd-sqlite perl-io-tty >/dev/null
index 8885ee3c3f86c62e8783d27756b8779bd491e7e6..71d85ae85a02e5a4389e133ed53f45a5042af36e 100755 (executable)
--- a/ci/lib.sh
+++ b/ci/lib.sh
@@ -378,10 +378,7 @@ linux32)
        CC=gcc
        ;;
 linux-musl)
-       CC=gcc
-       MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/python3 USE_LIBPCRE2=Yes"
-       MAKEFLAGS="$MAKEFLAGS NO_REGEX=Yes ICONV_OMITS_BOM=Yes"
-       MAKEFLAGS="$MAKEFLAGS GIT_TEST_UTF8_LOCALE=C.UTF-8"
+       MESONFLAGS="$MESONFLAGS -DGIT_TEST_UTF8_LOCALE=C.UTF-8"
        ;;
 linux-leaks|linux-reftable-leaks)
        export SANITIZE=leak
index 964322055f5db0eae0c794b543664e24ae4249f7..643c6a9dcc80f34a4fe0fcb7fad7d074e6ce082e 100755 (executable)
@@ -55,7 +55,8 @@ case "$jobname" in
                --fatal-meson-warnings \
                --warnlevel 2 --werror \
                --wrap-mode nofallback \
-               -Dfuzzers=true
+               -Dfuzzers=true \
+               $MESONFLAGS
        group "Build" meson compile -C build --
        if test -n "$run_tests"
        then
index 04558a90550b9fd0cbb0bc2f7202b6f3737c861c..5f4aa6e4e281c25505b2025e659d1428233818b8 100644 (file)
@@ -664,7 +664,7 @@ build_options_config.set('GIT_TEST_CMP_USE_COPIED_CONTEXT', '')
 build_options_config.set('GIT_TEST_INDEX_VERSION', '')
 build_options_config.set('GIT_TEST_OPTS', '')
 build_options_config.set('GIT_TEST_PERL_FATAL_WARNINGS', '')
-build_options_config.set('GIT_TEST_UTF8_LOCALE', '')
+build_options_config.set_quoted('GIT_TEST_UTF8_LOCALE', get_option('test_utf8_locale'))
 build_options_config.set_quoted('LOCALEDIR', fs.as_posix(get_option('prefix') / get_option('localedir')))
 build_options_config.set('GITWEBDIR', fs.as_posix(get_option('prefix') / get_option('datadir') / 'gitweb'))
 
index c962c0a676172ed478333b9e56d1430ff9cf0af0..e9f8e990e3e88de5baea652825b4745c230473c4 100644 (file)
@@ -99,5 +99,7 @@ option('tests', type: 'boolean', value: true,
   description: 'Enable building tests. This requires Perl, but is separate from the "perl" option such that you can build tests without Perl features enabled.')
 option('test_output_directory', type: 'string',
   description: 'Path to the directory used to store test outputs')
+option('test_utf8_locale', type: 'string',
+  description: 'Name of a UTF-8 locale used for testing.')
 option('fuzzers', type: 'boolean', value: false,
   description: 'Enable building fuzzers.')