Expand description
Conservative parsing and action-key construction for C and C++ compiles.
Cargo build scripts using the cc crate compile C and C++ through a
gcc-style driver. This adapter models the narrow shape those build scripts
produce – one source, one object, -c – and rejects everything else. As
in the rustc adapter, callers should treat CcBypassReason as a safe
cache bypass: run the real compiler and publish nothing.
Two properties separate this adapter from a traditional compiler cache. Preprocessor inputs are discovered from a depfile the adapter injects itself, so the key names the headers the compilation actually read; and the directories those headers were searched from contribute a name manifest, so a header that newly shadows one of them changes the key even though every previously-read file is byte-identical.
Path mappings are shared with the rustc adapter so both agree on which host roots are checkout-specific.
Structs§
- CcAction
- Canonical action descriptor and its content digest.
- CcAction
Context - External information needed to construct a canonical cc action.
- CcAction
Input - One file input paired with the digest used in the action key.
- CcCompiler
Identity - Compiler properties that distinguish incompatible objects.
- CcDepfile
- A parsed GNU-style dependency list.
- CcDiscovered
Inputs - A complete, content-addressed compiler input manifest.
- CcInput
Prediction - Normalized input names from the last successful execution of one modeled compile.
- CcInvocation
- A parsed, admitted C or C++ compile.
Enums§
- CcBypass
Reason - Reason a C or C++ invocation cannot safely use the action cache.
- CcCompiler
Family - Compiler family, which decides how the identity is assembled.
- CcLanguage
- Source language a driver invocation compiles.
Constants§
- ACTION_
SCHEMA_ VERSION - Schema version embedded in canonical cc action descriptors.
- ADAPTER_
VERSION - Version of the cc argument and input model used to construct keys.
- BYPASS_
ENVIRONMENT - Environment variables that force a bypass when set.
- INCLUDE_
MANIFEST_ PREFIX - Marker distinguishing an include-directory name manifest from a file input.
- KEYED_
ENVIRONMENT - Environment variables whose values enter every cc action key.
- MAX_
INPUT_ BYTES - Maximum total bytes digested for one action.
- MAX_
MANIFEST_ ENTRIES - Maximum file names summarized across all include manifests.
- MAX_
PREDICTED_ INPUTS - Maximum discovered inputs, including include-manifest entries.
- SYSTEM_
ROOTS - Absolute roots whose contents are keyed verbatim rather than through a placeholder.
Functions§
- environment_
inputs - Read the modeled environment, rejecting variables that change the compile in a way the argv model cannot see.
- environment_
inputs_ for - Read the modeled environment for a particular compiler family.
- is_
system_ path - Whether a path lies beneath a root whose location is a machine property.
- manifest_
snapshot - Digest the includable names in each directory, reading no file contents.