feat: propagate sha256, md5, and size for direct URL packages#2303
Open
tarun-227 wants to merge 1 commit intoconda:mainfrom
Open
feat: propagate sha256, md5, and size for direct URL packages#2303tarun-227 wants to merge 1 commit intoconda:mainfrom
tarun-227 wants to merge 1 commit intoconda:mainfrom
Conversation
When a package is installed from a direct URL, the ExtractResult computed during download already contains sha256, md5, and total_size. Previously these values were discarded after hash validation, leaving the PackageRecord with None for size and potentially missing hashes. This change: - Adds md5 and size fields to CacheMetadata with public getters - Captures ExtractResult metadata via shared state in the fetch closure - Uses the computed values when building PackageRecord in DirectUrlQuery - For local file URLs, reads size from file metadata Closes conda#742
Collaborator
|
Fill in the PR template correctly. Also as a word of warning this was seems to have been completely AI generated, including the PR text which is against our AI policy. You are on thin ice here, given your other PR basically does the same thing. |
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.
Summary
ExtractResultcomputed during download already containssha256,md5, andtotal_size, but these values were previously discarded after hash validationmd5andsizefields toCacheMetadatawith public getters (sha256(),md5(),size())CacheMetadataDirectUrlQuerynow uses these computed values when buildingPackageRecord, instead of passingNonefor sizeMotivation
Closes #742. Direct URL packages had
sha256,md5, andsizeset toNonein theirPackageRecordeven though the values were computed during extraction.Test plan
cargo check -p rattler_cache -p rattler_repodata_gatewaycompiles cleanlycargo fmt --checkpassesOptiontypes and existing callers are unaffected