Skip to content

Commit 84bb5ee

Browse files
pks-tgitster
authored andcommitted
ci: switch linux-musl to use Meson
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b9d6f64 commit 84bb5ee

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ jobs:
394394
fail-fast: false
395395
matrix:
396396
vector:
397-
- jobname: linux-musl
397+
- jobname: linux-musl-meson
398398
image: alpine
399399
distro: alpine-latest
400400
# Supported until 2025-04-02.

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ test:linux:
6767
CC: clang
6868
- jobname: pedantic
6969
image: fedora:latest
70-
- jobname: linux-musl
70+
- jobname: linux-musl-meson
7171
image: alpine:latest
7272
- jobname: linux-meson
7373
image: ubuntu:latest

ci/install-dependencies.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fi
2424

2525
case "$distro" in
2626
alpine-*)
27-
apk add --update shadow sudo build-base curl-dev openssl-dev expat-dev gettext \
27+
apk add --update shadow sudo meson ninja-build gcc libc-dev curl-dev openssl-dev expat-dev gettext \
2828
pcre2-dev python3 musl-libintl perl-utils ncurses \
2929
apache2 apache2-http2 apache2-proxy apache2-ssl apache2-webdav apr-util-dbd_sqlite3 \
3030
bash cvs gnupg perl-cgi perl-dbd-sqlite perl-io-tty >/dev/null

ci/lib.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,10 +378,7 @@ linux32)
378378
CC=gcc
379379
;;
380380
linux-musl)
381-
CC=gcc
382-
MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/python3 USE_LIBPCRE2=Yes"
383-
MAKEFLAGS="$MAKEFLAGS NO_REGEX=Yes ICONV_OMITS_BOM=Yes"
384-
MAKEFLAGS="$MAKEFLAGS GIT_TEST_UTF8_LOCALE=C.UTF-8"
381+
MESONFLAGS="$MESONFLAGS -DGIT_TEST_UTF8_LOCALE=C.UTF-8"
385382
;;
386383
linux-leaks|linux-reftable-leaks)
387384
export SANITIZE=leak

ci/run-build-and-tests.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ case "$jobname" in
5555
--fatal-meson-warnings \
5656
--warnlevel 2 --werror \
5757
--wrap-mode nofallback \
58-
-Dfuzzers=true
58+
-Dfuzzers=true \
59+
$MESONFLAGS
5960
group "Build" meson compile -C build --
6061
if test -n "$run_tests"
6162
then

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ build_options_config.set('GIT_TEST_CMP_USE_COPIED_CONTEXT', '')
664664
build_options_config.set('GIT_TEST_INDEX_VERSION', '')
665665
build_options_config.set('GIT_TEST_OPTS', '')
666666
build_options_config.set('GIT_TEST_PERL_FATAL_WARNINGS', '')
667-
build_options_config.set('GIT_TEST_UTF8_LOCALE', '')
667+
build_options_config.set_quoted('GIT_TEST_UTF8_LOCALE', get_option('test_utf8_locale'))
668668
build_options_config.set_quoted('LOCALEDIR', fs.as_posix(get_option('prefix') / get_option('localedir')))
669669
build_options_config.set('GITWEBDIR', fs.as_posix(get_option('prefix') / get_option('datadir') / 'gitweb'))
670670

meson_options.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,7 @@ option('tests', type: 'boolean', value: true,
9999
description: 'Enable building tests. This requires Perl, but is separate from the "perl" option such that you can build tests without Perl features enabled.')
100100
option('test_output_directory', type: 'string',
101101
description: 'Path to the directory used to store test outputs')
102+
option('test_utf8_locale', type: 'string',
103+
description: 'Name of a UTF-8 locale used for testing.')
102104
option('fuzzers', type: 'boolean', value: false,
103105
description: 'Enable building fuzzers.')

0 commit comments

Comments
 (0)