Skip to content

2026.9.25.1: workspace members compile the same way in every position, and a consumer's headers stay in the consumer (#690) - #691

Merged
Sunrisepeak merged 15 commits into
mainfrom
fix/690-workspace-scope
Sep 24, 2026
Merged

Sunrisepeak merged 15 commits into
mainfrom
fix/690-workspace-scope

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

Summary

[workspace.build] defines did not reach a workspace member compiled as a sibling's path dependency (#690). The cause was that inheritance ran at the snapshot into the build graph, after the defines fold. The audit behind this fix found ten further findings in the same family: inheritance placement, readers outside prepare_build, and flag scoping. This pull request fixes all of them. Design record, plan and sandbox verification script are in .agents/docs/2026-09-25-issue-690-*.

  • One pipeline for every member (W1, W3). A member reached as a dependency inherits [workspace.package], x.workspace = true entries and [workspace.build] at its load site, in the order the root follows. The same applies to a member of a git-hosted workspace and to a member inside an index archive, each inheriting from its own repository or archive. The snapshot only captures the result. It refuses unfolded defines with an internal error. The root no longer receives the workspace flags twice.
  • Keyed defines (W7). defines is a set keyed by macro name. A later entry replaces the earlier one in place, and !NAME removes the name.
  • One key table (W2). kWorkspaceBuildKeys is the only list of inheritable keys. The parser, the error text and the publisher read it. ios_deployment_target is now accepted.
  • One effective-manifest loader (W4). publish, pack, emit xpkg, toolchain list, sbom, the index commands, the fast path and test discovery read the inherited manifest.
  • A self-contained published form (W5). The published mcpp.toml is normalised: inherited values are inlined, and sibling edges become version edges. The original is kept as mcpp.toml.orig. The archive is reproducible, and the descriptor's deps include sibling edges.
  • Flag scoping (W6). A consumer's include directories, including private_include_dirs, no longer reach its dependencies. A missing-header note names the consumer directory that holds the header. kCacheEpoch goes from 3 to 4, because measured cache entries were compiled against another project's headers.
  • Test harness. _inherit_toolchain.sh now links payloads per version, so a version a test installs no longer writes through into ~/.mcpp (e2e: _inherit_toolchain.sh symlinks real toolchain payloads into a temp MCPP_HOME, so tests corrupt the developer's installed gcc #293, second shape).
  • Versions. 2026.9.25.1, and the internal xlings pin moves to 2026.9.20.1.

Closes #690

Test plan

  • mcpp test: 127 passed, 0 failed. New suites: test_workspace_inheritance, test_toml_serialize, ConsumerIncludeScopeAdvice.
  • New e2e 765, 770, 772, 773 and 774 pass with the new binary. Each fails with the released 2026.9.24.1 binary, or with its section's fix reverted.
  • e2e 772 with MCPP_BOOT set to 2026.9.24.1: the released client builds the normalised archive.
  • 73 related e2e scripts (workspace, flags, include, feature, git, transitive) and 67 publish/pack/emit scripts pass. ~/.mcpp is unchanged afterwards.
  • 16 mcpp-index example members pass under mcpp test -p with the candidate binary.
  • Docs style, docs structure, .agents index and version-pin checks pass.
  • CI on Linux, macOS and Windows.

speak-agent and others added 15 commits September 25, 2026 05:53
…nes, one key table (#690)

A member reached as a dependency now inherits [workspace.package],
x.workspace = true entries and [workspace.build] at its load site, before
the conditional merge and the defines fold, as the root does. The snapshot
in makePackageRoot no longer inherits and refuses unfolded defines with an
internal error. A member of a git-hosted workspace inherits from its own
repository. [build] defines is a set keyed by macro name, and !NAME removes
an inherited name. The inheritable [build] subset is one exported table,
which accepts ios_deployment_target. The e2e harness links payloads per
version, so a version installed by a test no longer lands in the
developer's registry.
… W6)

The root's [build] include_dirs and include_dirs_after were written into the
file-level $cxxflags/$cflags/$asmflags/$nasmflags of build.ninja, which every
unit in the graph reads. A root header named like a system header shadowed it
inside a dependency, private_include_dirs included, and because no cache-key
axis contained the broadcast, a dependency object in the global cache could be
compiled against another project's root headers (measured: cJSON_Compare
answered 1 in an unrelated project).

- flags.cppm: no include directory is broadcast; every unit keeps its own
  package's directories through $local_includes (C, C++, GAS and NASM).
- cache_key.cppm: kCacheEpoch 3 -> 4, orphaning entries written while the
  broadcast existed.
- ninja_backend.cppm / execute.cppm: consumer_include_scope_advice names the
  consumer directory that holds a header a dependency now fails to find, on
  the full path and, through a sidecar beside build.ninja, on the fast path.
- tests: unit tests for the file-level channel, the unit channel's
  absolutisation, the advice and the sidecar; e2e 765.
…2026.9.25.1 (#690 W4)

prepare_build loads through load_effective_manifest and no longer inherits a
preloaded host-tool manifest a second time. sbom, index list/update, the index
refresh of mcpp update, the fast-path identity and test discovery read the
effective manifest.
… reads the one key table (#690)

inherit_as_workspace_member is the one function for a sibling path
dependency, a git-hosted member and a member inside an index package's
archive (Form A pointer), searched no higher than the install root.
normalize.cppm writes [workspace.build] back through kWorkspaceBuildKeys
instead of a second copy of the key set. e2e 774.
@Sunrisepeak
Sunrisepeak merged commit f176abd into main Sep 24, 2026
40 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[workspace.build] defines are lost for sibling path dependencies

2 participants