refactor(aggregator): deterministic snapshots archives - #3479
Open
Alenar wants to merge 15 commits into
Open
Conversation
…mlink following in tar builder configuration
…deterministic archive output
…s-specific tests
…to a dedicated crate
Test Results 5 files ± 0 221 suites +12 58m 6s ⏱️ - 1h 28m 25s Results for commit c7ed6f2. ± Comparison against base commit 58b575a. This pull request removes 109 and adds 59 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Alenar
force-pushed
the
djo/3435/deterministic-snapshots-archives
branch
2 times, most recently
from
August 13, 2026 15:56
b8fd841 to
21334d2
Compare
…ion tests into multiple files
…and centralize `unpack_archive` test utility function
…tp-server` dependencies
… byte stability across builds - `tar` pinned to `0.4.46` - `zstd` pinned to `0.13.3`
…lization across platforms
…date golden master hashes
…s, update usages to `AppenderEntries` or new `FailAppender`
Alenar
force-pushed
the
djo/3435/deterministic-snapshots-archives
branch
from
August 13, 2026 16:25
21334d2 to
c7ed6f2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Content
This PR harden the archives building of the
mithril-aggregatorin order to makes them bytes identical for a given content.It extract the
FileArchiverapi from the Aggregator into introduces a new library,mithril-file-archiver, with additional changes to ensure deterministic, byte-stable.tar.zstarchives creations.Main Changes
New Library Added:
Introduces
mithril-file-archiveras a standalone library for generating deterministic archives. Like the previous api, it supports archiving files, directories, or serializable data with compression.Existing File Archiver Logic Removed: The previously internal
file_archiverand associated modules (appender,tools, etc.) in themithril-aggregatorfolder have been moved to the new library.mithril-aggregatorto integratemithril-file-archiverfor tasks like snapshot generation and ancillary file handling.FileArchiver::new_with_default_parametersandFileArchiveTestExtension). - Existing tests in mithril-aggregator were adapted accordingly.zstdandtarinmithril-aggregator.Documentation:
mithril-file-archiver, its API, and usage constraints.Other:
follow_symlinkssupport is now disabled in theFileArchiver(as recommended in their doc)tempfile, andmithril-test-http-serverHow deterministic archives were achieved
HeaderMode::Deterministic: this set themtimeto a fix value (timestamp1153704088, date: Jul 23, 2006), theguidandgidto0, and the permissions to644for files and755for directories (see the code here)sparsefile support is disabled as it's not consistent across systems and the zstandard will compress the sparse part itself anywayAppenderEntriesentries list:/from directory names (or\on Windows)./from pathAppenderDatametadata:mtimeis set instead of the current time: randomly choose to1767225600(2026-01-01 00:00:00 UTC)AppenderDirAll: the order of the files and folder is not stable across systems, if needed, it could be re-created as a constructor ofAppenderEntry(from_directory) which would do the same job of recursively adding all entries but would then leverage its normalization passPre-submit checklist
Issue(s)
Relates to #3435