{"thread":{"id":"63142","subject":"[PATCH] meson: fix perl detection when docs are enabled, but perl bindings aren't","startedAt":"2025-03-16T06:06:22Z","lastAt":"2025-03-17T14:01:20Z","messageCount":2,"participants":["Eli Schwartz","Patrick Steinhardt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"514377","messageId":"20250316060605.166364-1-eschwartz@gentoo.org","threadId":"63142","inReplyTo":null,"subject":"[PATCH] meson: fix perl detection when docs are enabled, but perl bindings aren't","fromName":"Eli Schwartz","fromEmail":"eschwartz@gentoo.org","sentAt":"2025-03-16T06:06:05Z","receivedAt":"2025-03-16T06:06:22Z","isPatch":true,"sender":{"key":"eschwartz@gentoo.org","avatar":"https://avatars.githubusercontent.com/u/6551424?v=4"},"body":"The `perl` variable in meson.build is assigned to a program lookup,\nwhich may have the value \"not-found object\" if configuring with\n`-Dperl=disabled`.\n\nThere is already a list of other cases where we do need a perl command,\neven when not building perl bindings. Building documentation should be\none of those cases, but was missing from the list. Add it.\n\nFixes:\n\n```\n$ meson setup builddir/ -Ddocs=man -Dperl=disabled -Dtests=false\n[...]\nDocumentation/meson.build:308:22: ERROR: Tried to use not-found external program in \"command\"\n```\n\nBug: https://bugs.gentoo.org/949247\nSigned-off-by: Eli Schwartz <eschwartz@gentoo.org>\n---\n meson.build | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/meson.build b/meson.build\nindex efe2871c9d..c6241c7a12 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -772,7 +772,7 @@ endif\n # features. It is optional if you want to neither execute tests nor use any of\n # these optional features.\n perl_required = get_option('perl')\n-if get_option('tests') or get_option('gitweb').enabled() or 'netrc' in get_option('credential_helpers')\n+if get_option('tests') or get_option('gitweb').enabled() or 'netrc' in get_option('credential_helpers') or get_option('docs') != []\n   perl_required = true\n endif\n \n-- \n2.48.1\n\n"},{"id":"514407","messageId":"Z9grLNimSDd8-Pen@pks.im","threadId":"63142","inReplyTo":"20250316060605.166364-1-eschwartz@gentoo.org","subject":"Re: [PATCH] meson: fix perl detection when docs are enabled, but perl bindings aren't","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-03-17T14:01:16Z","receivedAt":"2025-03-17T14:01:20Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Sun, Mar 16, 2025 at 02:06:05AM -0400, Eli Schwartz wrote:\n> The `perl` variable in meson.build is assigned to a program lookup,\n> which may have the value \"not-found object\" if configuring with\n> `-Dperl=disabled`.\n> \n> There is already a list of other cases where we do need a perl command,\n> even when not building perl bindings. Building documentation should be\n> one of those cases, but was missing from the list. Add it.\n> \n> Fixes:\n> \n> ```\n> $ meson setup builddir/ -Ddocs=man -Dperl=disabled -Dtests=false\n> [...]\n> Documentation/meson.build:308:22: ERROR: Tried to use not-found external program in \"command\"\n> ```\n> \n> Bug: https://bugs.gentoo.org/949247\n\nNit: we typically don't include Bug trailers.\n\n> Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>\n> ---\n>  meson.build | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/meson.build b/meson.build\n> index efe2871c9d..c6241c7a12 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -772,7 +772,7 @@ endif\n>  # features. It is optional if you want to neither execute tests nor use any of\n>  # these optional features.\n>  perl_required = get_option('perl')\n> -if get_option('tests') or get_option('gitweb').enabled() or 'netrc' in get_option('credential_helpers')\n> +if get_option('tests') or get_option('gitweb').enabled() or 'netrc' in get_option('credential_helpers') or get_option('docs') != []\n>    perl_required = true\n>  endif\n\nThis change does indeed make sense. We require Perl in order to generate\ncommand lists. Ideally we would get rid of this dependency so that it\ndoes become possible to build documentation without Perl, as this is the\nonly part of the build system that requires it. But until then I'm fine\nwith making the requirement explicit here.\n\nPatrick\n"}]}