pub struct PlanRequest<'a> {Show 15 fields
pub graph: &'a PackageGraph,
pub toolchain: &'a ResolvedToolchain,
pub build_flags: &'a HashMap<usize, ResolvedProfileFlags>,
pub language_standards: &'a HashMap<usize, ResolvedLanguageStandards>,
pub standard_flag_conflicts: &'a HashMap<usize, Vec<StandardFlagConflict>>,
pub build_dir: PathBuf,
pub profile: ResolvedProfile,
pub selected: Option<Vec<ManifestTargetSelector>>,
pub configuration: Option<&'a BuildConfiguration>,
pub selected_packages: Option<&'a [usize]>,
pub compiler_wrapper: Option<&'a ResolvedCompilerWrapper>,
pub dialect: Dialect,
pub msvc_external_includes: bool,
pub enabled_features: Option<&'a HashMap<usize, BTreeSet<String>>>,
pub standard_compat: bool,
}Expand description
Inputs to the build planner.
Fields§
§graph: &'a PackageGraph§toolchain: &'a ResolvedToolchainResolved C/C++ toolchain. The planner picks the compile
driver per source language (toolchain.cc.path() for .c,
toolchain.cxx.path() for .cc / .cpp / .cxx /
.c++ / .C) and the link driver per target (C++ if any
linked object came from a C++ source, otherwise C).
toolchain.ar.path() drives archive commands.
build_flags: &'a HashMap<usize, ResolvedProfileFlags>Per-package resolved build flags. Missing entries fall
back to an empty ResolvedProfileFlags; the planner does
not require every package to be present so consumers can
resolve flags lazily for the selected closure only.
language_standards: &'a HashMap<usize, ResolvedLanguageStandards>Per-package effective language standards. Missing entries
resolve to no package-level standards, mirroring
build_flags; a compile of a language with no effective
standard is then rejected at its compile site.
standard_flag_conflicts: &'a HashMap<usize, Vec<StandardFlagConflict>>Per-package standard-flag conflict candidates, detected by
the CLI on the manifest-derived flags before env /
pkg-config augmentation (so CFLAGS / CXXFLAGS stay
exempt). The planner records a violation for each planned
compile a candidate’s scope covers; candidates whose scope
is never planned (an unbuilt sibling target) gate nothing.
build_dir: PathBufAbsolute path under which all build outputs are placed.
profile: ResolvedProfileResolved build profile. Drives compile flags and the per- profile output directory.
selected: Option<Vec<ManifestTargetSelector>>Specific manifest targets to build, plus their transitive
deps. None means “every C/C++ target in every primary
package”.
configuration: Option<&'a BuildConfiguration>Resolved root-package configuration. Carried through the planner so future cache logic and any planner-level fingerprint comparisons see the same selection the build script and metadata observed. The planner does not yet change C++ flags based on this value.
selected_packages: Option<&'a [usize]>Indices of graph.packages that the user picked
through workspace package-selection flags. None means
“use the graph’s primary set” (the documented default).
When Some, default-target enumeration narrows to the
supplied indices and any manifest-target selectors in
selected are validated against them so an unrelated
package never sneaks into the build.
compiler_wrapper: Option<&'a ResolvedCompilerWrapper>Optional compiler wrapper applied to every C and C++
compile command. The Ninja command field is prefixed with
the wrapper executable; the matching compile_commands.json
arguments array stays unwrapped so clangd / IDE tooling
keeps seeing the underlying compiler. Link and archive
commands are never wrapped.
dialect: DialectCompiler command-line dialect for this build. Selected from
the detected C++ compiler (MSVC drives the cl.exe dialect).
Governs artifact naming (.o vs .obj, lib<x>.a vs
<x>.lib, <x> vs <x>.exe) and the spelling of every
compile / archive / link command the lowering emits.
msvc_external_includes: boolWhether the MSVC-dialect compilers accept the /external:I
block (crate::msvc_external_includes_supported). When
false on an MSVC build, the planner collapses the system
include bucket into the plain /I list instead of emitting a
switch an old cl would reject. Ignored by the GCC/Clang
dialect, where -isystem is part of the base command line.
enabled_features: Option<&'a HashMap<usize, BTreeSet<String>>>Per-package enabled feature names from the cross-package
feature resolver, keyed by graph.packages index. Gates
targets that declare required-features: default
enumeration skips a target whose required features are not
all enabled, while naming one explicitly (a selector or a
deps entry) is a hard error. None (and missing
entries) mean “no features enabled” for gating purposes.
standard_compat: boolWhether the post-resolution standard-compatibility check runs
over the resolved target graph (crate::standard_compat).
The build / check / run / test commands set it; cabin tidy
leaves it false, and then the planner records no violations
and its output is unchanged.