Re: [RFC] [PATCH yocto-autobuilder-helper] scripts: run-docs-build: make the script fail hard ASAP when there's an error

Michael Opdenacker

Hi Quentin,

On 2/23/22 12:31, Quentin Schulz wrote:
From: Quentin Schulz <quentin.schulz@...>

There are some intermittent issues with the script not publishing all
versions. So let's go extreme and fail the script if any error happens:
- a command returns a non-zero code, even if piped,
- a variable is used uninitialized,

This also makes the script print each and every command being run so we
have a better idea where the script struggles.

Cc: Quentin Schulz <foss+yocto@...>
Signed-off-by: Quentin Schulz <quentin.schulz@...>

- I highly suspect this change to break the building script because
Sphinx probably throws errors at old doc builds,
- Also, with Sphinx updates, new warnings might arrise on
old/unmaintained branches, we probably want to use virtualenv with
specific Sphinx versions to make sure this is not an issue in the
future? (and allows to bump Sphinx (or other dependencies) requirement
for newer doc branches),

scripts/run-docs-build | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/scripts/run-docs-build b/scripts/run-docs-build
index 3bc35b3..b7b5773 100755
--- a/scripts/run-docs-build
+++ b/scripts/run-docs-build
@@ -2,6 +2,12 @@
# Called with $1 as the build directory
# $2 as the path to yocto-docs
# $3 as the path to bitbake
+set -e
+set -u
+set -o pipefail
+set -x
Agreeing with the change.
How would we get the script output?


Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering

Join to automatically receive all group messages.