patches and low-level development discussion
 help / color / mirror / code / Atom feed
* [PATCH] Add wrapper scripts to run make in a Nix shell
@ 2025-08-07 18:50 Demi Marie Obenour
  2025-08-08 15:00 ` Alyssa Ross
  0 siblings, 1 reply; 6+ messages in thread
From: Demi Marie Obenour @ 2025-08-07 18:50 UTC (permalink / raw)
  To: Spectrum OS Development; +Cc: Alyssa Ross, Demi Marie Obenour

It is very easy to forget to do this, and the results are confusing at
best and wrong at worst.  Add wrapper scripts that get it right and also
automatically change to the correct directory for you.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
---
 host/initramfs/run-make.sh |  1 +
 host/rootfs/run-make.sh    |  1 +
 img/app/run-make.sh        |  1 +
 release/live/run-make.sh   |  1 +
 scripts/run-make.sh        | 12 ++++++++++++
 tools/lseek/run-make.sh    |  1 +
 vm/sys/net/run-make.sh     |  1 +
 7 files changed, 18 insertions(+)

diff --git a/host/initramfs/run-make.sh b/host/initramfs/run-make.sh
new file mode 120000
index 0000000000000000000000000000000000000000..2142d230828768016cf5a4a59a895448ae3b12d9
--- /dev/null
+++ b/host/initramfs/run-make.sh
@@ -0,0 +1 @@
+../../scripts/run-make.sh
\ No newline at end of file
diff --git a/host/rootfs/run-make.sh b/host/rootfs/run-make.sh
new file mode 120000
index 0000000000000000000000000000000000000000..2142d230828768016cf5a4a59a895448ae3b12d9
--- /dev/null
+++ b/host/rootfs/run-make.sh
@@ -0,0 +1 @@
+../../scripts/run-make.sh
\ No newline at end of file
diff --git a/img/app/run-make.sh b/img/app/run-make.sh
new file mode 120000
index 0000000000000000000000000000000000000000..2142d230828768016cf5a4a59a895448ae3b12d9
--- /dev/null
+++ b/img/app/run-make.sh
@@ -0,0 +1 @@
+../../scripts/run-make.sh
\ No newline at end of file
diff --git a/release/live/run-make.sh b/release/live/run-make.sh
new file mode 120000
index 0000000000000000000000000000000000000000..2142d230828768016cf5a4a59a895448ae3b12d9
--- /dev/null
+++ b/release/live/run-make.sh
@@ -0,0 +1 @@
+../../scripts/run-make.sh
\ No newline at end of file
diff --git a/scripts/run-make.sh b/scripts/run-make.sh
new file mode 100755
index 0000000000000000000000000000000000000000..b865bb3461b5d3f192598d273cee278a76d0a6b7
--- /dev/null
+++ b/scripts/run-make.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env -S bash --
+# SPDX-License-Identifier: CC0-1.0
+# SPDX-FileCopyrightText: 2025 Demi Marie Obenour <demiobenour@gmail.com>
+set -eu
+case $0 in (/*) cd "${0%/*}/";; (*/*) cd "./${0%/*}";; esac
+if [ ! -f shell.nix ] || [ ! -f Makefile ]; then
+  echo "Must have a shell.nix and a Makefile" >&2
+  exit 1
+fi
+cmd='exec make'
+for i; do cmd+=" '"${i//\'/\'\\\'\'}\'; done
+exec nix-shell --pure --run "$cmd"
diff --git a/tools/lseek/run-make.sh b/tools/lseek/run-make.sh
new file mode 120000
index 0000000000000000000000000000000000000000..2142d230828768016cf5a4a59a895448ae3b12d9
--- /dev/null
+++ b/tools/lseek/run-make.sh
@@ -0,0 +1 @@
+../../scripts/run-make.sh
\ No newline at end of file
diff --git a/vm/sys/net/run-make.sh b/vm/sys/net/run-make.sh
new file mode 120000
index 0000000000000000000000000000000000000000..38a7b0cf91ebf669e9794d91c6962cbe882de20f
--- /dev/null
+++ b/vm/sys/net/run-make.sh
@@ -0,0 +1 @@
+../../../scripts/run-make.sh
\ No newline at end of file

---
base-commit: 39baa378367d95fac6ce4d0140b25203b2ee9b53
change-id: 20250807-make-wrapper-scripts-77231ac0c0a7
-- 
Sincerely,
Demi Marie Obenour (she/her/hers)


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

end of thread, other threads:[~2025-08-08 18:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-07 18:50 [PATCH] Add wrapper scripts to run make in a Nix shell Demi Marie Obenour
2025-08-08 15:00 ` Alyssa Ross
2025-08-08 17:32   ` Demi Marie Obenour
2025-08-08 18:02     ` Alyssa Ross
2025-08-08 18:30       ` Demi Marie Obenour
2025-08-08 18:36         ` 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).