Skip to contentSkip to conversation

meson: fix perl detection when docs are enabled, but perl bindings aren't

PATCH In review Eli Schwartz 2 participants 2 messages Mar 16, 2025 – Mar 17, 2025 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 meson: fix perl detection when docs are enabled, but perl bindings aren't

The perl variable in meson.build is assigned to a program lookup, which may have the value "not-found object" if configuring with -Dperl=disabled.

There is already a list of other cases where we do need a perl command, even when not building perl bindings. Building documentation should be one of those cases, but was missing from the list. Add it.

Fixes:

```
$ meson setup builddir/ -Ddocs=man -Dperl=disabled -Dtests=false
[...]
Documentation/meson.build:308:22: ERROR: Tried to use not-found external program in "command"
```
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meson.build +1 -1
index efe2871c9d..c6241c7a12 100644
@@ -772,7 +772,7 @@ endif
 # features. It is optional if you want to neither execute tests nor use any of
 # these optional features.
 perl_required = get_option('perl')
-if get_option('tests') or get_option('gitweb').enabled() or 'netrc' in get_option('credential_helpers')
+if get_option('tests') or get_option('gitweb').enabled() or 'netrc' in get_option('credential_helpers') or get_option('docs') != []
   perl_required = true
 endif
 
Signature · 1 line
2.48.1
#1 lore raw
Quoted 10 lines · Eli Schwartz

The perl variable in meson.build is assigned to a program lookup, which may have the value "not-found object" if configuring with -Dperl=disabled.

There is already a list of other cases where we do need a perl command, even when not building perl bindings. Building documentation should be one of those cases, but was missing from the list. Add it.

Fixes:

Quoted 7 lines
```
$ meson setup builddir/ -Ddocs=man -Dperl=disabled -Dtests=false
[...]
Documentation/meson.build:308:22: ERROR: Tried to use not-found external program in "command"
```

Nit: we typically don't include Bug trailers.

Quoted 10 lines
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meson.build +0 -0
index efe2871c9d..c6241c7a12 100644

meson.build endif · line 777

Quoted 7 lines
meson.build +1 -1
@@ -772,7 +772,7 @@ endif
 # features. It is optional if you want to neither execute tests nor use any of
 # these optional features.
 perl_required = get_option('perl')
-if get_option('tests') or get_option('gitweb').enabled() or 'netrc' in get_option('credential_helpers')
+if get_option('tests') or get_option('gitweb').enabled() or 'netrc' in get_option('credential_helpers') or get_option('docs') != []
   perl_required = true
 endif

This change does indeed make sense. We require Perl in order to generate command lists. Ideally we would get rid of this dependency so that it does become possible to build documentation without Perl, as this is the only part of the build system that requires it. But until then I'm fine with making the requirement explicit here.

Patrick