Skip to content

feat: Verify conda package's sha256 or md5 from pixi.lock#260

Open
e8035669 wants to merge 6 commits intoQuantco:mainfrom
e8035669:verify-checksum
Open

feat: Verify conda package's sha256 or md5 from pixi.lock#260
e8035669 wants to merge 6 commits intoQuantco:mainfrom
e8035669:verify-checksum

Conversation

@e8035669
Copy link
Contributor

@e8035669 e8035669 commented Jan 18, 2026

Motivation

closes #217

Changes

  • Explicitly call tokio::File::flush() before dropping the File object, as the documentation notes that "a file will not be closed immediately when it goes out of scope".
  • Use rattler_digest::compute_file_digest() to verify the file checksum (SHA-256 or MD5) when a corresponding digest is available.
  • Enabled tokio feature for rattler_digest to enable async I/O support.
  • Use rattler_digest::HashingWriter to verify the file checksum (SHA-256 or MD5) when a corresponding digest is available.

If updating documentation:

@e8035669 e8035669 changed the title Verify conda package's sha256 or md5 from pixi.lock feat: Verify conda package's sha256 or md5 from pixi.lock Jan 18, 2026
@github-actions github-actions bot added the enhancement New feature or request label Jan 18, 2026
src/pack.rs Outdated
}

if let Some(sha256hash) = package.package_record.sha256 {
let output = compute_file_digest::<Sha256>(&output_path)?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about we compute the hashes in-flight like we do in conda-mirror?
this is more memory efficient and doesn't require us reading the file multiple times

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I refactor to compute the hashes in-flight. It looks better than before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Verify conda package's sha256 or md5 from pixi.lock

2 participants