Skip to main content

Crate mbx_cache_cc

Crate mbx_cache_cc 

Source
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.
CcActionContext
External information needed to construct a canonical cc action.
CcActionInput
One file input paired with the digest used in the action key.
CcCompilerIdentity
Compiler properties that distinguish incompatible objects.
CcDepfile
A parsed GNU-style dependency list.
CcDiscoveredInputs
A complete, content-addressed compiler input manifest.
CcInputPrediction
Normalized input names from the last successful execution of one modeled compile.
CcInvocation
A parsed, admitted C or C++ compile.

Enums§

CcBypassReason
Reason a C or C++ invocation cannot safely use the action cache.
CcCompilerFamily
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.