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

Re: [PATCH v2 2/2] meson: fix Perl version check for Meson versions before 1.7.0

From
Patrick Steinhardt <ps@pks.im>
Date
Jan 27, 2025, 07:39 UTC
Message-ID
<Z5c4OzzHWOo30Hu6@pks.im>
In-Reply-To
<20250124163049.23965-3-git@mavit.org.uk>
On Fri, Jan 24, 2025 at 04:30:49PM +0000, Peter Oliver wrote:
Show 13 quoted lines
> diff --git a/meson.build b/meson.build
> index f01d81b39f..80af578d36 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -755,7 +755,11 @@ endif
>  
>  # Note that we only set NO_PERL if the Perl features were disabled by the user.
>  # It may not be set when we have found Perl, but only use it to run tests.
> -perl = find_program('perl', version: '>=5.26.0', dirs: program_path, required: perl_required)
> +if meson.version().version_compare('>=1.5.0')
> +  perl = find_program('perl', dirs: program_path, required: perl_required, version: '>=5.26.0', version_argument: '-V:version')
> +else
> +  perl = find_program('perl', dirs: program_path, required: perl_required, version: '>=26')

I'm still a bit sceptical whether we should adapt this second line to match against `>=26`. I guess as long as it doesn't break anything out there it's okayish, and if we do see breakage we can in the worst case revert it.

In any case, it deserves a comment why we're matching against the minor version and not the whole version. E.g. something like this:

    # Executing `perl --version` results in a string similar to the
    # following output:
    #
    #     This is perl 5, version 40, subversion 0 (v5.40.0) built for x86_64-linux-thread-multi
    #
    # Meson picks up the "40" as version number instead of using "v5.40.0"
    # due to the regular expression it uses. This got fixed in Meson 1.7.0,
    # but meanwhile we have to either use `-V:version` instead of `--version`,
    # which we can do starting with Meson 1.5.0 and newer, or we have to
    # match against the minor version.
Thanks!
Patrick
Previous: Peter OliverNext: Peter Oliver
Message 8 of 16 in “Check for Perl 5.26.0 from Meson build”
  1. 1/2 Check for Perl 5.26.0 from Meson buildPeter Oliver, Jan 20, 2025
  2. 2/2 Fix Meson Perl version checkPeter Oliver, Jan 20, 2025
  3. Patrick SteinhardtJan 21, 2025
  4. Patrick SteinhardtJan 21, 2025
  5. 0/2 Fix Meson Perl version checkPeter Oliver, Jan 24, 2025
  6. 1/2 meson: bump minimum required Perl version to 5.26.0Peter Oliver, Jan 24, 2025
  7. 2/2 meson: fix Perl version check for Meson versions before 1.7.0Peter Oliver, Jan 24, 2025
  8. Patrick SteinhardtJan 27, 2025
  9. 0/2 Fix Meson Perl version checkPeter Oliver, Feb 18, 2025
  10. 1/2 meson: bump minimum required Perl version to 5.26.0Peter Oliver, Feb 18, 2025
  11. 2/2 meson: fix Perl version check for Meson versions before 1.7.0Peter Oliver, Feb 18, 2025
  12. Junio C HamanoFeb 18, 2025
  13. Patrick SteinhardtFeb 19, 2025
  14. Junio C HamanoFeb 19, 2025
  15. Peter OliverFeb 25, 2025
  16. Junio C HamanoFeb 25, 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.