pub enum PhaseKind {
MaskOutputsAndEnv,
Serialize,
Sha256,
ComputeOutputPaths,
FillPlaceholders,
ComputeDrvPath,
SerializeModulo,
CacheSelfModulo,
SeedFixedOutputHash,
MarkContentAddressed,
EmitCaPlaceholders,
}Expand description
Enumeration of every phase the interpreter knows how to run. Adding a new phase here IS adding a new primitive to the spec language — the typed border is exactly this set.
Variants§
MaskOutputsAndEnv
Set every output’s path to "" AND every env entry whose
name matches an output to "". This is what CppNix calls
“maskOutputs” — it’s the precondition for hashing the
“unresolved” form of a derivation.
Serialize
ATerm-serialize the current derivation into the bytes slot
named by bind.
Sha256
Compute SHA-256 of the bytes in slot from, store the
lowercase-hex digest into slot bind.
ComputeOutputPaths
Given the inner hex stored in slot from_hash, compute the
per-output store path via sui_compat::store_path::compute_output_path
and populate the shared out_paths map.
FillPlaceholders
Copy each entry of out_paths back into the derivation:
drv.outputs[<name>].path = <path> AND drv.env[<name>] = <path>.
After this phase the derivation is in CppNix’s “final” form.
ComputeDrvPath
Given the final hex stored in slot from_hash, compute the
.drv store path via sui_compat::store_path::compute_drv_path
and record it as the overall result.
SerializeModulo
Like Serialize but replace every input_derivations
key (a .drv path) with its hashDerivationModulo lookup
from the thread-local modulo cache — CppNix’s recursion
over dependent derivations. Input drvs with no cached
modulo hash are passed through unchanged, which matches
the parity-on-leaves case (a drv with no dependencies
serialises identically in both forms).
CacheSelfModulo
Record the current hex hash in from_hash as the modulo
hash for the produced .drv path, so derivations that
depend on this one can look it up during their own
SerializeModulo phase.
SeedFixedOutputHash
For a fixed-output derivation: read drv.env.outputHash,
outputHashAlgo, outputHashMode and seed the per-output
fingerprint from the output content hash rather than the
recipe hash. Output store path follows from this seed via
the same compute_output_path route as input-addressed.
MarkContentAddressed
Mark the derivation as CA (__contentAddressed = true).
CA outputs’ paths aren’t known at recipe time; the builder
resolves them post-realisation and rewrites the .drv in
place. This phase plants the marker so downstream phases
route correctly.
EmitCaPlaceholders
For CA derivations only: write a placeholder output path
(cppnix uses /nix/store/<placeholder>-<name> style); the
builder substitutes real paths after a successful build.
Trait Implementations§
impl Copy for PhaseKind
Source§impl<'de> Deserialize<'de> for PhaseKind
impl<'de> Deserialize<'de> for PhaseKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for PhaseKind
impl StructuralPartialEq for PhaseKind
Auto Trait Implementations§
impl Freeze for PhaseKind
impl RefUnwindSafe for PhaseKind
impl Send for PhaseKind
impl Sync for PhaseKind
impl Unpin for PhaseKind
impl UnsafeUnpin for PhaseKind
impl UnwindSafe for PhaseKind
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.