You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 94603a9
Browse filesBrowse the repository at this point in the historyBrowse files
modgraph: resolve a module name in the importer's closure (#732)
A module name identifies one module within one program: GCC and clang name a
module's entities and its initializer after it, so a program cannot link two
modules of one name (measured: multiple definition of value@common()), and two
programs may each have one. A build holds several programs, a package and the
programs it ships through artifacts or the members of a workspace, and mcpp
refused a name that two packages of one build provided whichever programs they
belonged to.
The prepare phase computes each compiled package's closure (code and member
edges; not artifacts, tools or build-dependencies; no closure for a
workspace's virtual root). One resolver, choose_provider and resolve_provider
in mcpp.modgraph, answers which provider an import means, and the scanner,
the interface check, the packer and the backend's std reachability all use
it. Two providers of one name are refused only when one closure holds both,
and one file reached twice is recognised by identity rather than spelling.
When two packages provide a name, their BMIs lie below their packages'
directories and every unit that may import the name is bound to its provider:
a module map for GCC, whose mapper does not fall back for an unlisted name,
-fmodule-file= for clang and /reference for MSVC; mcpp dyndep reads the same
map through --module-map. With every name provided once nothing changes:
build.ninja and compile_commands.json of the xlings workspace are
byte-identical to 2026.9.30.1's. A package that provides a collided name is
compiled rather than served from the global cache. The plan's unread module
map is removed.
e2e 847 (GCC and clang) and 848 (MSVC) cover an artifacts updater, two
workspace members, the reported layout, and the two refusals; 847 fails on
2026.9.30.1 with the error of #732.
0 commit comments