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/.- The NSIS installer (
*-setup.exe/*_setup.exe) is GATED, not allow-listed. makensis honorsSOURCE_DATE_EPOCHfor the embedded build timestamp, so two builds over identical inputs are byte-identical — proven by stage-nsis::nsis_setup_is_byte_reproducible_across_time. Under the A′ shard routing the installer now lands indist/windows/on the Windows determinism shard (it builds the windows-msvc payload binary), so the harness DOES see and byte-compare it. The classifier keys on thesetup.exename tail so the installer is attributed tonsiswhile the rawanodize.exebinary is not (seedeterminism_harness::artifacts::infer_stage_from_path). A real drift here is a regression, not an excused non-determinism. - The macOS
.appbundle is GATED, not allow-listed. It is pure file assembly (Info.plist + binary copy) at a fixed mtime /SOURCE_DATE_EPOCH, so it is byte-reproducible — proven by stage-appbundle::appbundle_is_byte_reproducible_across_time. Under A′ it is produced on the macOS determinism shard (which holds the darwin payload binary), so the harness byte-compares it directly.
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>,
impl Eq for DeterminismState
Source§impl PartialEq for DeterminismState
impl PartialEq for DeterminismState
Source§impl Serialize for DeterminismState
impl Serialize 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,
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.