- Dependency::profile(name, DependencyProfileOptions) records per-profile
compile/link options, defines, LTO and sanitizers. The native provider
applies the matching override to the dependency's own ProfileContext and
hashes the overrides into the provider input hash, so changing them
invalidates cached dependency builds.
- vbs-toolchain.toml pins compiler, minimum version, C/C++ standards and
sysroot (optional strict); it is loaded once and checked after every
toolchain probe. Drift warns by default and fails with
--locked-toolchain or strict = true; malformed pins fail with the TOML
diagnostic.
- vbs profile list|show|diff lists declared profiles with parents, prints
a resolved profile (flags, standards, LTO, sanitizers, sysroot) or the
fields that differ between two.
Verified: dependency_profile_overrides_apply_to_native_builds (a define
from the override is required by the dependency source),
toolchain_pin_detects_and_enforces_drift and
profile_commands_list_show_and_diff pass; vbs_core_tests 8/8; CLI
contracts pass; clang-format clean.
- Project::feature(name, default_on) / FeatureDescription, Target's
require_feature() (the `.requires` spelling is a C++20 keyword), and
Dependency::when(feature) for optional dependencies.
- --features a,b / --no-default-features on build, test, run, explain and
deps resolve/update. Unification is additive: defaults (unless
disabled) + features required by targets + requested features.
- Enabled features add VBS_FEATURE_<NAME> compile definitions to every
target, so action keys and the cache are feature-aware; switching the
set invalidates cached actions.
- Optional dependencies are filtered before resolution, so vbs.lock
contains only active ones.
- vbs explain --show-features prints the unified set with reasons
(default/requested/required by target); vbs metadata lists declared
features with their enabled state; the descriptor JSON carries features
and target requirements.
API note: features provide preprocessor-level configuration (defines), not
ABI/layout changes across a feature boundary.
Verified: features_unify_defines_and_invalidate_action_keys and
optional_dependencies_follow_feature_selection pass; vbs_core_tests 8/8;
CLI contracts pass; clang-format clean.