~sircmpwn/hare-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH hare] cmd/hare: Print error with command on exec::nocmd

Details
Message ID
<20230912061733.27942-1-contact+sr.ht@hacktivis.me>
DKIM signature
pass
Download raw message
Patch: +16 -2
From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me>

---
 cmd/hare/build.ha       | 9 ++++++++-
 cmd/hare/build/queue.ha | 9 ++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/cmd/hare/build.ha b/cmd/hare/build.ha
index c08db316..8d583ccb 100644
--- a/cmd/hare/build.ha
+++ b/cmd/hare/build.ha
@@ -176,7 +176,14 @@ fn build(name: str, cmd: *getopt::command) (void | error) = {

fn run(name: str, path: str, args: []str) error = {
	const args: []str = if (len(args) != 0) args[1..] else [];
	let cmd = exec::cmd(path, args...)?;
	let cmd = match(exec::cmd(path, args...)) {
	case exec::nocmd =>
		fmt::fatalf("Error: Command not found: {}", path);
	case let e: exec::error =>
		return e;
	case let c: exec::command =>
		yield c;
	};
	exec::setname(&cmd, name);
	exec::exec(&cmd);
};
diff --git a/cmd/hare/build/queue.ha b/cmd/hare/build/queue.ha
index ce5e8bbc..3653254e 100644
--- a/cmd/hare/build/queue.ha
+++ b/cmd/hare/build/queue.ha
@@ -159,7 +159,14 @@ fn run_task(ctx: *context, jobs: *[]job, t: *task) (bool | error) = {
		fmt::errorln()?;
	};

	let cmd = exec::cmd(ctx.cmds[t.kind], args...)?;
	let cmd = match(exec::cmd(ctx.cmds[t.kind], args...)) {
	case exec::nocmd =>
		fmt::fatalf("Error: Command not found: {}", ctx.cmds[t.kind]);
	case let e: exec::error =>
		return e;
	case let c: exec::command =>
		yield c;
	};
	path::set(&buf, out)?;
	let output = os::create(path::push_ext(&buf, "log")?, 0o644)?;
	defer io::close(output)!;
-- 
2.41.0

[hare/patches] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CVGPYGO0N4O7.2NWQC3NN6KUW4@cirno2>
In-Reply-To
<20230912061733.27942-1-contact+sr.ht@hacktivis.me> (view parent)
DKIM signature
missing
Download raw message
hare/patches: SUCCESS in 1m24s

[cmd/hare: Print error with command on exec::nocmd][0] from [Haelwenn (lanodan) Monnier][1]

[0]: https://lists.sr.ht/~sircmpwn/hare-dev/patches/44591
[1]: contact+sr.ht@hacktivis.me

✓ #1056512 SUCCESS hare/patches/freebsd.yml https://builds.sr.ht/~sircmpwn/job/1056512
✓ #1056511 SUCCESS hare/patches/alpine.yml  https://builds.sr.ht/~sircmpwn/job/1056511
Details
Message ID
<CVGQW03NJB4X.T2CGSNTZDZL5@taiga>
In-Reply-To
<20230912061733.27942-1-contact+sr.ht@hacktivis.me> (view parent)
DKIM signature
pass
Download raw message
Thanks!

To git@git.sr.ht:~sircmpwn/hare
   fedd4ea7..766d4b06  master -> master
Reply to thread Export thread (mbox)