Skip to content

Commit f134a8d

Browse files
committed
fix(manifest): partitions -> separate modules + umbrella (GCC 15 cross link)
GCC 15 (the aarch64-linux-musl cross toolchain) drops implicit template instantiations of module-attached types from partition object files — undefined refs to std::map<..., ScanOverride>::map() etc. at final link. Same split, same importer API, but as three plain modules re-exported by an umbrella mcpp.manifest, the pattern the rest of the codebase already links with everywhere. Shared parser helpers become exported (separate- module visibility requires it).
1 parent 585665c commit f134a8d

4 files changed

Lines changed: 21 additions & 15 deletions

File tree

src/manifest/manifest.cppm

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
// mcpp.manifest — manifest data model + the two descriptor formats.
22
//
3-
// Split into partitions for architectural clarity (one data model, two
4-
// independent surface grammars):
5-
// :types shared data model (Manifest, Target, BuildConfig, errors)
6-
// :toml mcpp.toml parsing (projects / packages on disk)
7-
// :xpkg xpkg .lua `mcpp = {}` segment parsing (index descriptors)
3+
// Umbrella module: one data model, two independent surface grammars.
4+
// Split as SEPARATE modules (not partitions): GCC 15's partition handling
5+
// drops implicit template instantiations of module-attached types
6+
// (std::map<..., ScanOverride> etc.) from partition objects, breaking the
7+
// aarch64 cross link; plain modules re-exported here behave identically
8+
// for importers and link everywhere.
9+
//
10+
// mcpp.manifest.types shared data model (Manifest, Target, errors)
11+
// mcpp.manifest.toml mcpp.toml parsing (projects / packages on disk)
12+
// mcpp.manifest.xpkg xpkg .lua `mcpp = {}` segment (index descriptors)
813

914
export module mcpp.manifest;
1015

11-
export import :types;
12-
export import :toml;
13-
export import :xpkg;
16+
export import mcpp.manifest.types;
17+
export import mcpp.manifest.toml;
18+
export import mcpp.manifest.xpkg;

src/manifest/toml.cppm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// mcpp.manifest:toml — load and validate mcpp.toml.
22

3-
export module mcpp.manifest:toml;
3+
export module mcpp.manifest.toml;
44

5-
import :types;
5+
import mcpp.manifest.types;
66
import std;
77
import mcpp.libs.toml;
88
import mcpp.pm.dep_spec;

src/manifest/types.cppm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Everything both descriptor formats (mcpp.toml, xpkg .lua) synthesize
44
// into, plus format-agnostic helpers. No parsing lives here.
55

6-
export module mcpp.manifest:types;
6+
export module mcpp.manifest.types;
77

88
import std;
99
import mcpp.pm.dep_spec; // M5.x pm/ subsystem refactor: DependencySpec lives here
@@ -401,8 +401,9 @@ bool has_lib_target(const Manifest& manifest);
401401

402402
} // namespace mcpp::manifest
403403

404-
// ── module-linkage helpers shared by the :toml and :xpkg parsers ──
405-
namespace mcpp::manifest {
404+
// ── helpers shared by the toml and xpkg parsers (exported: separate
405+
// modules need them reachable; they live in the manifest namespace) ──
406+
export namespace mcpp::manifest {
406407

407408
bool starts_with_std_flag(std::string_view flag) {
408409
return flag == "-std" || flag.starts_with("-std=");

src/manifest/xpkg.cppm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// mcpp.manifest:xpkg — parse the `mcpp = {}` segment of xpkg .lua
22
// descriptors (tiny Lua-subset reader; we never execute Lua).
33

4-
export module mcpp.manifest:xpkg;
4+
export module mcpp.manifest.xpkg;
55

6-
import :types;
6+
import mcpp.manifest.types;
77
import std;
88
import mcpp.pm.dep_spec;
99
import mcpp.pm.dependency_selector;

0 commit comments

Comments
 (0)