git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 09/10] ci: switch linux-musl to use Meson

From
Patrick Steinhardt <ps@pks.im>
Date
Jan 16, 2025, 09:17 UTC
Message-ID
<20250116-b4-pks-compat-drop-uncompress2-v3-9-f2af1f5c4a06@pks.im>
In-Reply-To
<20250116-b4-pks-compat-drop-uncompress2-v3-0-f2af1f5c4a06@pks.im>

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>
---
 .github/workflows/main.yml | 2 +-
 .gitlab-ci.yml             | 2 +-
 ci/install-dependencies.sh | 2 +-
 ci/lib.sh                  | 5 +----
 ci/run-build-and-tests.sh  | 3 ++-
 meson.build                | 2 +-
 meson_options.txt          | 2 ++
 7 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 7f55f8b3a9..83bf9b918b 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -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.
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4976e18a05..f737e4177c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -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
diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh
index d1cb9fa878..5ae80b0486 100755
--- a/ci/install-dependencies.sh
+++ b/ci/install-dependencies.sh
@@ -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
diff --git a/ci/lib.sh b/ci/lib.sh
index 8885ee3c3f..71d85ae85a 100755
--- 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
diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh
index 964322055f..643c6a9dcc 100755
--- a/ci/run-build-and-tests.sh
+++ b/ci/run-build-and-tests.sh
@@ -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
diff --git a/meson.build b/meson.build
index f9e6a051e0..35b3c51fb1 100644
--- a/meson.build
+++ b/meson.build
@@ -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'))
 
diff --git a/meson_options.txt b/meson_options.txt
index c962c0a676..e9f8e990e3 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -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.')
-- 
2.48.0.257.gd3603152ad.dirty
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 53 of 56 in “compat/zlib: allow use of zlib-ng as backend”
  1. 0/8 compat/zlib: allow use of zlib-ng as backendPatrick Steinhardt, Jan 10, 2025
  2. 1/8 compat: drop `uncompress2()` compatibility shimPatrick Steinhardt, Jan 10, 2025
  3. 2/8 git-compat-util: drop `z_const` definePatrick Steinhardt, Jan 10, 2025
  4. 3/8 compat: introduce new "zlib.h" headerPatrick Steinhardt, Jan 10, 2025
  5. 4/8 git-compat-util: move include of "compat/zlib.h" into "git-zlib.h"Patrick Steinhardt, Jan 10, 2025
  6. 5/8 compat/zlib: provide `deflateBound()` shim centrallyPatrick Steinhardt, Jan 10, 2025
  7. 7/8 git-zlib: cast away potential constness of `next_in` pointerPatrick Steinhardt, Jan 10, 2025
  8. 6/8 compat/zlib: provide stubs for `deflateSetHeader()`Patrick Steinhardt, Jan 10, 2025
  9. 8/8 compat/zlib: allow use of zlib-ng as backendPatrick Steinhardt, Jan 10, 2025
  10. Taylor BlauJan 10, 2025
  11. Patrick SteinhardtJan 13, 2025
  12. 00/10 compat/zlib: allow use of zlib-ng as backendPatrick Steinhardt, Jan 14, 2025
  13. 01/10 compat: drop `uncompress2()` compatibility shimPatrick Steinhardt, Jan 14, 2025
  14. 02/10 git-compat-util: drop `z_const` definePatrick Steinhardt, Jan 14, 2025
  15. 03/10 compat: introduce new "zlib.h" headerPatrick Steinhardt, Jan 14, 2025
  16. Karthik NayakJan 15, 2025
  17. Patrick SteinhardtJan 15, 2025
  18. Karthik NayakJan 16, 2025
  19. 04/10 git-compat-util: move include of "compat/zlib.h" into "git-zlib.h"Patrick Steinhardt, Jan 14, 2025
  20. 05/10 compat/zlib: provide `deflateBound()` shim centrallyPatrick Steinhardt, Jan 14, 2025
  21. 06/10 compat/zlib: provide stubs for `deflateSetHeader()`Patrick Steinhardt, Jan 14, 2025
  22. Karthik NayakJan 15, 2025
  23. 07/10 git-zlib: cast away potential constness of `next_in` pointerPatrick Steinhardt, Jan 14, 2025
  24. Karthik NayakJan 15, 2025
  25. 08/10 compat/zlib: allow use of zlib-ng as backendPatrick Steinhardt, Jan 14, 2025
  26. 09/10 ci: switch linux-musl to use MesonPatrick Steinhardt, Jan 14, 2025
  27. Karthik NayakJan 15, 2025
  28. Patrick SteinhardtJan 15, 2025
  29. Karthik NayakJan 16, 2025
  30. 10/10 ci: make "linux-musl" job use zlib-ngPatrick Steinhardt, Jan 14, 2025
  31. Junio C HamanoJan 14, 2025
  32. Junio C HamanoJan 14, 2025
  33. Patrick SteinhardtJan 15, 2025
  34. Konstantin RyabitsevJan 15, 2025
  35. Junio C HamanoJan 15, 2025
  36. Patrick SteinhardtJan 15, 2025
  37. Konstantin RyabitsevJan 16, 2025
  38. Patrick SteinhardtJan 15, 2025
  39. Karthik NayakJan 16, 2025
  40. 00/10 compat/zlib: allow use of zlib-ng as backendPatrick Steinhardt, Jan 16, 2025
  41. 02/10 git-compat-util: drop `z_const` definePatrick Steinhardt, Jan 16, 2025
  42. 01/10 compat: drop `uncompress2()` compatibility shimPatrick Steinhardt, Jan 16, 2025
  43. 03/10 compat: introduce new "zlib.h" headerPatrick Steinhardt, Jan 16, 2025
  44. 04/10 git-compat-util: move include of "compat/zlib.h" into "git-zlib.h"Patrick Steinhardt, Jan 16, 2025
  45. 05/10 compat/zlib: provide `deflateBound()` shim centrallyPatrick Steinhardt, Jan 16, 2025
  46. 06/10 compat/zlib: provide stubs for `deflateSetHeader()`Patrick Steinhardt, Jan 16, 2025
  47. Justin ToblerJan 27, 2025
  48. Patrick SteinhardtJan 28, 2025
  49. 07/10 git-zlib: cast away potential constness of `next_in` pointerPatrick Steinhardt, Jan 16, 2025
  50. Justin ToblerJan 27, 2025
  51. Patrick SteinhardtJan 28, 2025
  52. 08/10 compat/zlib: allow use of zlib-ng as backendPatrick Steinhardt, Jan 16, 2025
  53. 09/10 ci: switch linux-musl to use MesonPatrick Steinhardt, Jan 16, 2025
  54. 10/10 ci: make "linux-musl" job use zlib-ngPatrick Steinhardt, Jan 16, 2025
  55. Karthik NayakJan 17, 2025
  56. Patrick SteinhardtJan 17, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.