rm dead combined.ww + retarget 901 to sep-feed; sweep amalgamator remnants (M4 E4, #90)
The E3 flip (#87) made sep the sole compile path and deleted the
combined.ww writer, leaving the six committed *.combined.ww files dead.
Remove them and the last references to the retired amalgamator.
- rm the 6 tracked *.combined.ww (selfhost/cmd/{w6a,w6c,w6l,ww,wwdump}/
main.combined.ww + selfhost/test/smoke.combined.ww). Verified no live
build path or gate still feeds one as compiler INPUT.
- 901_asserttyped_gap: its 5 combined.ww gap fixtures were the last
combined.ww INPUT consumers (4 already missing/vacuous post-flip, only
smoke.combined.ww still fed). Retarget all 5 to sep-feed via a
resolveunit helper (whole-package-dir copy -> `ww build --sep` ->
<stem>.sepwork/__root.unit.ww), mirroring 990's #89 pattern; the 3
import-free test fixtures stay raw-fed. All 8 counts hold at 0 (A-D
coverage, vacuous since the flip, is live again).
- INV-2 (the driver's unresolvable-import-is-fatal guard) is KEPT; only
its "Mirrors the deleted expand" lineage tail is swept. The #110
combined_ww_fresh freshness gate was already removed in #89 (5f85852).
- Sweep dangling amalgamator lineage comments (build_one/buildone/expand/
peek_package/peekpackage + stale combined.ww/combined intermediates)
in cmd/ww/main.c + selfhost/cmd/ww/main.ww, symmetrically (rule-10),
and the stale Makefile combined.ww test-comments (enumcap bigmod.unit.ww
+ 784/787/792/794/848 sep .s cmp + make-smoke sep self-compile).
Closes M4 and epic #22. all 445 pass; 990/993/994/995 byte-id HOLD;
sizelint clean.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -195,7 +195,7 @@ type strnode = struct {
|
||||
};
|
||||
|
||||
type expctx = struct {
|
||||
out: i32, // fd we're writing the combined source to
|
||||
out: i32, // fd we're writing the sep unit source to
|
||||
dirs: *u8, // ":"-separated search path (NUL-terminated)
|
||||
visit: *strnode,
|
||||
};
|
||||
@@ -326,9 +326,9 @@ fn locateimport(dirs: *u8, name: *u8, namelen: u64,
|
||||
};
|
||||
|
||||
// Filter for dir enumeration: keep `*.ww` minus `*test.ww` and the
|
||||
// `*.combined.ww` driver-generated concat artifacts (the previous
|
||||
// build leaves them in the source tree; they parse-error when
|
||||
// re-included). Returns true to keep.
|
||||
// `*.combined.ww` legacy amalgamator artifacts (pre-#87): they
|
||||
// parse-error when re-included, and the sep driver no longer writes
|
||||
// them. Returns true to keep.
|
||||
fn dirfilekeep(name: *u8, nlen: u64) bool = {
|
||||
// nlen<=3 guard kept: a bare ".ww" (len 3) is rejected here but
|
||||
// would pass strings.hassuffix(".ww"); preserves cstage parity.
|
||||
@@ -372,7 +372,7 @@ fn enumeratedir(dirpath: *u8) (**u8, i32) = {
|
||||
if (fd < 0) { return nil: **u8, 0; };
|
||||
// #65: grow-dynamic (mirror cstage enumerate_dir_ww realloc-doubling,
|
||||
// cmd/ww/main.c:209). The old fixed 256-name cap silently dropped every
|
||||
// eligible file past it, diverging the combined.ww from cstage on a
|
||||
// eligible file past it, diverging the package unit from cstage on a
|
||||
// module dir with >256 sources.
|
||||
let cap: i32 = 8;
|
||||
let names: []*u8 = alloc([], cap: u64)!;
|
||||
@@ -542,11 +542,10 @@ fn appendlit(stem: *u8, suffix: str) *u8 = {
|
||||
return buf.ptr;
|
||||
};
|
||||
|
||||
// linker flags (-L<dir>, -l<name>) grouped as one struct so buildone's
|
||||
// linker flags (-L<dir>, -l<name>) grouped as one struct so buildonesep's
|
||||
// param list stays readable. (The earlier note here claimed a 6-argument
|
||||
// wwstage calling-convention cap; that is stale — emittuplerowrelocs in
|
||||
// cgen.ww takes 7 params and self-compiles green, and buildone itself now
|
||||
// takes 7.)
|
||||
// cgen.ww takes 7 params and self-compiles green.)
|
||||
type lflags = struct {
|
||||
libdirs: **u8,
|
||||
nlibdirs: i32,
|
||||
@@ -559,7 +558,7 @@ type lflags = struct {
|
||||
// Port of cmd/ww/main.c build_one_sep (task #46/c3). The `--sep` path
|
||||
// materializes each imported package's `.wwi` interface and compiles
|
||||
// every package on its own (`w6c -c`), then flat-links the `.o` set.
|
||||
// combined.ww stays the DEFAULT live path; --sep is additive.
|
||||
// Separate compilation is the SOLE build path (E3-C1 flip, task #87).
|
||||
//
|
||||
// Each w6c pass is BOTH consumer (reads dep `.wwi` as import scope) AND
|
||||
// producer (writes this package's `.wwi` via -I). Reverse-topo order
|
||||
@@ -638,7 +637,7 @@ fn sepfname(g: *sepgraph, pi: i32, scratch: *u8, suffix: str) *u8 = {
|
||||
// genuinely-missing import from one satisfied by an INLINE package in the
|
||||
// same single-file multi-package unit (`package aa; ... package main;
|
||||
// import aa;`). Scans EVERY line (comment-skip) — not just the first
|
||||
// package decl (peekpackage stops there). Decision byte-identical to
|
||||
// package decl. Decision byte-identical to
|
||||
// cstage so the skip/fatal choice + driver output match (rule 10).
|
||||
fn unithaspackage(buf: *u8, buflen: u64, leafp: *u8, leafn: u64) bool = {
|
||||
let p: u64 = 0u64;
|
||||
@@ -756,10 +755,10 @@ fn sepscanfile(g: *sepgraph, pi: i32, file: *u8, searchpath: *u8,
|
||||
// when the package is defined INLINE in the same unit
|
||||
// (single-file multi-package). leaf = last dotted
|
||||
// component; inline `package <leaf>` -> skip (the
|
||||
// checker binds it), else fatal. E3-C1: the combined
|
||||
// path that owned the genuine-missing case is gone, so
|
||||
// the sep producer enforces it here (INV-2). cstage
|
||||
// twin; fatal text identical.
|
||||
// checker binds it), else fatal. E3-C1 (#87): the
|
||||
// legacy amalgamator that owned the genuine-missing
|
||||
// case is gone, so the sep producer enforces it here
|
||||
// (INV-2). cstage twin; fatal text identical.
|
||||
let lstart: u64 = 0u64;
|
||||
let lk: u64 = 0u64;
|
||||
for (lk < idn) {
|
||||
@@ -1377,7 +1376,7 @@ fn buildonesep(selfdir: *u8, src: *u8, entryisdir: i32, out: *u8,
|
||||
cstrseal(dotdotlib.ptr, off);
|
||||
};
|
||||
|
||||
// Source directory (mirrors buildone).
|
||||
// Source directory.
|
||||
let srcd: []u8 = alloc([], (os.PATH_MAX: u64))!;
|
||||
srcd.len = os.PATH_MAX;
|
||||
if (entryisdir != 0) {
|
||||
@@ -1422,7 +1421,7 @@ fn buildonesep(selfdir: *u8, src: *u8, entryisdir: i32, out: *u8,
|
||||
cstrseal(searchpath.ptr, off);
|
||||
};
|
||||
|
||||
// Stem for the scratch dir (mirrors buildone).
|
||||
// Stem for the scratch dir.
|
||||
let stem: []u8 = alloc([], (os.PATH_MAX: u64))!;
|
||||
stem.len = os.PATH_MAX;
|
||||
if (entryisdir != 0) {
|
||||
@@ -1462,8 +1461,8 @@ fn buildonesep(selfdir: *u8, src: *u8, entryisdir: i32, out: *u8,
|
||||
// #79 (-T): lib/test is the synth main's `test.run` callee but @test
|
||||
// files never `import test;`. Inject it as a direct dep of the root so
|
||||
// sepscanpkg pulls test + its transitive deps; the producer adds -T to
|
||||
// the root and `test.run` links against test's `.a`. Mirrors the
|
||||
// combined path's auto-bundle (buildone istest) and sepscanfile dedup.
|
||||
// the root and `test.run` links against test's `.a` — via the
|
||||
// sepscanfile dedup-guarded dep append.
|
||||
if (istest != 0) {
|
||||
let td: i32 = 0;
|
||||
let tp: *u8 = locateimport(searchpath.ptr, "test".ptr, "test".len: u64, &td);
|
||||
@@ -1575,7 +1574,7 @@ fn buildonesep(selfdir: *u8, src: *u8, entryisdir: i32, out: *u8,
|
||||
// Wrap each DEP package's `.o` in its own deterministic `.a`
|
||||
// (5a). The ROOT stays a positional `.o` (force-loaded — it's
|
||||
// the build target), so `main` is defined before any archive is
|
||||
// processed (mirrors buildone's root treatment). The link
|
||||
// processed. The link
|
||||
// consumes `.o`/`.a`, never `.wwi`.
|
||||
if (pi != root) {
|
||||
let apath: *u8 = sepfname(g, pi, scratch, ".a");
|
||||
@@ -2069,7 +2068,7 @@ fn dorun(selfdir: *u8, argv: **u8, argc: i32, start: i32) i32 = {
|
||||
lf.nlibdirs = nlibdirs;
|
||||
lf.libs = libs.ptr;
|
||||
lf.nlibs = nlibs;
|
||||
// objstem = tmp → intermediates at /tmp/ww_run_<pid>.{s,o,combined.ww},
|
||||
// objstem = tmp → intermediates under /tmp/ww_run_<pid>.sepwork/,
|
||||
// never next to the source (T3).
|
||||
if (buildonesep(selfdir, resolved, isdir, tmp.ptr, tmp.ptr, incs.ptr, &lf, 0i32) != 0) {
|
||||
os.remove(pathstr(tmp.ptr));
|
||||
@@ -2104,8 +2103,8 @@ fn dorun(selfdir: *u8, argv: **u8, argc: i32, start: i32) i32 = {
|
||||
fn runsingletest(selfdir: *u8, src: *u8, incs: *u8, compileonly: i32, outstem: *u8, pattern: *u8) i32 = {
|
||||
let tmp: []u8 = alloc([], (os.PATH_MAX: u64))!;
|
||||
tmp.len = os.PATH_MAX;
|
||||
// -o redirects the binary + its combined (objstem, T3) to <stem>; the
|
||||
// default temp keeps the combined next to the source as before.
|
||||
// -o redirects the binary + its sepwork intermediates (objstem, T3) to
|
||||
// <stem>; the default temp keeps them next to the source as before.
|
||||
let outp: *u8 = nil;
|
||||
let objstem: *u8 = nil;
|
||||
if (outstem != nil) {
|
||||
@@ -2248,7 +2247,7 @@ fn dotest(selfdir: *u8, argv: **u8, argc: i32, start: i32) i32 = {
|
||||
cstrseal(incs.ptr, 0u64);
|
||||
|
||||
// -c (compile-only) + -o <stem>: build the test binary + its lib/test-
|
||||
// inclusive combined WITHOUT running it, for the byte-id gates. cstage
|
||||
// inclusive sep unit WITHOUT running it, for the byte-id gates. cstage
|
||||
// twin: cmd/ww/main.c do_test (error wording identical).
|
||||
let compileonly: i32 = 0;
|
||||
let outstem: *u8 = nil;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user