pub struct DeterminismState {
pub sde: i64,
pub compile_time_allowlist: Vec<(String, String)>,
pub runtime_allowlist: Vec<(String, String)>,
}Fields§
§sde: i64§compile_time_allowlist: Vec<(String, String)>§runtime_allowlist: Vec<(String, String)>Implementations§
Source§impl DeterminismState
impl DeterminismState
Sourcepub fn seed_from_commit(commit_ts: i64) -> Result<Self>
pub fn seed_from_commit(commit_ts: i64) -> Result<Self>
Seed from a commit timestamp (seconds since UNIX epoch). All built- in compile-time allow-list entries listed in the spec’s contract table are added here.
Returns Err when commit_ts is negative — a negative epoch would
propagate a bogus SOURCE_DATE_EPOCH into child processes (where
shells / build tools may misinterpret it) and almost always
indicates a corrupted commit graph or a test passing a sentinel
like -1. Fail-fast is the correct UX for a determinism API.
§Compile-time allow-list scope
Each entry below corresponds to an artifact pattern the
crate::determinism_report verification harness will actually
see in dist/. Entries are matched by *.ext suffix or exact
filename against the basename of every file the harness walks
under the per-run worktree’s dist/ tree. Pattern names that do
not match any real emitter output are dead code (silently never
resolve) — keep this list aligned with what stages actually drop
into dist/.
Notably absent (and intentionally so):
docker-manifest-descriptor/docker-image-blob: the docker stage is incrate::determinism_runner::SIDE_EFFECT_STAGESand skipped by the harness; the only docker file that lands indist/is a.digesttext file written by buildx (a deterministic sha256). No need for an allow-list entry.apple-notarization-receipt: the notarize stage mutates existing artifacts in-place (staples) rather than emitting new files; no separate “receipt” artifact lands indist/.*.exe-nsis: makensis writes plain.exefiles intodist/windows/; the suffix.exe-nsismatches nothing the harness ever sees. NSIS-built.exefiles only appear when running on Windows (or under Wine), and operators can use the runtime--allow-nondeterministic <name>=<reason>flag on those releases rather than hard-coding a dead sentinel here.
Sourcepub fn export_env(&self, cmd: &mut Command)
pub fn export_env(&self, cmd: &mut Command)
Export SOURCE_DATE_EPOCH onto a std::process::Command so
child subprocesses (cargo, tar, sbom tools, etc.) see the
reproducible epoch.
Sourcepub fn resolve_reason(&self, artifact: &str) -> Option<&str>
pub fn resolve_reason(&self, artifact: &str) -> Option<&str>
Resolve the allow-list reason for an artifact name. Compile-time entries win on collision per the spec’s “Operator escape / Precedence on collision” section. Returns None when the artifact is not in either list.
Sourcepub fn append_runtime(&mut self, artifact: String, reason: String)
pub fn append_runtime(&mut self, artifact: String, reason: String)
Append a runtime allow-list entry. Caller is the CLI flag
handler for --allow-nondeterministic <name>=<reason>.
Trait Implementations§
Source§impl Clone for DeterminismState
impl Clone for DeterminismState
Source§fn clone(&self) -> DeterminismState
fn clone(&self) -> DeterminismState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DeterminismState
impl Debug for DeterminismState
Source§impl Default for DeterminismState
impl Default for DeterminismState
Source§fn default() -> DeterminismState
fn default() -> DeterminismState
Source§impl<'de> Deserialize<'de> for DeterminismState
impl<'de> Deserialize<'de> for DeterminismState
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>,
Source§impl PartialEq for DeterminismState
impl PartialEq for DeterminismState
Source§fn eq(&self, other: &DeterminismState) -> bool
fn eq(&self, other: &DeterminismState) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for DeterminismState
impl Serialize for DeterminismState
impl Eq for DeterminismState
impl StructuralPartialEq for DeterminismState
Auto Trait Implementations§
impl Freeze for DeterminismState
impl RefUnwindSafe for DeterminismState
impl Send for DeterminismState
impl Sync for DeterminismState
impl Unpin for DeterminismState
impl UnsafeUnpin for DeterminismState
impl UnwindSafe for DeterminismState
Blanket Implementations§
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,
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.