ref: bd96cb6a0a361a62871f70c07fc350bc2264b087
parent: fd499b39fd02fa18c403a423e908bd39b1e8013d
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Aug 13 21:17:41 EDT 2017
Mbld now generates directories properly. Includes some mkdirs fixes for 9front.
--- a/lib/std/syswrap+plan9.myr
+++ b/lib/std/syswrap+plan9.myr
@@ -135,7 +135,7 @@
if sys.stat(path, buf[:]) < Stringsoff
-> `Err Emisc
;;
- -> `Ok (_getle32(buf[Mtimeoff:Mtimeoff + 8]) : time)
+ -> `Ok ((_getle32(buf[Mtimeoff:Mtimeoff + 8]) : time)*1_000_000)
}
const fsize = {path
--- a/lib/std/syswrap-ss+plan9.myr
+++ b/lib/std/syswrap-ss+plan9.myr
@@ -74,7 +74,7 @@
err = cstrconv(errbuf[:])
if strhas(err, "no error")
-> Enone
- elif strhas(err, "already exists")
+ elif strhas(err, "already exists") || strhas(err, "is a directory")
-> Eexist
elif strhas(err, "read or write too large")
-> Erange
--- a/mbld/build.myr
+++ b/mbld/build.myr
@@ -71,6 +71,7 @@
var pid
if stale(b, n)
+ mkout(n)
pid = run(n.cmd, "")
std.htput(b.proc, pid, n)
else
@@ -119,7 +120,6 @@
std.slpush(&b.queue, g)
;;
;;
-
}
const stale = {b, n
@@ -137,7 +137,13 @@
| `std.Err e: n.mtime = 0
;;
;;
- -> staletime >= n.mtime
+ -> staletime > n.mtime
+}
+
+const mkout = {n
+ for g : n.gen
+ std.mkpath(std.dirname(g))
+ ;;
}
const fail = {b, pid, failtype