feat(profiles): per-dependency overrides, toolchain pin and profile CLI (G3)
VoidBuildSystem CI / 1 · Requirements (push) Successful in 5s
VoidBuildSystem CI / 2A · Linux build (debug) (push) Successful in 2m50s
VoidBuildSystem CI / 2A · Linux build (coverage) (push) Successful in 3m29s
VoidBuildSystem CI / 2A · Linux build (sanitizers) (push) Successful in 4m7s
VoidBuildSystem CI / 2B · Windows Wine build (debug) (push) Successful in 1m53s
VoidBuildSystem CI / 2A · Linux build (relwithdebinfo) (push) Successful in 4m22s
VoidBuildSystem CI / 2B · Windows Wine build (relwithdebinfo) (push) Successful in 3m22s
VoidBuildSystem CI / 3A · Linux test (coverage) (push) Failing after 1m57s
VoidBuildSystem CI / 3A · Linux test (sanitizers) (push) Successful in 2m0s
VoidBuildSystem CI / 3B · Windows Wine test (debug) (push) Successful in 19s
VoidBuildSystem CI / 3B · Windows Wine test (relwithdebinfo) (push) Successful in 18s
VoidBuildSystem CI / 3A · Linux test (relwithdebinfo) (push) Failing after 7m8s
VoidBuildSystem CI / 3A · Linux test (debug) (push) Failing after 7m24s
VoidBuildSystem CI / 4A2 · VBS installers (linux target) (push) Skipped
VoidBuildSystem CI / 4A2 · VBS installers (windows target) (push) Skipped
VoidBuildSystem CI / 5 · Release (push) Skipped

- 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.
This commit is contained in:
faumaray committed 2026-12-06 20:09:50 +03:00
1 parent f03524628b
commit 3b5d28d7b0
13 files changed
+702 -4

No files matched your search

+12
View File
@@ -86,6 +86,15 @@ struct FeatureDescription {
std::string description;
};
// Per-profile overrides applied to a dependency's own build (Tracks G3).
struct DependencyProfileOptions {
std::vector<std::string> compile_options;
std::vector<std::string> link_options;
std::vector<std::string> defines;
std::optional<LtoMode> lto;
std::vector<Sanitizer> sanitizers;
};
struct ProfileDescription {
std::string name;
std::vector<std::string> compile_options;
@@ -240,6 +249,7 @@ struct DependencyRecord {
std::string sha256;
std::vector<std::string> features;
std::string required_feature; // Optional dependency: only used when this feature is on.
std::map<std::string, DependencyProfileOptions, std::less<>> profile_overrides;
bool build_dependency{false};
};
@@ -345,6 +355,8 @@ class Dependency {
Dependency &feature(std::string name);
// Optional dependency: resolved only when the project feature is enabled.
Dependency &when(std::string feature);
// Per-profile overrides for the dependency's own build (e.g. its release profile).
Dependency &profile(std::string profile, DependencyProfileOptions options = {});
Dependency &build_dependency(bool is_build_tool = true);
[[nodiscard]] ImportedTarget target(std::string exported_name) const;
[[nodiscard]] const DependencyRecord &record() const;