Skip to content

fix: preserve conditional dialect flags in workspace plans - #787

Open
julixian wants to merge 1 commit into
mcpp-community:mainfrom
julixian:fix/workspace-conditional-dialect
Open

julixian wants to merge 1 commit into
mcpp-community:mainfrom
julixian:fix/workspace-conditional-dialect

Conversation

@julixian

@julixian julixian commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A workspace member's architecture-specific dialect_cxxflags was dropped when member selection created the virtual root. For example, an i686-only compatibility macro never reached the std precompile command, although the same declaration worked in a standalone package.

The virtual root now retains the selected member's conditional dialect declarations without copying its package-local sources, flags, runtime entries or dependencies. Workspace grouping also includes each dialect predicate and flag list, so distinct graph configurations cannot silently use the first member's declaration. Existing predicate evaluation supplies matching flags to the std module, scanner, translation units and configuration fingerprint.

Closes #786.

Criteria

  • The new 890_workspace_conditional_dialect.sh fails with released mcpp 2026.10.5.3 because the selected member's architecture macro is missing, and passes with the freshly built binary on Windows x64.
  • The E2E covers -p, invocation inside the member, multiple selected members with distinct configurations, the std-module cache record, compiler commands, nonmatching architecture predicates and an ordinary dependency whose dialect must remain ignored. It declares unix-shell and runs through the existing E2E discovery on supported hosts.
  • All nine WorkspacePlan unit tests, including the two new regression tests, pass with the freshly built test binary on Windows x64.
  • Self-host mcpp build, help/version smoke, documentation style/structure, version pins, workflow assertions and fixture-path hygiene pass locally. Python-based checks were run with UTF-8 mode on Windows.
  • The freshly built binary's full mcpp test run passes: 147 test binaries passed, 0 failed, on Windows x64. Linux/macOS E2E execution and hosted build/test jobs remain pending. The documentation/repository CI job currently fails in check_workflow_assertions.py --check-open: four unchanged workflows still mark closed issue ci-macos xcode-27: ld64.lld cannot parse arm64e.x1 in either available SDK (upstream, tracked) #669 as known-red (ci-fresh-install.yml:361,490, ci-macos-e2e.yml:27, ci-macos.yml:23). These files are identical to base de9c290f; the non-network workflow assertion check passes locally. Failure log: https://github.com/mcpp-community/mcpp/actions/runs/37768556508/job/113282108050.

Intersections

New rule or feature Invariant it crosses Test at the crossing
Conditional dialect declarations survive virtual-root creation A virtual root contains graph configuration, never package content WorkspacePlan.VirtualRootPreservesOnlyConditionalDialectDeclarations
Conditional dialect declarations enter workspace grouping Members sharing one plan must share graph-wide configuration WorkspacePlan.ConditionalDialectFlagsSeparateConfigurations, E2E 890
Matching architecture flags reach std and compiler commands Root dialect applies graph-wide; ordinary dependencies cannot change it E2E 890 matching/nonmatching and dependency scenarios

Compatibility

No new manifest syntax is introduced. Selected workspace members now receive their previously ignored conditional dialect settings. Members with different conditional declarations can produce separate plans; matching flags can select a different std cache entry and trigger a rebuild. Ordinary dependency dialect flags remain ignored. This PR does not change workspace target-table inheritance or merge semantics.

Checks before merging

  • bash .github/tools/check_docs_style.sh, check_docs_structure.sh and check_version_pins.sh pass.
  • python3 .github/tools/check_workflow_assertions.py passes.
  • No commit on the branch carries an attribution trailer.
  • The squash merge is given an explicit subject and body if squash is selected.

This branch has not been deployed

No deployments
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.

fix: preserve conditional dialect flags in workspace build configurations

1 participant