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
* feat(manifest): platform-conditional [target.'cfg(...)'.build] flags; v0.0.74
L1 of the manifest platform/environment design: a normal mcpp.toml can scope
[build] cflags/cxxflags/ldflags to a target predicate via
[target.'cfg(...)'.build], evaluated against the RESOLVED target (host triple
for a native build, the --target triple for a cross build) — so conditional
flags follow what the binary will run on, not the build host. Closes the gap
that forces consumers to generate per-OS [build] flags out-of-band (e.g.
mcpp-index's write_build_ldflags bash).
Mechanism (à la carte: the dependency graph stays applicative; this is a
declarative conditional over flags):
- manifest.cppm: [target.<predicate>.build] parsed DEFERRED into
Manifest::conditionalConfigs (parsing is target-agnostic).
- prepare.cppm: a recursive cfg() evaluator (cfgpred::) over
all/any/not + os/arch/family/env + bare windows/unix/linux/macos; the
context is derived from the resolved target triple (or host for native).
Matching predicates' flags merge into buildConfig right after --target
resolution, mirroring the [profile] merge.
- Cargo-style table syntax, vcpkg-trimmed token set; precedence and grammar per
.agents/docs/2026-06-29-manifest-environment-and-platform-design.md.
Conditional [dependencies] + lazy fetch are the documented fast-follow (Phase 1b).
Test: tests/e2e/85_target_cfg_build_flags.sh (cfg(linux)/cfg(unix) apply on a
Linux build; cfg(windows) does not; cfg(all(linux, not(arch="aarch64"))) applies
on x86_64 Linux). Regression: unit 27/0, e2e 70/73, self-host build at 0.0.74.
* fix(e2e): make test 85 host-aware (ran on win/macos asserting Linux-only cfg)
The first version hard-coded Linux assertions (cfg(linux) applies, cfg(windows)
doesn't) but carried no `# requires:` line-2 gate, so the e2e runner executed it
on the Windows and macOS self-host jobs where cfg(linux) correctly does NOT apply
— the Linux-only #error guards then fired (feature working as designed; test
wrong). Rewrite host-aware: assert exactly one of cfg(linux)/macos/windows
applies (the host's), cfg(unix) iff non-windows, exactly one of
cfg(arch=x86_64)/aarch64, and any(linux,macos)==unix — so it validates the
evaluator on all three CI platforms instead of failing on two.
0 commit comments