Skip to content

update zig package hashes to include the uncompressed total file size on disk #16528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andrewrk opened this issue Jul 24, 2023 · 1 comment
Closed
Labels
accepted This proposal is planned. proposal This issue suggests modifications. If it also has the "accepted" label then it is planned. zig build system std.Build, the build runner, `zig build` subcommand, package management
Milestone

Comments

@andrewrk
Copy link
Member

Zig package manager hashes currently use multihash to encode metadata into the hash bytes. For example, which hash algorithm is used. Additionally, we can encode more information, such as the uncompressed total file size of the package, without breaking prior hashes, thanks to this encoding.

This would allow for better progress reporting when running zig build and packages are being fetched, even when the server responds with content-encoding: chunked. This would require some fun bookkeeping, such as streaming the http response through the decompressor through tarball unpacking, through the filtering process (#14311), and then counting how many bytes are actually written to disk.

It would work, though!

@andrewrk andrewrk added proposal This issue suggests modifications. If it also has the "accepted" label then it is planned. zig build system std.Build, the build runner, `zig build` subcommand, package management labels Jul 24, 2023
@andrewrk andrewrk added this to the 0.12.0 milestone Jul 24, 2023
@andrewrk andrewrk modified the milestones: 0.13.0, 0.12.0 Aug 5, 2023
@andrewrk andrewrk modified the milestones: 0.12.0, 0.13.0 Sep 26, 2023
@andrewrk andrewrk modified the milestones: 0.14.0, 0.15.0 Feb 9, 2025
@andrewrk andrewrk added the accepted This proposal is planned. label Mar 12, 2025
@andrewrk andrewrk modified the milestones: 0.15.0, 0.14.0 Mar 12, 2025
@andrewrk
Copy link
Member Author

Landed in 12355cf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted This proposal is planned. proposal This issue suggests modifications. If it also has the "accepted" label then it is planned. zig build system std.Build, the build runner, `zig build` subcommand, package management
Projects
None yet
Development

No branches or pull requests

1 participant