wcc/ww: don't interface-check the sep-build root unit (BUG-1, #69)
The --sep producer compiled the ROOT build-target with the .wwi-producer -I flag, so check_exported_type ran on the root and rejected a real-tool root's legitimate `export fn f(a: *t)` over an unexported local type t (the root is terminal — its interface is never imported, and its .wwi is never consumed). The combined build never passes -I, so it built fine. For pi==root, invoke w6c with -c -o only, no -I. Both stages (the wwstage twin builds the shorter root argv). Gates that asserted __root.wwi exists encoded the buggy behavior; updated to assert __root.s (the consumed product) while deps' .wwi byte-id is retained. M3-tail commit-6 prerequisite. Gate 989_seproot_export_run reproduces the export-fn-over-unexported-type root + proves it sep-builds, with a non-vacuity leg that the forced -I path still rejects.
This commit is contained in:
@@ -185,18 +185,25 @@ main(void)
|
||||
/* The discovered package set materialized (dotted + single + root). */
|
||||
const char *pkgs[] = { "a.b", "c", "__root" };
|
||||
for (int i = 0; i < 3; i++) {
|
||||
snprintf(p, sizeof p, "%s/prog.cs.sepwork/%s.wwi", td, pkgs[i]);
|
||||
/* #69: the root is compiled WITHOUT `-I`, so it produces no `.wwi`;
|
||||
* assert its `.s` materialized instead. Deps still emit a `.wwi`. */
|
||||
int is_root = (strcmp(pkgs[i], "__root") == 0);
|
||||
snprintf(p, sizeof p, "%s/prog.cs.sepwork/%s%s", td, pkgs[i],
|
||||
is_root ? ".s" : ".wwi");
|
||||
if (access(p, 0) != 0) {
|
||||
fprintf(stderr, "sepdotpath FAIL: missing %s.wwi (discovery)\n",
|
||||
pkgs[i]);
|
||||
fprintf(stderr, "sepdotpath FAIL: missing %s%s (discovery)\n",
|
||||
pkgs[i], is_root ? ".s" : ".wwi");
|
||||
fail++;
|
||||
}
|
||||
}
|
||||
|
||||
/* cs==ww (rule 10): per-package .s/.wwi/.unit.ww + final binary. */
|
||||
/* cs==ww (rule 10): per-package .s/.wwi/.unit.ww + final binary. The
|
||||
* root has no `.wwi` post-#69, so it is excluded from the .wwi compare. */
|
||||
for (int i = 0; i < 3; i++) {
|
||||
const char *suf[] = { ".s", ".wwi", ".unit.ww" };
|
||||
for (int k = 0; k < 3; k++) {
|
||||
if (strcmp(pkgs[i], "__root") == 0 && strcmp(suf[k], ".wwi") == 0)
|
||||
continue;
|
||||
char a[1024], b[1024];
|
||||
snprintf(a, sizeof a, "%s/prog.%s.sepwork/%s%s",
|
||||
td, stg[0].tag, pkgs[i], suf[k]);
|
||||
|
||||
Reference in New Issue
Block a user