~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
1

[PATCH hare v2] cmd/hare: Skip replacing the output file if possible

Details
Message ID
<20241231202835.20203-2-yyp@disroot.org>
DKIM signature
pass
Download raw message
Patch: +17 -0
Fixes: https://todo.sr.ht/~sircmpwn/hare/953
Signed-off-by: Alexey Yerin <yyp@disroot.org>
---
v1 -> v2: genbootstrap strikes again

 cmd/hare/build.ha | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/cmd/hare/build.ha b/cmd/hare/build.ha
index bc6589a7..07b9553a 100644
--- a/cmd/hare/build.ha
+++ b/cmd/hare/build.ha
@@ -20,6 +20,7 @@ use os;
use path;
use strconv;
use strings;
use time;
use unix::tty;

fn build(name: str, cmd: *getopt::command) (void | error) = {
@@ -194,6 +195,22 @@ fn build(name: str, cmd: *getopt::command) (void | error) = {

	let dest = os::stdout_file;
	if (output != "-") {
		match (os::stat(output)) {
		case let output_stat: fs::filestat =>
			let output_mtime = output_stat.mtime;
			match (os::stat(built)) {
			case let built_stat: fs::filestat =>
				let built_mtime = built_stat.mtime;
				// Avoid replacing the destination file if it's
				// already up-to-date
				if (time::compare(output_mtime, built_mtime) >= 0) {
					return;
				};
			case fs::error => void;
			};
		case fs::error => void;
		};

		let mode: fs::mode = 0o644;
		if (ctx.goal == build::stage::BIN) {
			mode |= 0o111;
-- 
2.47.1

[hare/patches] build failed

builds.sr.ht <builds@sr.ht>
Details
Message ID
<D6Q659WZENJZ.QSCJ24EBZPRQ@fra01>
In-Reply-To
<20241231202835.20203-2-yyp@disroot.org> (view parent)
DKIM signature
missing
Download raw message
hare/patches: FAILED in 1m6s

[cmd/hare: Skip replacing the output file if possible][0] v2 from [Alexey Yerin][1]

[0]: https://lists.sr.ht/~sircmpwn/hare-dev/patches/56714
[1]: yyp@disroot.org

✓ #1399637 SUCCESS hare/patches/netbsd.yml  https://builds.sr.ht/~sircmpwn/job/1399637
✓ #1399638 SUCCESS hare/patches/openbsd.yml https://builds.sr.ht/~sircmpwn/job/1399638
✓ #1399636 SUCCESS hare/patches/freebsd.yml https://builds.sr.ht/~sircmpwn/job/1399636
✗ #1399635 FAILED  hare/patches/alpine.yml  https://builds.sr.ht/~sircmpwn/job/1399635
Reply to thread Export thread (mbox)