[v2] meson: Do not automatically build documentation if sphinx-build-3 is found
diff mbox series

Message ID 20250409212747.29280-1-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • [v2] meson: Do not automatically build documentation if sphinx-build-3 is found
Related show

Commit Message

Laurent Pinchart April 9, 2025, 9:27 p.m. UTC
From: Quentin Schulz <quentin.schulz@cherry.de>

Commit aba567338b25 ("Documentation: Move all dependencies into
features") did an incomplete migration of the documentation boolean
option into a documentation feature.

If sphinx-build-3 binary is found on the host system, the documentation
is built, regardless of the value of the feature option.

This makes sure that sphinx-build-3 presence is only checked if the
documentation feature is not disabled (which is the default, as it's
"auto" by default).

This is essential for reproducibility for build systems where
sphinx-build-3 may or may not be present when libcamera is built, and
also to declutter the generated package if documentation isn't desired.

Fixes: aba567338b25 ("Documentation: Move all dependencies into features")
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---

Quentin, could you please test this version ?

---
 Documentation/meson.build | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)


base-commit: 058f589ae36170935e537910f2c303b1c3ea03b3
--
Regards,

Laurent Pinchart

Comments

Quentin Schulz April 14, 2025, 8:31 a.m. UTC | #1
Hi Laurent,

On 4/9/25 11:27 PM, Laurent Pinchart wrote:
> From: Quentin Schulz <quentin.schulz@cherry.de>
> 
> Commit aba567338b25 ("Documentation: Move all dependencies into
> features") did an incomplete migration of the documentation boolean
> option into a documentation feature.
> 
> If sphinx-build-3 binary is found on the host system, the documentation
> is built, regardless of the value of the feature option.
> 
> This makes sure that sphinx-build-3 presence is only checked if the
> documentation feature is not disabled (which is the default, as it's
> "auto" by default).
> 
> This is essential for reproducibility for build systems where
> sphinx-build-3 may or may not be present when libcamera is built, and
> also to declutter the generated package if documentation isn't desired.
> 
> Fixes: aba567338b25 ("Documentation: Move all dependencies into features")
> Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[merged both find_program into one]
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Buildroot prints

Program sphinx-build-3 sphinx-build skipped: feature documentation disabled

So this seems to be working fine!

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Tested-by: Quentin Schulz <quentin.schulz@cherry.de>

Thanks!
Quentin
Kieran Bingham April 14, 2025, 1:20 p.m. UTC | #2
Quoting Laurent Pinchart (2025-04-09 22:27:47)
> From: Quentin Schulz <quentin.schulz@cherry.de>
> 
> Commit aba567338b25 ("Documentation: Move all dependencies into
> features") did an incomplete migration of the documentation boolean
> option into a documentation feature.
> 
> If sphinx-build-3 binary is found on the host system, the documentation
> is built, regardless of the value of the feature option.
> 
> This makes sure that sphinx-build-3 presence is only checked if the
> documentation feature is not disabled (which is the default, as it's
> "auto" by default).
> 
> This is essential for reproducibility for build systems where
> sphinx-build-3 may or may not be present when libcamera is built, and
> also to declutter the generated package if documentation isn't desired.
> 
> Fixes: aba567338b25 ("Documentation: Move all dependencies into features")
> Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> 
> Quentin, could you please test this version ?
> 
> ---
>  Documentation/meson.build | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/meson.build b/Documentation/meson.build
> index 6158320e177c..0fc5909d088e 100644
> --- a/Documentation/meson.build
> +++ b/Documentation/meson.build
> @@ -116,10 +116,8 @@ endif
>  # Sphinx
>  #
> 
> -sphinx = find_program('sphinx-build-3', required : false)
> -if not sphinx.found()
> -    sphinx = find_program('sphinx-build', required : get_option('documentation'))
> -endif
> +sphinx = find_program('sphinx-build-3', 'sphinx-build',
> +                      required : get_option('documentation'))

eeep, that looks better.


Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> 
>  if sphinx.found()
>      docs_sources = [
> 
> base-commit: 058f589ae36170935e537910f2c303b1c3ea03b3
> --
> Regards,
> 
> Laurent Pinchart
>

Patch
diff mbox series

diff --git a/Documentation/meson.build b/Documentation/meson.build
index 6158320e177c..0fc5909d088e 100644
--- a/Documentation/meson.build
+++ b/Documentation/meson.build
@@ -116,10 +116,8 @@  endif
 # Sphinx
 #

-sphinx = find_program('sphinx-build-3', required : false)
-if not sphinx.found()
-    sphinx = find_program('sphinx-build', required : get_option('documentation'))
-endif
+sphinx = find_program('sphinx-build-3', 'sphinx-build',
+                      required : get_option('documentation'))

 if sphinx.found()
     docs_sources = [