* [PATCH openbmc-build-scripts] build-setup: Ensure we fail the build when a step fails
@ 2016-02-12 5:20 OpenBMC Patches
2016-02-12 5:20 ` OpenBMC Patches
0 siblings, 1 reply; 4+ messages in thread
From: OpenBMC Patches @ 2016-02-12 5:20 UTC (permalink / raw)
To: openbmc
Signed-off-by: Joel Stanley <joel@jms.id.au>
https://github.com/openbmc/openbmc-build-scripts/pull/3
Joel Stanley (1):
build-setup: Ensure we fail the build when a step fails
build-setup.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--
2.7.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH openbmc-build-scripts] build-setup: Ensure we fail the build when a step fails
2016-02-12 5:20 [PATCH openbmc-build-scripts] build-setup: Ensure we fail the build when a step fails OpenBMC Patches
@ 2016-02-12 5:20 ` OpenBMC Patches
2016-02-12 12:48 ` Daniel Axtens
0 siblings, 1 reply; 4+ messages in thread
From: OpenBMC Patches @ 2016-02-12 5:20 UTC (permalink / raw)
To: openbmc
From: Joel Stanley <joel@jms.id.au>
Signed-off-by: Joel Stanley <joel@jms.id.au>
---
build-setup.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/build-setup.sh b/build-setup.sh
index a96ed44..f2a37fa 100755
--- a/build-setup.sh
+++ b/build-setup.sh
@@ -7,8 +7,8 @@
# distro = fedora|ubuntu
# WORKSPACE =
-# Trace bash processing
-set -x
+# Trace bash processing. Set -e so when a step fails, we fail the build
+set -xe
# Default variables
target=${target:-qemu}
@@ -100,7 +100,7 @@ mkdir -p ${WORKSPACE}
cat > "${WORKSPACE}"/build.sh << EOF_SCRIPT
#!/bin/bash
-set -x
+set -ex
cd ${WORKSPACE}
--
2.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH openbmc-build-scripts] build-setup: Ensure we fail the build when a step fails
2016-02-12 5:20 ` OpenBMC Patches
@ 2016-02-12 12:48 ` Daniel Axtens
2016-02-15 0:01 ` Joel Stanley
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Axtens @ 2016-02-12 12:48 UTC (permalink / raw)
To: OpenBMC Patches, openbmc
Hi Joel,
This is an excellent idea.
When writing bash scripts I tend to use the invocation from
http://redsymbol.net/articles/unofficial-bash-strict-mode/
i.e.
set -euo pipefail
Which will give you:
- failing when a step fails (-e)
- failing on undefined variables (-u)
- failing when a command in a pipe fails (-o pipefail) - the default
behaviour is to use the exit code of the final command in the pipe.
That might be an improvement over just using -e?
Regards,
Daniel
OpenBMC Patches <openbmc-patches@stwcx.xyz> writes:
> From: Joel Stanley <joel@jms.id.au>
>
> Signed-off-by: Joel Stanley <joel@jms.id.au>
> ---
> build-setup.sh | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/build-setup.sh b/build-setup.sh
> index a96ed44..f2a37fa 100755
> --- a/build-setup.sh
> +++ b/build-setup.sh
> @@ -7,8 +7,8 @@
> # distro = fedora|ubuntu
> # WORKSPACE =
>
> -# Trace bash processing
> -set -x
> +# Trace bash processing. Set -e so when a step fails, we fail the build
> +set -xe
>
> # Default variables
> target=${target:-qemu}
> @@ -100,7 +100,7 @@ mkdir -p ${WORKSPACE}
> cat > "${WORKSPACE}"/build.sh << EOF_SCRIPT
> #!/bin/bash
>
> -set -x
> +set -ex
>
> cd ${WORKSPACE}
>
> --
> 2.7.1
>
>
> _______________________________________________
> openbmc mailing list
> openbmc@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/openbmc
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH openbmc-build-scripts] build-setup: Ensure we fail the build when a step fails
2016-02-12 12:48 ` Daniel Axtens
@ 2016-02-15 0:01 ` Joel Stanley
0 siblings, 0 replies; 4+ messages in thread
From: Joel Stanley @ 2016-02-15 0:01 UTC (permalink / raw)
To: Daniel Axtens; +Cc: OpenBMC Patches, OpenBMC Maillist
On Fri, Feb 12, 2016 at 11:18 PM, Daniel Axtens <dja@axtens.net> wrote:
> When writing bash scripts I tend to use the invocation from
> http://redsymbol.net/articles/unofficial-bash-strict-mode/
> i.e.
>
> set -euo pipefail
Thanks. I updated the build script; can you take a second look?
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-02-15 0:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-12 5:20 [PATCH openbmc-build-scripts] build-setup: Ensure we fail the build when a step fails OpenBMC Patches
2016-02-12 5:20 ` OpenBMC Patches
2016-02-12 12:48 ` Daniel Axtens
2016-02-15 0:01 ` Joel Stanley
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.