~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 v2] hare/build: Print arguments of failed command

Details
Message ID
<20231002202541.24992-1-contact+sr.ht@hacktivis.me>
DKIM signature
missing
Download raw message
Patch: +11 -3
From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me>

---
 cmd/hare/build/queue.ha | 13 ++++++++++---
 cmd/hare/build/types.ha |  1 +
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/cmd/hare/build/queue.ha b/cmd/hare/build/queue.ha
index 973f9350..82731164 100644
--- a/cmd/hare/build/queue.ha
+++ b/cmd/hare/build/queue.ha
@@ -125,7 +125,6 @@ fn run_task(ctx: *context, jobs: *[]job, t: *task) (bool | error) = {
	io::trunc(lock, 0)?;

	let args = get_args(ctx, tmp, flags, t);
	defer strings::freeall(args);

	path::set(&buf, out)?;
	write_args(ctx, path::push_ext(&buf, "txt")?, args, t)?;
@@ -179,6 +178,7 @@ fn run_task(ctx: *context, jobs: *[]job, t: *task) (bool | error) = {
		pid = exec::start(&cmd)?,
		task = t,
		lock = lock,
		args = args,
	});
	return true;
};
@@ -199,6 +199,7 @@ fn await_task(ctx: *context, jobs: *[]job) (size | void | error) = {
	assert(i < len(jobs), "Unknown PID returned from waitany");
	let j = jobs[i];
	let t = j.task;
	defer strings::freeall(j.args);
	static delete(jobs[i]);

	let out = get_cache(ctx, t.idx, t.kind)?;
@@ -222,8 +223,14 @@ fn await_task(ctx: *context, jobs: *[]job) (size | void | error) = {
		if (ctx.mode == output::DEFAULT) {
			fmt::errorln()?;
		};
		fmt::fatal(ctx.mods[t.idx].name, ctx.cmds[t.kind],
			exec::exitstr(e));

		fmt::errorf("Failed {} job ({}), command: {} ",
			ctx.mods[t.idx].name, exec::exitstr(e), ctx.cmds[t.kind])?;
		for (let i = 0z; i < len(j.args); i += 1) {
			fmt::error(" ")?;
			shlex::quote(os::stderr, j.args[i])?;
		};
		fmt::fatal();
	};

	cleanup_task(ctx, t)?;
diff --git a/cmd/hare/build/types.ha b/cmd/hare/build/types.ha
index 43470df5..2748ed67 100644
--- a/cmd/hare/build/types.ha
+++ b/cmd/hare/build/types.ha
@@ -51,6 +51,7 @@ export type job = struct {
	// fd to be closed once the job has finished, in order to release the
	// [[io::lock]] on it
	lock: io::file,
	args: []str,
};

export type output = enum {
-- 
2.41.0

[hare/patches] build success

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

[hare/build: Print arguments of failed command][0] v2 from [Haelwenn (lanodan) Monnier][1]

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

✓ #1067207 SUCCESS hare/patches/freebsd.yml https://builds.sr.ht/~sircmpwn/job/1067207
✓ #1067206 SUCCESS hare/patches/alpine.yml  https://builds.sr.ht/~sircmpwn/job/1067206
Details
Message ID
<CVYL0FDMXXHJ.42N5COE3SVA8@d2evs.net>
In-Reply-To
<20231002202541.24992-1-contact+sr.ht@hacktivis.me> (view parent)
DKIM signature
missing
Download raw message
-1, you can use -vv (optionally with -j1) if you want to get the command
line for the thing that failed
Reply to thread Export thread (mbox)