@@ -108,53 +108,6 @@ E2E extensions{"extensions", [] {
108108 std::println (" skip: no LLVM payload installed — clang leg not run" );
109109 };
110110
111- " 218 module extensions graph shape" _test[s::gcc] = [] {
112- // A no-change build replays; a new import in a .ixx plans again and the edge is real;
113- // module_extensions changes the graph in the same directory; a dead entry is reported; a
114- // reserved extension is refused naming the key.
115- s::project p ({{" mcpp.toml" , " [package]\n name = \" gshape\"\n version = \" 0.1.0\"\n\n [build]\n module_extensions = [\" .ixx\" ]\n " },
116- {" src/helper.cppm" , " export module gshape.helper;\n import std;\n export auto helper() -> int { return 41; }\n " },
117- {" src/face.ixx" , " export module gshape.face;\n import std;\n export auto face() -> int { return 1; }\n " },
118- {" src/main.cpp" , " import std;\n import gshape.face;\n int main(){ std::println(\" {}\" , face()); }\n " }});
119- auto r = p.mcpp ({" build" });
120- expect (fatal (e2e::succeeded (r))) << " first build\n " << s::text (r);
121- const auto fp_before = printed (p, " Fingerprint" );
122- expect (fatal (!fp_before.empty ())) << " could not read the fingerprint" ;
123- auto mark = mark_then_wait ();
124- r = p.mcpp ({" build" });
125- expect (fatal (e2e::succeeded (r))) << " no-change build\n " << s::text (r);
126- expect (fatal (!planned_since (p, mark))) << " fast path did not engage — the rest proves nothing\n " << s::text (r);
127-
128- mark = mark_then_wait ();
129- p.write (" src/face.ixx" , " export module gshape.face;\n import std;\n import gshape.helper;\n export auto face() -> int { return helper() + 1; }\n " );
130- r = p.mcpp ({" build" });
131- expect (fatal (e2e::succeeded (r))) << " build after .ixx edit\n " << s::text (r);
132- expect (fatal (planned_since (p, mark))) << " editing a .ixx did not invalidate the fast path\n " << s::text (r);
133- expect (fatal (e2e::contains (s::text (p.mcpp ({" run" })), " 42" ))) << " expected 42 (41+1)" ;
134-
135- p.write (" src/extra.ccm" , " export module gshape.extra;\n export auto extra() -> int { return 2; }\n " );
136- p.write (" mcpp.toml" , " [package]\n name = \" gshape\"\n version = \" 0.1.0\"\n\n [build]\n module_extensions = [\" .ixx\" , \" .ccm\" ]\n " );
137- r = p.mcpp ({" build" });
138- expect (fatal (e2e::succeeded (r))) << " build after key change\n " << s::text (r);
139- const auto fp_after = printed (p, " Fingerprint" );
140- expect (fatal (fp_before == fp_after)) << " module_extensions moved the build directory (" << fp_before << " -> " << fp_after << " )" ;
141- // The build directory is named by the configuration's lineage (`Lineage:`), not by the
142- // whole fingerprint (2026.11.13.1).
143- const auto lineage = printed (p, " Lineage" );
144- const auto graphs = s::glob (p.at (" target" ), std::format (" */{}/build.ninja" , lineage));
145- expect (fatal (!graphs.empty () && e2e::matches (s::read_file (graphs.front ()), R"( gshape\.extra)" )))
146- << " the .ccm named by module_extensions is not a module interface of the graph (lineage " << lineage << " )" ;
147-
148- p.write (" mcpp.toml" , " [package]\n name = \" gshape\"\n version = \" 0.1.0\"\n\n [build]\n module_extensions = [\" .ixx\" , \" .nosuchext\" ]\n " );
149- r = p.mcpp ({" build" });
150- expect (fatal (e2e::succeeded (r))) << " build with a dead entry\n " << s::text (r);
151- expect (fatal (e2e::contains (s::text (r), " nosuchext" ))) << " a module_extensions entry matching nothing was not reported\n " << s::text (r);
152- p.write (" mcpp.toml" , " [package]\n name = \" gshape\"\n version = \" 0.1.0\"\n\n [build]\n module_extensions = [\" .c\" ]\n " );
153- r = p.mcpp ({" build" });
154- expect (fatal (failed (r))) << " [build] module_extensions = [\" .c\" ] was accepted" ;
155- expect (fatal (e2e::contains (s::text (r), " module_extensions" ))) << " the error does not name the offending key\n " << s::text (r);
156- };
157-
158111 " 236 module extensions default toolchain" _test = [] {
159112 // On this platform's default toolchain a declared .ixx is a module interface: its BMI is
160113 // written and the program runs.
@@ -237,3 +190,55 @@ module_extensions = [".ixx"]
237190}};
238191
239192} // namespace
193+
194+ // The cases that hold the machine (P7.1): a suite of their own, which the runner runs with no
195+ // other test beside it. 218 asserts a replay: an install into the shared home by a program beside
196+ // it changes the runtime's description, and the build then plans again (design 2026-11-14 §5.2 E).
197+ E2E extensions_machine{" extensions-machine" , resource{" machine" }, [] {
198+ " 218 module extensions graph shape" _test[s::gcc] = [] {
199+ // A no-change build replays; a new import in a .ixx plans again and the edge is real;
200+ // module_extensions changes the graph in the same directory; a dead entry is reported; a
201+ // reserved extension is refused naming the key.
202+ s::project p ({{" mcpp.toml" , " [package]\n name = \" gshape\"\n version = \" 0.1.0\"\n\n [build]\n module_extensions = [\" .ixx\" ]\n " },
203+ {" src/helper.cppm" , " export module gshape.helper;\n import std;\n export auto helper() -> int { return 41; }\n " },
204+ {" src/face.ixx" , " export module gshape.face;\n import std;\n export auto face() -> int { return 1; }\n " },
205+ {" src/main.cpp" , " import std;\n import gshape.face;\n int main(){ std::println(\" {}\" , face()); }\n " }});
206+ auto r = p.mcpp ({" build" });
207+ expect (fatal (e2e::succeeded (r))) << " first build\n " << s::text (r);
208+ const auto fp_before = printed (p, " Fingerprint" );
209+ expect (fatal (!fp_before.empty ())) << " could not read the fingerprint" ;
210+ auto mark = mark_then_wait ();
211+ r = p.mcpp ({" build" });
212+ expect (fatal (e2e::succeeded (r))) << " no-change build\n " << s::text (r);
213+ expect (fatal (!planned_since (p, mark))) << " fast path did not engage — the rest proves nothing\n " << s::text (r);
214+
215+ mark = mark_then_wait ();
216+ p.write (" src/face.ixx" , " export module gshape.face;\n import std;\n import gshape.helper;\n export auto face() -> int { return helper() + 1; }\n " );
217+ r = p.mcpp ({" build" });
218+ expect (fatal (e2e::succeeded (r))) << " build after .ixx edit\n " << s::text (r);
219+ expect (fatal (planned_since (p, mark))) << " editing a .ixx did not invalidate the fast path\n " << s::text (r);
220+ expect (fatal (e2e::contains (s::text (p.mcpp ({" run" })), " 42" ))) << " expected 42 (41+1)" ;
221+
222+ p.write (" src/extra.ccm" , " export module gshape.extra;\n export auto extra() -> int { return 2; }\n " );
223+ p.write (" mcpp.toml" , " [package]\n name = \" gshape\"\n version = \" 0.1.0\"\n\n [build]\n module_extensions = [\" .ixx\" , \" .ccm\" ]\n " );
224+ r = p.mcpp ({" build" });
225+ expect (fatal (e2e::succeeded (r))) << " build after key change\n " << s::text (r);
226+ const auto fp_after = printed (p, " Fingerprint" );
227+ expect (fatal (fp_before == fp_after)) << " module_extensions moved the build directory (" << fp_before << " -> " << fp_after << " )" ;
228+ // The build directory is named by the configuration's lineage (`Lineage:`), not by the
229+ // whole fingerprint (2026.11.13.1).
230+ const auto lineage = printed (p, " Lineage" );
231+ const auto graphs = s::glob (p.at (" target" ), std::format (" */{}/build.ninja" , lineage));
232+ expect (fatal (!graphs.empty () && e2e::matches (s::read_file (graphs.front ()), R"( gshape\.extra)" )))
233+ << " the .ccm named by module_extensions is not a module interface of the graph (lineage " << lineage << " )" ;
234+
235+ p.write (" mcpp.toml" , " [package]\n name = \" gshape\"\n version = \" 0.1.0\"\n\n [build]\n module_extensions = [\" .ixx\" , \" .nosuchext\" ]\n " );
236+ r = p.mcpp ({" build" });
237+ expect (fatal (e2e::succeeded (r))) << " build with a dead entry\n " << s::text (r);
238+ expect (fatal (e2e::contains (s::text (r), " nosuchext" ))) << " a module_extensions entry matching nothing was not reported\n " << s::text (r);
239+ p.write (" mcpp.toml" , " [package]\n name = \" gshape\"\n version = \" 0.1.0\"\n\n [build]\n module_extensions = [\" .c\" ]\n " );
240+ r = p.mcpp ({" build" });
241+ expect (fatal (failed (r))) << " [build] module_extensions = [\" .c\" ] was accepted" ;
242+ expect (fatal (e2e::contains (s::text (r), " module_extensions" ))) << " the error does not name the offending key\n " << s::text (r);
243+ };
244+ }};
0 commit comments