[PATCH v2 00/13] meson: cleanups, improvements, smallish fixes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

this patch series contains a mostly-random set of smallish improvements,
simplifications and fixes to the Meson build instructions.

Changes in v2:
  - Redo the two commits regarding PATH handling. We now only prepend
    system-specific paths to PATH and handle the `-Dsane_tool_path`
    option the same.
  - Continue to propagate libcurl include directories into libgit, as we
    need it for "help.c" to resolve LIBCURL_VERSION. Reorder the patch
    to minimize the required changes.
  - Fix a commit message typo.
  - Include another commit that fixes the OpenSSL fallback on Windows.
  - Include another commit to fix linker errors due to out-of-memory
    situations on Windows with GitLab CI.
  - Link to v1: https://lore.kernel.org/r/20250129-b4-pks-meson-improvements-v1-0-ab709f0be12c@xxxxxx

I have furthermore pulled in ps/build-meson-fixes at 7304bd2bc3 (ci:
wire up Visual Studio build with Meson, 2025-01-22) as a dependency of
this series. This is due to a semantic conflict with 28911f7dca (meson:
wire up fuzzers, 2025-01-22).

Thanks!

Patrick

---
Patrick Steinhardt (13):
      meson: fix exec path with enabled runtime prefix
      meson: fix OpenSSL fallback when not explicitly required
      meson: inline the static 'git' library
      meson: simplify use of the common-main library
      meson: introduce `libgit_curl` dependency
      meson: stop linking libcurl into all executables
      meson: drop separate version library
      meson: improve PATH handling
      meson: improve handling of `sane_tool_path` option
      meson: prevent finding sed(1) in a loop
      meson: fix overwritten `git` variable
      meson: consistently use custom program paths to resolve programs
      gitlab-ci: restrict maximum number of link jobs on Windows

 .gitlab-ci.yml                  |   2 +-
 Documentation/howto/meson.build |   2 +-
 Documentation/meson.build       |  13 ++--
 meson.build                     | 151 +++++++++++++++++++---------------------
 meson_options.txt               |   4 +-
 oss-fuzz/meson.build            |   2 +-
 t/helper/meson.build            |   4 +-
 t/meson.build                   |   4 +-
 8 files changed, 85 insertions(+), 97 deletions(-)

Range-diff versus v1:

 1:  a4f1eb695a !  1:  932d79a814 meson: fix exec path with enabled runtime prefix
    @@ Commit message
     
         One of these paths, GIT_EXEC_PATH, is expected to be absolute when
         runtime prefixes are enabled, but relative otherwise. And while our
    -    Makefile gets this correcty, in Meson we always wire up the absolute
    +    Makefile gets this correctly, in Meson we always wire up the absolute
         path, which may result in us not being able to find binaries.
     
         Fix this by conditionally injecting the paths depending on whether or
 -:  ---------- >  2:  6bd07f35a6 meson: fix OpenSSL fallback when not explicitly required
 2:  da61c2a679 =  3:  94f9e45c56 meson: inline the static 'git' library
 3:  744754959e !  4:  669c811eb6 meson: simplify use of the common-main library
    @@ meson.build: test_dependencies += executable('git-imap-send',
      
        install_symlink(alias + executable_suffix,
     
    + ## oss-fuzz/meson.build ##
    +@@ oss-fuzz/meson.build: foreach fuzz_program : fuzz_programs
    +       'dummy-cmd-main.c',
    +       fuzz_program,
    +     ],
    +-    dependencies: [libgit, common_main],
    ++    dependencies: [libgit_commonmain],
    +   )
    + endforeach
    +
      ## t/helper/meson.build ##
     @@ t/helper/meson.build: test_tool_sources = [
      
 4:  172d3e07a5 <  -:  ---------- meson: stop linking libcurl into all executables
 5:  a0a1e548cc !  5:  edb9fba4b3 meson: introduce `libgit_curl` dependency
    @@ Commit message
         Simplify it by declaring a `libgit_curl` dependency that bundles all of
         it together.
     
    +    Note that we don't include curl itself as a dependency. This is because
    +    we already pull it in transitively via the libgit dependency, which is
    +    unfortunate because libgit itself shouldn't actually link against curl
    +    in the first place. This will get fixed in the next commit.
    +
         Signed-off-by: Patrick Steinhardt <ps@xxxxxx>
     
      ## meson.build ##
    @@ meson.build: bin_wrappers += executable('scalar',
     +      'http.c',
     +      'http-walker.c',
     +    ],
    -     dependencies: [libgit_commonmain, curl],
    +     dependencies: [libgit_commonmain],
     +  )
     +
     +  test_dependencies += executable('git-remote-http',
     +    sources: 'remote-curl.c',
    -+    dependencies: libgit_curl,
    ++    dependencies: [libgit_curl],
          install: true,
          install_dir: get_option('libexecdir') / 'git-core',
        )
    @@ meson.build: bin_wrappers += executable('scalar',
      
        test_dependencies += executable('git-http-fetch',
     -    sources: curl_sources + 'http-fetch.c',
    --    dependencies: [libgit_commonmain, curl],
    +-    dependencies: [libgit_commonmain],
     +    sources: 'http-fetch.c',
    -+    dependencies: libgit_curl,
    ++    dependencies: [libgit_curl],
          install: true,
          install_dir: get_option('libexecdir') / 'git-core',
        )
    @@ meson.build: bin_wrappers += executable('scalar',
        if expat.found()
          test_dependencies += executable('git-http-push',
     -      sources: curl_sources + 'http-push.c',
    --      dependencies: [libgit_commonmain, curl],
    +-      dependencies: [libgit_commonmain],
     +      sources: 'http-push.c',
    -+      dependencies: libgit_curl,
    ++      dependencies: [libgit_curl],
            install: true,
            install_dir: get_option('libexecdir') / 'git-core',
          )
    @@ meson.build: if get_option('curl').enabled()
        foreach alias : [ 'git-remote-https', 'git-remote-ftp', 'git-remote-ftps' ]
          test_dependencies += executable(alias,
     -      objects: git_remote_http.extract_all_objects(recursive: false),
    --      dependencies: [libgit, curl],
    +-      dependencies: [libgit],
     +      sources: 'remote-curl.c',
    -+      dependencies: libgit_curl,
    ++      dependencies: [libgit_curl],
          )
      
          install_symlink(alias + executable_suffix,
    @@ meson.build: if get_option('curl').enabled()
      endif
      
     -imap_send_sources = ['imap-send.c']
    --imap_send_dependencies = [libgit_commonmain]
     -if use_curl_for_imap_send
     -  imap_send_sources += curl_sources
    --  imap_send_dependencies += curl
     -endif
     -
      test_dependencies += executable('git-imap-send',
     -  sources: imap_send_sources,
    --  dependencies: imap_send_dependencies,
    +-  dependencies: [libgit_commonmain],
     +  sources: 'imap-send.c',
    -+  dependencies: use_curl_for_imap_send ? [libgit_curl] : [libgit_commonmain],
    ++  dependencies: [ use_curl_for_imap_send ? libgit_curl : libgit_commonmain ],
        install: true,
        install_dir: get_option('libexecdir') / 'git-core',
      )
 -:  ---------- >  6:  95ceafc2f4 meson: stop linking libcurl into all executables
 6:  ab55efa559 =  7:  65d00e36b8 meson: drop separate version library
 7:  7226cd6388 <  -:  ---------- meson: deduplicate the list of required programs
 8:  55a372a559 <  -:  ---------- meson: simplify setup of PATH environment variable
 -:  ---------- >  8:  3dc35872a3 meson: improve PATH handling
 -:  ---------- >  9:  e996dc571c meson: improve handling of `sane_tool_path` option
 9:  2abab952c0 ! 10:  2730e0166b meson: prevent finding sed(1) in a loop
    @@ Documentation/howto/meson.build: custom_target(
            '-e',
            '1,/^$/d',
            '@INPUT@',
    +
    + ## meson.build ##
    +@@ meson.build: endif
    + cygpath = find_program('cygpath', dirs: program_path, required: false)
    + diff = find_program('diff', dirs: program_path)
    + git = find_program('git', dirs: program_path, required: false)
    ++sed = find_program('sed', dirs: program_path)
    + shell = find_program('sh', dirs: program_path)
    + tar = find_program('tar', dirs: program_path)
    + 
    + # Sanity-check that programs required for the build exist.
    +-foreach tool : ['cat', 'cut', 'grep', 'sed', 'sort', 'tr', 'uname']
    ++foreach tool : ['cat', 'cut', 'grep', 'sort', 'tr', 'uname']
    +   find_program(tool, dirs: program_path)
    + endforeach
    + 
10:  a36529b4dd = 11:  9a54f2c2b7 meson: fix overwritten `git` variable
11:  2c60ae4349 = 12:  4604460ba2 meson: consistently use custom program paths to resolve programs
 -:  ---------- > 13:  9a6fd5435d gitlab-ci: restrict maximum number of link jobs on Windows

---
base-commit: 6dd4e543f2219290db9faa61b30f7f30a34e4b50
change-id: 20250121-b4-pks-meson-improvements-3e575363e91c





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux