From: Demi Marie Obenour <demiobenour@gmail.com>
To: Spectrum OS Development <devel@spectrum-os.org>
Cc: Demi Marie Obenour <demiobenour@gmail.com>, Alyssa Ross <hi@alyssa.is>
Subject: [PATCH v3 1/4] Do not ignore errors from tar
Date: Thu, 11 Sep 2025 08:47:44 -0400 [thread overview]
Message-ID: <20250911-genfiles-v3-1-d8709081dc5c@gmail.com> (raw)
In-Reply-To: <20250911-genfiles-v3-0-d8709081dc5c@gmail.com>
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.is
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; } && \
s6-rc-compile $@ $$dir; \
exit=$$?; rm -r $$dir; exit $$exit
diff --git a/img/app/Makefile b/img/app/Makefile
index 9665a6b7158f2d8b183831202a4559ae06d53d16..73db07cc4c781d9c41cdf41a6214298aae8de58a 100644
--- a/img/app/Makefile
+++ b/img/app/Makefile
@@ -117,8 +117,8 @@ build/etc/s6-rc: $(VM_S6_RC_FILES)
mkdir -p $$(dirname $@)
rm -rf $@
- dir=$$(mktemp -d) && \
- tar -c $(VM_S6_RC_FILES) | tar -C $$dir -x --strip-components 2 && \
+ set -uo pipefail; dir=$$(mktemp -d) || exit; \
+ { tar -c $(VM_S6_RC_FILES) | tar -C $$dir -x --strip-components 2; } && \
s6-rc-compile $@ $$dir; \
exit=$$?; rm -r $$dir; exit $$exit
diff --git a/vm/sys/net/Makefile b/vm/sys/net/Makefile
index 755b145175199aa97049dbd7feadc0e76230cf30..88ae20de79cd21b06263837f90310e8800b3d4e2 100644
--- a/vm/sys/net/Makefile
+++ b/vm/sys/net/Makefile
@@ -82,8 +82,8 @@ build/etc/s6-rc: $(VM_S6_RC_FILES)
mkdir -p $$(dirname $@)
rm -rf $@
- dir=$$(mktemp -d) && \
- tar -c $(VM_S6_RC_FILES) | tar -C $$dir -x --strip-components 2 && \
+ set -uo pipefail; dir=$$(mktemp -d) || exit; \
+ { tar -c $(VM_S6_RC_FILES) | tar -C $$dir -x --strip-components 2; } && \
s6-rc-compile $@ $$dir; \
exit=$$?; rm -r $$dir; exit $$exit
--
2.51.0
next prev parent reply other threads:[~2025-09-11 12:51 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-04 1:56 [PATCH 0/4] Generate file lists from a script Demi Marie Obenour
2025-09-04 1:56 ` [PATCH 1/4] Move all files for the image into a subdirectory Demi Marie Obenour
2025-09-04 1:56 ` [PATCH 2/4] Generate makefile file lists from a script Demi Marie Obenour
2025-09-08 9:59 ` Alyssa Ross
2025-09-08 18:45 ` Demi Marie Obenour
2025-09-09 14:51 ` Alyssa Ross
2025-09-04 1:56 ` [PATCH 3/4] Common make rules for building erofs images Demi Marie Obenour
2025-09-08 10:01 ` Alyssa Ross
2025-09-08 18:53 ` Demi Marie Obenour
2025-09-09 14:56 ` Alyssa Ross
2025-09-04 1:56 ` [PATCH 4/4] Use /etc/s6-rc/compiled for compiled s6-rc directory Demi Marie Obenour
2025-09-10 5:29 ` [PATCH v2 0/3] Generate file lists from a script Demi Marie Obenour
2025-09-10 5:29 ` [PATCH v2 1/3] Move all files for the image into a subdirectory Demi Marie Obenour
2025-09-10 18:58 ` Alyssa Ross
2025-09-11 12:21 ` Demi Marie Obenour
2025-09-10 5:29 ` [PATCH v2 2/3] Generate makefile file lists from a script Demi Marie Obenour
2025-09-10 5:29 ` [PATCH v2 3/3] Common make rules for building erofs images Demi Marie Obenour
2025-09-11 12:47 ` [PATCH v3 0/4] Generate file lists from a script Demi Marie Obenour
2025-09-11 12:47 ` Demi Marie Obenour [this message]
2025-09-17 11:48 ` [PATCH v3 1/4] Do not ignore errors from tar Alyssa Ross
2025-09-18 2:45 ` Demi Marie Obenour
2025-09-19 7:46 ` Alyssa Ross
2025-09-30 12:59 ` Alyssa Ross
2025-09-19 7:55 ` Alyssa Ross
2025-09-19 19:03 ` Demi Marie Obenour
2025-09-11 12:47 ` [PATCH v3 2/4] Move all files for the image into a subdirectory Demi Marie Obenour
2025-09-17 12:30 ` Alyssa Ross
2025-09-17 12:39 ` Alyssa Ross
2025-09-17 13:03 ` Alyssa Ross
2025-09-11 12:47 ` [PATCH v3 3/4] Generate makefile file lists from a script Demi Marie Obenour
2025-09-11 12:47 ` [PATCH v3 4/4] Common make rules for building erofs images Demi Marie Obenour
2025-09-21 2:23 ` [PATCH v3] Generate file lists from a script Demi Marie Obenour
2025-09-21 8:47 ` Alyssa Ross
2025-09-21 16:51 ` Demi Marie Obenour
2025-09-21 17:07 ` Alyssa Ross
2025-09-21 17:24 ` [PATCH v4] " Demi Marie Obenour
2025-09-25 11:22 ` Alyssa Ross
2025-09-26 16:31 ` [PATCH v5] " Demi Marie Obenour
2025-09-27 8:19 ` Alyssa Ross
2025-09-27 8:42 ` Demi Marie Obenour
2025-09-27 16:22 ` [PATCH v6] " Demi Marie Obenour
2025-09-29 8:12 ` Alyssa Ross
2025-09-29 17:20 ` Demi Marie Obenour
2025-09-29 17:18 ` [PATCH v7] " Demi Marie Obenour
2025-10-01 9:20 ` Alyssa Ross
2025-10-01 9:24 ` Demi Marie Obenour
2025-10-01 9:35 ` Alyssa Ross
2025-10-01 18:30 ` [PATCH v8] " Demi Marie Obenour
2025-10-02 9:46 ` Alyssa Ross
2025-10-02 17:37 ` [PATCH v9] " Demi Marie Obenour
2025-10-03 9:04 ` Alyssa Ross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250911-genfiles-v3-1-d8709081dc5c@gmail.com \
--to=demiobenour@gmail.com \
--cc=devel@spectrum-os.org \
--cc=hi@alyssa.is \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://spectrum-os.org/git/crosvm
https://spectrum-os.org/git/doc
https://spectrum-os.org/git/mktuntap
https://spectrum-os.org/git/nixpkgs
https://spectrum-os.org/git/spectrum
https://spectrum-os.org/git/ucspi-vsock
https://spectrum-os.org/git/www
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).