patches and low-level development discussion
 help / color / mirror / code / Atom feed
* [PATCH] Do not ignore errors from tar
@ 2025-09-19 20:13 Demi Marie Obenour
  2025-09-21 12:06 ` Alyssa Ross
  2025-09-21 12:07 ` Alyssa Ross
  0 siblings, 2 replies; 3+ messages in thread
From: Demi Marie Obenour @ 2025-09-19 20:13 UTC (permalink / raw)
  To: Spectrum OS Development; +Cc: Alyssa Ross, Demi Marie Obenour

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)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-09-21 12:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-19 20:13 [PATCH] Do not ignore errors from tar Demi Marie Obenour
2025-09-21 12:06 ` Alyssa Ross
2025-09-21 12:07 ` Alyssa Ross

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).