patches and low-level development discussion
 help / color / mirror / code / Atom feed
From: Demi Marie Obenour <demiobenour@gmail.com>
To: Spectrum OS Development <devel@spectrum-os.org>
Cc: Alyssa Ross <hi@alyssa.is>, Demi Marie Obenour <demiobenour@gmail.com>
Subject: [PATCH] Do not ignore errors from tar
Date: Fri, 19 Sep 2025 16:13:21 -0400	[thread overview]
Message-ID: <20250919-no-ignore-tar-errors-v1-1-4e38380850d1@gmail.com> (raw)

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.

Also remove newlines that broke Vim syntax highlighting.

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 | 5 ++---
 img/app/Makefile     | 5 ++---
 vm/sys/net/Makefile  | 5 ++---
 3 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/host/rootfs/Makefile b/host/rootfs/Makefile
index b11ba50f369c3440572e06a7eaca429fbe6746a1..322d75026dbcba4301f26abfbf74efa8cc68cdfd 100644
--- a/host/rootfs/Makefile
+++ b/host/rootfs/Makefile
@@ -168,9 +168,8 @@ S6_RC_FILES = \
 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 3 && \
+	set -uo pipefail && dir=$$(mktemp -d) && \
+	    { tar -c $(S6_RC_FILES) | tar -C $$dir -x --strip-components 3; } && \
 	    s6-rc-compile $@ $$dir; \
 	    exit=$$?; rm -r $$dir; exit $$exit
 
diff --git a/img/app/Makefile b/img/app/Makefile
index c83b37364c16576e2609f5005b8a6092b644867b..8b9ecf990fe10adb7aa19b46935826d684f10686 100644
--- a/img/app/Makefile
+++ b/img/app/Makefile
@@ -116,9 +116,8 @@ VM_S6_RC_FILES = \
 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 3 && \
+	set -uo pipefail && dir=$$(mktemp -d) && \
+	    { tar -c $(VM_S6_RC_FILES) | tar -C $$dir -x --strip-components 3; } && \
 	    s6-rc-compile $@ $$dir; \
 	    exit=$$?; rm -r $$dir; exit $$exit
 
diff --git a/vm/sys/net/Makefile b/vm/sys/net/Makefile
index 79be242ea26e37d6f02af8761320de27d69d5b69..0193cc8c09f895a6021de0d02fde20362818e185 100644
--- a/vm/sys/net/Makefile
+++ b/vm/sys/net/Makefile
@@ -81,9 +81,8 @@ VM_S6_RC_FILES = \
 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 3 && \
+	set -uo pipefail && dir=$$(mktemp -d) && \
+	    { tar -c $(VM_S6_RC_FILES) | tar -C $$dir -x --strip-components 3; } && \
 	    s6-rc-compile $@ $$dir; \
 	    exit=$$?; rm -r $$dir; exit $$exit
 

---
base-commit: 15ca6c4684313fcc9fcde3bda97d64698bb267ea
change-id: 20250919-no-ignore-tar-errors-cea4c781cbbf
-- 
Sincerely,
Demi Marie Obenour (she/her/hers)


             reply	other threads:[~2025-09-19 20:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-19 20:13 Demi Marie Obenour [this message]
2025-09-21 12:06 ` [PATCH] Do not ignore errors from tar Alyssa Ross
2025-09-21 12:07 ` 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=20250919-no-ignore-tar-errors-v1-1-4e38380850d1@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).