~sircmpwn/hare-dev

hare: hare build: create empty td file if necessary v1 APPLIED

Ember Sawady: 1
 hare build: create empty td file if necessary

 1 files changed, 1 insertions(+), 3 deletions(-)
#1143805 alpine.yml failed
#1143806 freebsd.yml success
#1143807 openbsd.yml failed
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/hare-dev/patches/49205/mbox | git am -3
Learn more about email & git

[PATCH hare] hare build: create empty td file if necessary Export this patch

we can decide whether to make modules without hare sources illegal to
import later, but the simplest thing to do is to just make them work as
you'd expect
the reason this caused an abort earlier is that the os::open() for the
temporary td would fail and cleanup_ssa_task would return before
initializing ctx.hashes[mod][stage::TD], such that when the run_task for
the module that depended on it called get_deps(), the
get_cache(..., stage::TD) failed

Fixes: https://todo.sr.ht/~sircmpwn/hare/909
Signed-off-by: Ember Sawady <ecs@d2evs.net>
---
supersedes Enno's patch which makes this an error
 cmd/hare/build/queue.ha | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/cmd/hare/build/queue.ha b/cmd/hare/build/queue.ha
index 56696672..e143aecd 100644
--- a/cmd/hare/build/queue.ha
+++ b/cmd/hare/build/queue.ha
@@ -279,11 +279,9 @@ fn cleanup_ssa_task(ctx: *context, t: *task, out: str) (void | error) = {
	let tmp = strings::concat(out, ".td.tmp");
	defer free(tmp);

	let f = match (os::open(tmp)) {
	let f = match (os::create(tmp, 0o644, fs::flag::RDWR)) {
	case let f: io::file =>
		yield f;
	case errors::noentry =>
		return;
	case let err: fs::error =>
		return err;
	};
-- 
2.43.0
hare/patches: FAILED in 1m22s

[hare build: create empty td file if necessary][0] from [Ember Sawady][1]

[0]: https://lists.sr.ht/~sircmpwn/hare-dev/patches/49205
[1]: mailto:ecs@d2evs.net

✗ #1143805 FAILED  hare/patches/alpine.yml  https://builds.sr.ht/~sircmpwn/job/1143805
✗ #1143807 FAILED  hare/patches/openbsd.yml https://builds.sr.ht/~sircmpwn/job/1143807
✓ #1143806 SUCCESS hare/patches/freebsd.yml https://builds.sr.ht/~sircmpwn/job/1143806
Thanks!

To gitsrht:~sircmpwn/hare
   eac36b91..d61cd911  master -> master