feat(features): per-feature per-glob flags + per-OS features semantics (#253) — 0.0.101#255
Merged
Merged
Conversation
#253) Two feature-model gaps surfaced by compat.opencv's 3-platform dnn work: - features.<name>.flags — per-feature per-glob compile flags, one entry grammar with [build].flags (shared parser in both grammars: xpkg parse_glob_flags_array, TOML parse_glob_flags_value). Active features fold their entries into the ONE buildConfig.globFlags funnel (after base entries, features in name order, "last flag wins"), so scanner matching, per-TU flag landing, the zero-hit warning and fingerprint serialization all consume it unchanged. Fold sits OUTSIDE the includeDevDeps gate (0.0.94 dual-path invariant). Private per-TU, non-propagating (contrast feature defines = interface switches). Feature-off builds no longer carry the rule at all — opencv's mlas dead-glob warnings disappear; an active feature's dead glob still warns, now naming the owning feature. TOML AOT allowlist gains a features.*.flags wildcard segment (aot_path_matches) so both the inline and [[features.X.flags]] spellings pass the #227 closed guard. - per-OS features — the mcpp.<os> textual-splice additive overlay already covers the features key; semantics (per-subkey APPEND, base first / OS body after, OS-only feature registration) are now locked by unit tests (per-leg via osOverride) + e2e and documented. Together with per-feature flags this gives opencv dnn its common/delta shape (neutral common payload, per-OS mlas-x86/NEON deltas + their flags). Also: dependency globFlags were never serialized into the per-package fingerprint (held only by descriptor-frozen-per-version + feature toggles always touching cflags); feature folding makes the vector build-variant, so canonical_package_build_metadata now serializes it like the root side. featureOrigin is diagnostic-only, not fingerprinted. Tests: unit (TOML/xpkg parse, closed-grammar errors, per-OS additive merge both legs), e2e 146 (four quadrants, dead-glob warning elimination + feature-scoped naming, private non-propagation vs define propagation), e2e 147 (per-OS features end-to-end, poisoned non-host section must stay invisible). Host-vs-target splice-axis defect found during this work is split out as #254. Design: .agents/docs/2026-07-20-issue-253-feature-flags-and- per-os-features-design.md. Version 0.0.100 -> 0.0.101.
…s has no path->string implicit conversion (wstring value_type)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #253. Design doc (with implementation log):
.agents/docs/2026-07-20-issue-253-feature-flags-and-per-os-features-design.md.What
1.
features.<name>.flags— per-feature per-glob compile flags (both grammars)[build].flags(globrequired +cflags/cxxflags/asmflags/defines), shared parser per grammar: xpkgparse_glob_flags_array, TOMLparse_glob_flags_value— one data model, two grammars.buildConfig.globFlagsfunnel (prepare.cppm apply()), after base entries, features in name order → "last flag wins" lets a feature rule override a broader base rule. Scanner matching, per-TU flag landing, zero-hit warning and fingerprint all consume the same vector unchanged.includeDevDepsgate (0.0.94 dual-path invariant:mcpp buildandmcpp testagree).defines(interface switches that propagate along Public/Interface edges). Locked by e2e.features.<f>.flags glob '...' matched no source file).#227closed-grammar AOT allowlist gains afeatures.*.flagswildcard segment, so both the inline array and[[features.<name>.flags]]spellings work.2. per-OS
features— semantics locked, no new mechanismmcpp.<os>textual-splice additive overlay already coversfeatures; this PR locks the semantics (per-subkey APPEND — neutral body first, OS body after; OS-only feature registration; non-host sections invisible) with unit tests (both legs viaosOverride) + e2e, and documents the common/delta authoring shape opencvdnnneeds.3. Fingerprint hardening
globFlagswere never in the per-package fingerprint (previously held by descriptor-frozen-per-version + feature toggles always touching cflags). Feature folding makes the vector build-variant →canonical_package_build_metadatanow serializes it like the root side.featureOriginis diagnostic-only, not fingerprinted.Split out: the per-OS splice keys on the host OS constant while
target_cfguses the resolved target — cross builds pick the wrong per-OS payload. Filed as #254 (native builds unaffected; not needed for #253's unblock).Tests
Manifest.FeatureFlagsTomlTableForm/FeatureFlagsTomlErrors,SynthesizeFromXpkgLua.FeatureFlagsParse/PerOsFeaturesAdditiveMerge— 35/35 suites green locally.definespropagate whileflagsdo not.#errorTU) must stay invisible; feature-off leaves all gated sources out.Version
0.0.100 → 0.0.101 (
mcpp.toml+fingerprint.cppm), CHANGELOG entry included.