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

[PATCH v2 0/8] ci: wire up support for Meson

From
Patrick Steinhardt <ps@pks.im>
Date
Dec 13, 2024, 10:41 UTC
Message-ID
<20241213-pks-meson-ci-v2-0-634affccc694@pks.im>
In-Reply-To
<20241211-pks-meson-ci-v1-0-28d18b494374@pks.im>
Hi,

this small patch series wires up Meson into our CI systems. The intent is to ensure that it does not regress in functionality as the Git code base evolves.

To help with keeping it up-to-date, both Meson and our Makefiles learn to detect missing or superseded test files in "t/meson.build". This should give users an early notification in case they have to add a newly added or removed test to these build instructions. Overall I think that this shouldn't be too much of a burden given that adding a new test is trivial.

One gap that still exists is newly added code files. Due to many sources being added to the build conditionally it's hard to have generic checks for these. So I refrain from doing so in this series -- the build would already fail anyway when we're missing code, so at least we will know that something is up.

Changes in v2:
  - Improve a couple of commit messages.
  - Explain why we remove `-x` from the unit-test driver.
  - Remove unneeded `CC_PACKAGE` variable.
  - Improve error messages when tests weren't found.
  - Link to v1: https://lore.kernel.org/r/20241211-pks-meson-ci-v1-0-28d18b494374@pks.im

The series is built on top of caacdb5dfd (The fifteenth batch, 2024-12-10) with ps/build at 904339edbd (Introduce support for the Meson build system, 2024-12-06) and cw/worktree-extension at 2037ca85ad (worktree: refactor `repair_worktree_after_gitdir_move()`, 2024-11-29) merged into it.

Thanks!
Patrick
---
Patrick Steinhardt (8):
      ci/lib: support custom output directories when creating test artifacts
      Makefile: drop -DSUPPRESS_ANNOTATED_LEAKS
      t/unit-tests: rename clar-based unit tests to have a common prefix
      meson: detect missing tests at configure time
      Makefile: detect missing Meson tests
      t: fix out-of-tree tests for some git-p4 tests
      t: introduce compatibility options to clar-based tests
      ci: wire up Meson builds
 .github/workflows/main.yml                  |  7 ++++
 .gitlab-ci.yml                              |  8 +++++
 Makefile                                    |  5 ++-
 ci/install-dependencies.sh                  |  7 ++++
 ci/lib.sh                                   | 14 ++++----
 ci/print-test-failures.sh                   |  2 +-
 ci/run-build-and-tests.sh                   | 31 ++++++++++++++----
 meson.build                                 |  1 -
 parse-options.h                             | 12 +++++++
 t/Makefile                                  | 18 ++++++++++-
 t/meson.build                               | 40 +++++++++++++++++++++--
 t/t9835-git-p4-metadata-encoding-python2.sh | 50 ++++++++++++++---------------
 t/t9836-git-p4-metadata-encoding-python3.sh | 50 ++++++++++++++---------------
 t/unit-tests/generate-clar-decls.sh         |  5 ++-
 t/unit-tests/{ctype.c => u-ctype.c}         |  0
 t/unit-tests/{strvec.c => u-strvec.c}       |  0
 t/unit-tests/unit-test.c                    | 19 ++++++++++-
 17 files changed, 195 insertions(+), 74 deletions(-)
Range-diff versus v1:
1:  329404a926 = 1:  43562781da ci/lib: support custom output directories when creating test artifacts
2:  71a8cbc131 = 2:  f1655e9338 Makefile: drop -DSUPPRESS_ANNOTATED_LEAKS
3:  29e75b59e5 ! 3:  f5403a7ce0 t/unit-tests: rename clar-based unit tests to have a common prefix
    @@ Commit message
         t/unit-tests: rename clar-based unit tests to have a common prefix
     
         All of the code files for unit tests using the self-grown unit testing
    -    framework have have a "t-" prefix to their name. This makes it easy to
    +    framework have a "t-" prefix to their name. This makes it easy to
         identify them and use globbing in our Makefile and in other places. On
         the other hand though, our clar-based unit tests have no prefix at all
         and thus cannot easily be discerned from other files in the unit test
4:  644903d148 ! 4:  99a4ffdc2a meson: detect missing tests at configure time
    @@ t/meson.build: integration_tests = [
     +      endif
     +    endforeach
     +    if missing_tests.length() > 0
    -+      error('Missing tests:\n\n - ' + '\n - '.join(missing_tests))
    ++      error('Test files found, but not configured:\n\n - ' + '\n - '.join(missing_tests))
     +    endif
     +
     +    superfluous_tests = [ ]
    @@ t/meson.build: integration_tests = [
     +      endif
     +    endforeach
     +    if superfluous_tests.length() > 0
    -+      error('Superfluous tests:\n\n - ' + '\n - '.join(superfluous_tests))
    ++      error('Test files configured, but not found:\n\n - ' + '\n - '.join(superfluous_tests))
     +    endif
     +  endif
     +endforeach
5:  afad056353 = 5:  ce27e9c1a6 Makefile: detect missing Meson tests
6:  e398d80f77 ! 6:  8c46997ba4 t: fix out-of-tree tests for some git-p4 tests
    @@ Commit message
     
         Both t9835 and t9836 exercise git-p4, but one exercises Python 2 whereas
         the other one uses Python 3. These tests do not exercise "git p4", but
    -    instead they use "git p4.py" so that the unbuilt version of "git-p4.py"
    -    is used that has "#!/usr/bin/env python" as shebang instead of the
    -    replaced shebang.
    +    instead they use "git p4.py". This calls the unbuilt version of
    +    "git-p4.py" that still has the "#!/usr/bin/env python" shebang, which
    +    allows the test to modify which Python version comes first in $PATH,
    +    making it possible to force a Python version.
     
         But "git-p4.py" is not in our PATH during out-of-tree builds, and thus
         we cannot locate "git-p4.py". The tests thus break with CMake and Meson.
    @@ Commit message
         Signed-off-by: Patrick Steinhardt <ps@pks.im>
     
      ## t/t9835-git-p4-metadata-encoding-python2.sh ##
    -@@ t/t9835-git-p4-metadata-encoding-python2.sh: python_target_version='2'
    +@@ t/t9835-git-p4-metadata-encoding-python2.sh: failing, and produces maximally sane output in git.'
    + 
    + . ./lib-git-p4.sh
    + 
    +-python_target_version='2'
    +-
    + ###############################
      ## SECTION REPEATED IN t9836 ##
      ###############################
      
7:  efa4698fee ! 7:  357f8e7e67 t: introduce compatibility options to clar-based tests
    @@ Commit message
         fail in case it is passed an unknown option. Stub out these options with
         no-ops to make our life a bit easier.
     
    +    Note that this also requires us to remove the `-x` short option for
    +    `--exclude`. This is because `-x` has another meaning in our integration
    +    tests, as it enables shell tracing. I doubt there are a lot of people
    +    out there using it as we only got a small hand full of clar tests in the
    +    first place. So better change it now so that we can in the long run
    +    improve compatibility between the two different test drivers.
    +
         Signed-off-by: Patrick Steinhardt <ps@pks.im>
     
      ## parse-options.h ##
8:  d6f7685eca ! 8:  c1c27341eb ci: wire up Meson builds
    @@ .gitlab-ci.yml: test:linux:
     +      - jobname: linux-meson
     +        image: ubuntu:latest
     +        CC: gcc
    -+        CC_PACKAGE: gcc
        artifacts:
          paths:
            - t/failed-test-artifacts

--- base-commit: 2fcbf72f13e8ce3bf1cda9a689f392f8f6e5c65d change-id: 20241129-pks-meson-ci-ba1e40652fbe

Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 23 of 36 in “ci: wire up support for Meson”
  1. 0/8 ci: wire up support for MesonPatrick Steinhardt, Dec 11, 2024
  2. 1/8 ci/lib: support custom output directories when creating test artifactsPatrick Steinhardt, Dec 11, 2024
  3. karthik nayakDec 12, 2024
  4. Patrick SteinhardtDec 13, 2024
  5. 2/8 Makefile: drop -DSUPPRESS_ANNOTATED_LEAKSPatrick Steinhardt, Dec 11, 2024
  6. 4/8 meson: detect missing tests at configure timePatrick Steinhardt, Dec 11, 2024
  7. Toon ClaesDec 13, 2024
  8. Patrick SteinhardtDec 13, 2024
  9. 3/8 t/unit-tests: rename clar-based unit tests to have a common prefixPatrick Steinhardt, Dec 11, 2024
  10. karthik nayakDec 12, 2024
  11. Patrick SteinhardtDec 13, 2024
  12. 5/8 Makefile: detect missing Meson testsPatrick Steinhardt, Dec 11, 2024
  13. 6/8 t: fix out-of-tree tests for some git-p4 testsPatrick Steinhardt, Dec 11, 2024
  14. karthik nayakDec 12, 2024
  15. Patrick SteinhardtDec 13, 2024
  16. Toon ClaesDec 13, 2024
  17. Patrick SteinhardtDec 13, 2024
  18. 7/8 t: introduce compatibility options to clar-based testsPatrick Steinhardt, Dec 11, 2024
  19. Toon ClaesDec 13, 2024
  20. 8/8 ci: wire up Meson buildsPatrick Steinhardt, Dec 11, 2024
  21. Toon ClaesDec 13, 2024
  22. Patrick SteinhardtDec 13, 2024
  23. 0/8 ci: wire up support for MesonPatrick Steinhardt, Dec 13, 2024
  24. 1/8 ci/lib: support custom output directories when creating test artifactsPatrick Steinhardt, Dec 13, 2024
  25. 2/8 Makefile: drop -DSUPPRESS_ANNOTATED_LEAKSPatrick Steinhardt, Dec 13, 2024
  26. 3/8 t/unit-tests: rename clar-based unit tests to have a common prefixPatrick Steinhardt, Dec 13, 2024
  27. 4/8 meson: detect missing tests at configure timePatrick Steinhardt, Dec 13, 2024
  28. 5/8 Makefile: detect missing Meson testsPatrick Steinhardt, Dec 13, 2024
  29. 6/8 t: fix out-of-tree tests for some git-p4 testsPatrick Steinhardt, Dec 13, 2024
  30. 7/8 t: introduce compatibility options to clar-based testsPatrick Steinhardt, Dec 13, 2024
  31. Junio C HamanoDec 13, 2024
  32. 8/8 ci: wire up Meson buildsPatrick Steinhardt, Dec 13, 2024
  33. ci: allow github-actions print test failures againJunio C Hamano, Jul 16, 2025
  34. Patrick SteinhardtJul 17, 2025
  35. Toon ClaesDec 16, 2024
  36. Junio C HamanoDec 16, 2024

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.