Demi Marie Obenour <demiobenour@gmail.com> writes:
These would be ignored due to a missing -o pipefail in the shell script. As a result, listing nonexistent s6-rc-compile inputs would cause a broken image to be successfully built.
Reported-by: Alyssa Ross <hi@alyssa.is> Link: https://spectrum-os.org/lists/archives/spectrum-devel/87segu879h.fsf@alyssa.... Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com> --- host/rootfs/Makefile | 4 ++-- img/app/Makefile | 4 ++-- vm/sys/net/Makefile | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/host/rootfs/Makefile b/host/rootfs/Makefile index e96458dba06ae31129b115b2b649962f8d88187a..2288ae4d22ca817ba9fe8ebfc42326fe38b27c27 100644 --- a/host/rootfs/Makefile +++ b/host/rootfs/Makefile @@ -169,8 +169,8 @@ build/etc/s6-rc: $(S6_RC_FILES) mkdir -p $$(dirname $@) rm -rf $@
- dir=$$(mktemp -d) && \ - tar -c $(S6_RC_FILES) | tar -C $$dir -x --strip-components 2 && \ + set -uo pipefail; dir=$$(mktemp -d) || exit; \ + { tar -c $(S6_RC_FILES) | tar -C $$dir -x --strip-components 2; } && \
Why do we need to change `dir=$(mktemp -d) &&` to `dir=$(mktemp -d) || exit;`? In my testing we'll jump to the rm/exit with the former, which seems like the right thing.