lib/os: graduate timespec to time.instant
Removes the local os.timespec (sec, nsec) struct in favour of
time.instant from lib/time. lib/os now `use time;`. filestat's
atime/mtime/ctime change type with byte-identical layout
(i64+i64=16B both sides), so .sec / .nsec accessors at all caller
sites work unchanged.
Rule 12: simple data + mirror Hare. Two same-layout types — one
Hare-canonical, one not — is exactly the structural divergence the
rule forbids. Single-source-of-truth; no transitional alias.
Citations: ref/hare/fs/types.ha:141 (Hare's fs::filestat carries
time::instant), ref/hare/time/instant.ha:9 (canonical layout).
Caller impact (sole reader): lib/os/stattest.ww (.sec / .nsec
unchanged; one comment line refreshed). examples/cmatrix migrated
already in 7e9bede. No selfhost/cmd/* reads mtime/atime/ctime.
Test wiring: lib/os/os.ww removed from 900_stdlib.c's standalone-
w6c-codegen list (cross-module type ref now needs the driver's
module concatenation, same reason lib/bufio and lib/fmt graduated
off earlier). Coverage stays at 976_stat_run via stattest.ww.
Makefile dep edges for the five wwstage targets gain
lib/time/time.ww so changes to it trigger wwstage rebuild.
lib/time is now in the toolchain transitive chain via lib/os. No
selfhost cmd calls time.add/time.diff today; bootstrap is safe.
Latent risk: any future selfhost edit adding time.add/time.diff
would surface task #15 (nested-if label-counter skew in lib/time/
add) as a bootstrap regression. File a fix-#15 before such an edit.
Bootstrap byte-id: ww2 == ww3 == ww4 for all five wwstage tools.
This commit is contained in:
@@ -16,7 +16,6 @@ static const char *modules[] = {
|
||||
"lib/strings/strings.ww",
|
||||
"lib/io/io.ww",
|
||||
"lib/errors/errors.ww",
|
||||
"lib/os/os.ww",
|
||||
"lib/strconv/strconv.ww",
|
||||
"lib/sort/sort.ww",
|
||||
"lib/path/path.ww",
|
||||
@@ -33,13 +32,15 @@ static const char *modules[] = {
|
||||
"lib/math/random/random.ww",
|
||||
"lib/time/time.ww",
|
||||
"lib/c/libc/libc.ww",
|
||||
/* lib/bufio/bufio.ww and lib/fmt/fmt.ww moved off this list:
|
||||
* both graduated to io.stream-based sinks, which carry cross-
|
||||
* module type refs (*io.stream, io.closed, io.eof) that only
|
||||
* resolve once the driver concatenates `use`d modules. Coverage
|
||||
* lives at lib/bufio/bufiotest.ww + lib/fmt/fmttest.ww (wired
|
||||
* at 998_bufio_run.c and 970_fmt_run.c), plus the bufio.scanline
|
||||
* and fmt.println e2e rows in test/wcc/700_e2e.c. */
|
||||
/* lib/bufio/bufio.ww, lib/fmt/fmt.ww, and lib/os/os.ww moved
|
||||
* off this list: each has cross-module type refs that only
|
||||
* resolve once the driver concatenates `use`d modules. bufio /
|
||||
* fmt graduated to io.stream-based sinks (*io.stream, io.closed,
|
||||
* io.eof); lib/os carries time.instant in filestat post-Commit B.
|
||||
* Coverage lives at lib/bufio/bufiotest.ww + lib/fmt/fmttest.ww +
|
||||
* lib/os/stattest.ww (wired at 998_bufio_run.c, 970_fmt_run.c,
|
||||
* 976_stat_run.c), plus the bufio.scanline / fmt.println e2e rows
|
||||
* in test/wcc/700_e2e.c. */
|
||||
"lib/net/net.ww",
|
||||
NULL
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user