-
Notifications
You must be signed in to change notification settings - Fork 649
Update Rust crate zip to v3 #11179
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
Update Rust crate zip to v3 #11179
Conversation
Edited/Blocked NotificationRenovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR. You can manually request rebase by checking the rebase/retry box above. |
0e96fb9
to
87c9398
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rust-lang/crates-io I think the changes here make sense, but I'd appreciate a second pair of eyes before we merge this 🙏
Apparently the `zlib-rs` deflate implementation produces slightly different output to `miniz_oxide`, which results in the tarball checksums not matching up and the file sizes being off in some cases. AFAICT this is only relevant for the tarballs that are produced as fixtures by our own test suite and this doesn't actually influence the production code at all since the tarball reading code isn't affected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the storage config locally to file-based and extracted the crate files for those changed cases. Then, I ran the following script over them:
from os import walk
from pathlib import Path
import tarfile
import hashlib
def checksum(f, algo="sha256"):
return hashlib.file_digest(f, algo).hexdigest()
walked = [
(dirpath, dirnames, filenames)
for (dirpath, dirnames, filenames) in walk("./") if not dirnames
]
for (dirpath, dirnames, filenames) in sorted(walked):
for fname in sorted(filenames):
filepath = Path(dirpath) / fname
print(filepath)
with open(filepath, "rb", buffering=0) as f:
print('{} {}'.format(checksum(f), filepath))
with tarfile.open(filepath) as tf:
for member in tf.getmembers():
info = {
**member.get_info(),
"offset": member.offset,
"offset_data": member.offset_data,
"pax_headers": member.pax_headers,
}
print(info)
with tf.extractfile(member) as f:
print('{} {}'.format(checksum(f), member.name))
print()
I tried to see if each file within the crate also had the same checksum, and and the diff patch of the output shows that they do!
--- info_zip2.txt 2025-05-16 04:40:28
+++ info_zip3.txt 2025-05-16 04:40:33
@@ -1,85 +1,85 @@
-crates-zip2/basics_new_krate/foo_new-1.0.0.crate
-270bbe1624abd766746bf9938b791fadd88e7e0135339510837e11b45e167350 crates-zip2/basics_new_krate/foo_new-1.0.0.crate
+crates-zip3/basics_new_krate/foo_new-1.0.0.crate
+696b8fc0b2d62c399459b2000dbcab7d9914e5dfafff974f53c1212e02f014bb crates-zip3/basics_new_krate/foo_new-1.0.0.crate
{'name': 'foo_new-1.0.0/Cargo.toml', 'mode': 0, 'uid': 0, 'gid': 0, 'size': 89, 'mtime': 0, 'chksum': 4000, 'type': b'\x00', 'linkname': '', 'uname': '', 'gname': '', 'devmajor': 0, 'devminor': 0, 'offset': 0, 'offset_data': 512, 'pax_headers': {}}
96cd482c5ecab9d53ee2a2db7a8aee790a2a8f15ce91df947f3f77befc40fcd9 foo_new-1.0.0/Cargo.toml
-crates-zip2/basics_new_krate_twice/foo_twice-0.99.0.crate
-45b0b19cd0280034e07820789d9bb6e4016526eba85c75fc697d49ec99fd2550 crates-zip2/basics_new_krate_twice/foo_twice-0.99.0.crate
+crates-zip3/basics_new_krate_twice/foo_twice-0.99.0.crate
+99ef473e84e6bede426d948d4dca03d79a64acb51511ffcbeb11d253505c9968 crates-zip3/basics_new_krate_twice/foo_twice-0.99.0.crate
{'name': 'foo_twice-0.99.0/Cargo.toml', 'mode': 0, 'uid': 0, 'gid': 0, 'size': 92, 'mtime': 0, 'chksum': 4278, 'type': b'\x00', 'linkname': '', 'uname': '', 'gname': '', 'devmajor': 0, 'devminor': 0, 'offset': 0, 'offset_data': 512, 'pax_headers': {}}
cbbb5b0b96ed387bac35baf6f306d676817dfdc3395a538d39542db38ba40510 foo_twice-0.99.0/Cargo.toml
-crates-zip2/basics_new_krate_twice/foo_twice-2.0.0.crate
-d6e88a7d30b9e5c3d268ede9a9937b62815e45a06fd2c572d602e0705ab6513d crates-zip2/basics_new_krate_twice/foo_twice-2.0.0.crate
+crates-zip3/basics_new_krate_twice/foo_twice-2.0.0.crate
+7e71c271648114db81fa41450dd8d4d50c35622d3630e65c4f8211948bdf83f3 crates-zip3/basics_new_krate_twice/foo_twice-2.0.0.crate
{'name': 'foo_twice-2.0.0/Cargo.toml', 'mode': 0, 'uid': 0, 'gid': 0, 'size': 97, 'mtime': 0, 'chksum': 4212, 'type': b'\x00', 'linkname': '', 'uname': '', 'gname': '', 'devmajor': 0, 'devminor': 0, 'offset': 0, 'offset_data': 512, 'pax_headers': {}}
69b538db8f5c2f4bdf37361d25f3d11887fd06db9275976dd041e5e43c3a3e99 foo_twice-2.0.0/Cargo.toml
-crates-zip2/basics_new_krate_twice_alt/foo_twice-0.99.0.crate
-45b0b19cd0280034e07820789d9bb6e4016526eba85c75fc697d49ec99fd2550 crates-zip2/basics_new_krate_twice_alt/foo_twice-0.99.0.crate
+crates-zip3/basics_new_krate_twice_alt/foo_twice-0.99.0.crate
+99ef473e84e6bede426d948d4dca03d79a64acb51511ffcbeb11d253505c9968 crates-zip3/basics_new_krate_twice_alt/foo_twice-0.99.0.crate
{'name': 'foo_twice-0.99.0/Cargo.toml', 'mode': 0, 'uid': 0, 'gid': 0, 'size': 92, 'mtime': 0, 'chksum': 4278, 'type': b'\x00', 'linkname': '', 'uname': '', 'gname': '', 'devmajor': 0, 'devminor': 0, 'offset': 0, 'offset_data': 512, 'pax_headers': {}}
cbbb5b0b96ed387bac35baf6f306d676817dfdc3395a538d39542db38ba40510 foo_twice-0.99.0/Cargo.toml
-crates-zip2/basics_new_krate_twice_alt/foo_twice-2.0.0.crate
-d6e88a7d30b9e5c3d268ede9a9937b62815e45a06fd2c572d602e0705ab6513d crates-zip2/basics_new_krate_twice_alt/foo_twice-2.0.0.crate
+crates-zip3/basics_new_krate_twice_alt/foo_twice-2.0.0.crate
+7e71c271648114db81fa41450dd8d4d50c35622d3630e65c4f8211948bdf83f3 crates-zip3/basics_new_krate_twice_alt/foo_twice-2.0.0.crate
{'name': 'foo_twice-2.0.0/Cargo.toml', 'mode': 0, 'uid': 0, 'gid': 0, 'size': 97, 'mtime': 0, 'chksum': 4212, 'type': b'\x00', 'linkname': '', 'uname': '', 'gname': '', 'devmajor': 0, 'devminor': 0, 'offset': 0, 'offset_data': 512, 'pax_headers': {}}
69b538db8f5c2f4bdf37361d25f3d11887fd06db9275976dd041e5e43c3a3e99 foo_twice-2.0.0/Cargo.toml
-crates-zip2/dependencies_new_krate_sorts_deps/two-deps-1.0.0.crate
-e2366ac311619de0f137a23f8a88e2b2cc32a6986514fe67b426d5a9f83468fa crates-zip2/dependencies_new_krate_sorts_deps/two-deps-1.0.0.crate
+crates-zip3/dependencies_new_krate_sorts_deps/two-deps-1.0.0.crate
+8d88a5d9d97c440d32d2f8542395975effc3605b98e076a15f4023a004536ed8 crates-zip3/dependencies_new_krate_sorts_deps/two-deps-1.0.0.crate
{'name': 'two-deps-1.0.0/Cargo.toml', 'mode': 0, 'uid': 0, 'gid': 0, 'size': 134, 'mtime': 0, 'chksum': 4073, 'type': b'\x00', 'linkname': '', 'uname': '', 'gname': '', 'devmajor': 0, 'devminor': 0, 'offset': 0, 'offset_data': 512, 'pax_headers': {}}
80d37cc6bdaccca7f075b39e366090e7cf58ee57ab779c3444ae3f1cdb5d1410 two-deps-1.0.0/Cargo.toml
-crates-zip2/dependencies_new_krate_with_dependency/new_dep-1.0.0.crate
-b1ce14dbe59036a964369747770d2d64695039065384b1ab56f09a59525300a6 crates-zip2/dependencies_new_krate_with_dependency/new_dep-1.0.0.crate
+crates-zip3/dependencies_new_krate_with_dependency/new_dep-1.0.0.crate
+5503e734eb2fdc003688c5a275d4a6d8cd2a82135eb37befbda449feb8ea1800 crates-zip3/dependencies_new_krate_with_dependency/new_dep-1.0.0.crate
{'name': 'new_dep-1.0.0/Cargo.toml', 'mode': 0, 'uid': 0, 'gid': 0, 'size': 123, 'mtime': 0, 'chksum': 3995, 'type': b'\x00', 'linkname': '', 'uname': '', 'gname': '', 'devmajor': 0, 'devminor': 0, 'offset': 0, 'offset_data': 512, 'pax_headers': {}}
c7fbcada2656e3b830b39e9d2eedb9d9a06e069c2b1b18da78d5feee0e1c2f11 new_dep-1.0.0/Cargo.toml
-crates-zip2/dependencies_new_with_renamed_dependency/new-krate-1.0.0.crate
-78d9041c5262f137144a77dea8579e6281ff110b44fe7c4654f6ca132cccccaf crates-zip2/dependencies_new_with_renamed_dependency/new-krate-1.0.0.crate
+crates-zip3/dependencies_new_with_renamed_dependency/new-krate-1.0.0.crate
+f45e830a39be59e75f1d5c63a3c05856e0d68da52e0e00006b865327edd33431 crates-zip3/dependencies_new_with_renamed_dependency/new-krate-1.0.0.crate
{'name': 'new-krate-1.0.0/Cargo.toml', 'mode': 0, 'uid': 0, 'gid': 0, 'size': 156, 'mtime': 0, 'chksum': 4165, 'type': b'\x00', 'linkname': '', 'uname': '', 'gname': '', 'devmajor': 0, 'devminor': 0, 'offset': 0, 'offset_data': 512, 'pax_headers': {}}
87fcbe69c9c3711cf88e5484536e75e2a9aeb85a1950b4537350748955810069 new-krate-1.0.0/Cargo.toml
-crates-zip2/dependencies_new_with_underscore_renamed_dependency/new-krate-1.0.0.crate
-a53250c08af1d1cc060bc5145afadfd0b07708406d8943ae1d6b76131d78955f crates-zip2/dependencies_new_with_underscore_renamed_dependency/new-krate-1.0.0.crate
+crates-zip3/dependencies_new_with_underscore_renamed_dependency/new-krate-1.0.0.crate
+608b7a65a1292ef1de0fc4c453b0ec978c93bc36a11eb0b12cd301ab55c3a760 crates-zip3/dependencies_new_with_underscore_renamed_dependency/new-krate-1.0.0.crate
{'name': 'new-krate-1.0.0/Cargo.toml', 'mode': 0, 'uid': 0, 'gid': 0, 'size': 157, 'mtime': 0, 'chksum': 4166, 'type': b'\x00', 'linkname': '', 'uname': '', 'gname': '', 'devmajor': 0, 'devminor': 0, 'offset': 0, 'offset_data': 512, 'pax_headers': {}}
edc157b376c483f61846a3ab2c4c9d230371a97cbd75a20477ac69deafc2708f new-krate-1.0.0/Cargo.toml
-crates-zip2/edition_edition_is_saved/foo-1.0.0.crate
-7bca599a373dd56631d8c47704f17d2c166e75ffc7327c6dcc54c91e3d290e5b crates-zip2/edition_edition_is_saved/foo-1.0.0.crate
+crates-zip3/edition_edition_is_saved/foo-1.0.0.crate
+7008c5c6b6cbf418070a998fad244bbde3ca712148e61e4d4b0d257682e30ad2 crates-zip3/edition_edition_is_saved/foo-1.0.0.crate
{'name': 'foo-1.0.0/Cargo.toml', 'mode': 0, 'uid': 0, 'gid': 0, 'size': 184, 'mtime': 0, 'chksum': 3579, 'type': b'\x00', 'linkname': '', 'uname': '', 'gname': '', 'devmajor': 0, 'devminor': 0, 'offset': 0, 'offset_data': 512, 'pax_headers': {}}
f78c6339e32949ce125e2496c17447b8a2786f14eb2da1706f7fa041d097dda1 foo-1.0.0/Cargo.toml
-crates-zip2/features_feature_name_start_with_number_and_underscore/foo-1.0.0.crate
-6f73fad556c46cdb740173ccc7a5f5bf64b8d954966be16963a08eb138e3c69c crates-zip2/features_feature_name_start_with_number_and_underscore/foo-1.0.0.crate
+crates-zip3/features_feature_name_start_with_number_and_underscore/foo-1.0.0.crate
+ee98333f656a2a5f7b21a3b8f50313a8f5f1e7333f37a5dc7537ff5877d286ef crates-zip3/features_feature_name_start_with_number_and_underscore/foo-1.0.0.crate
{'name': 'foo-1.0.0/Cargo.toml', 'mode': 0, 'uid': 0, 'gid': 0, 'size': 131, 'mtime': 0, 'chksum': 3575, 'type': b'\x00', 'linkname': '', 'uname': '', 'gname': '', 'devmajor': 0, 'devminor': 0, 'offset': 0, 'offset_data': 512, 'pax_headers': {}}
fdde392a9f48093ef9d4a0f8ff58a356c817f0c54e225fd58fa8c13589634828 foo-1.0.0/Cargo.toml
-crates-zip2/features_feature_name_with_dot/foo-1.0.0.crate
-d0bfdbcd4905a15b3dc6db5ce23e206ac413b4d780053fd38e145a75197fb1e1 crates-zip2/features_feature_name_with_dot/foo-1.0.0.crate
+crates-zip3/features_feature_name_with_dot/foo-1.0.0.crate
+27dd07372333f362aa95ec0d2c1eb1027210edc57c8ab93d065d309a01b08de7 crates-zip3/features_feature_name_with_dot/foo-1.0.0.crate
{'name': 'foo-1.0.0/Cargo.toml', 'mode': 0, 'uid': 0, 'gid': 0, 'size': 112, 'mtime': 0, 'chksum': 3577, 'type': b'\x00', 'linkname': '', 'uname': '', 'gname': '', 'devmajor': 0, 'devminor': 0, 'offset': 0, 'offset_data': 512, 'pax_headers': {}}
09146528e425408f729d9b3592fd5f6050f183fda7052557cddcc442d17d601d foo-1.0.0/Cargo.toml
-crates-zip2/features_feature_name_with_unicode_chars/foo-1.0.0.crate
-493720846371607438c1a4eb90c9cc7d7286600ca9c4e2ca04151aad9563b47a crates-zip2/features_feature_name_with_unicode_chars/foo-1.0.0.crate
+crates-zip3/features_feature_name_with_unicode_chars/foo-1.0.0.crate
+12368623e4c78ae9412ec9a046ed915745bc7901a935ac2a01086ce33064180d crates-zip3/features_feature_name_with_unicode_chars/foo-1.0.0.crate
{'name': 'foo-1.0.0/Cargo.toml', 'mode': 0, 'uid': 0, 'gid': 0, 'size': 121, 'mtime': 0, 'chksum': 3579, 'type': b'\x00', 'linkname': '', 'uname': '', 'gname': '', 'devmajor': 0, 'devminor': 0, 'offset': 0, 'offset_data': 512, 'pax_headers': {}}
b0df911df447decb9816c074ae4f0682af07569fab927cd68c6b95d591519b4b foo-1.0.0/Cargo.toml
-crates-zip2/features_features_version_2/foo-1.0.0.crate
-a5e630c00549b2e92e874128eb6b6696537234fcd17c75045c5cadef07ba114d crates-zip2/features_features_version_2/foo-1.0.0.crate
+crates-zip3/features_features_version_2/foo-1.0.0.crate
+2afc013f11f59e88e299edb2e6e1c173435b91a164e19e74842a096bca9f68f8 crates-zip3/features_features_version_2/foo-1.0.0.crate
{'name': 'foo-1.0.0/Cargo.toml', 'mode': 0, 'uid': 0, 'gid': 0, 'size': 175, 'mtime': 0, 'chksum': 3584, 'type': b'\x00', 'linkname': '', 'uname': '', 'gname': '', 'devmajor': 0, 'devminor': 0, 'offset': 0, 'offset_data': 512, 'pax_headers': {}}
9177e8ffe5fa4696648645836ae5ff92c9a421c2fc5b92ad232fca03326ee33a foo-1.0.0/Cargo.toml
-crates-zip2/links_crate_with_links_field/foo-1.0.0.crate
-5631ca06d228e58274bbd8d6a3e81f7138a9e227a84bd63ecedb78afbc8144ea crates-zip2/links_crate_with_links_field/foo-1.0.0.crate
+crates-zip3/links_crate_with_links_field/foo-1.0.0.crate
+b2c9e153a8860ce92ba7cbdea7b718409d181c08f4c6c5c2a612919dcb155af2 crates-zip3/links_crate_with_links_field/foo-1.0.0.crate
{'name': 'foo-1.0.0/Cargo.toml', 'mode': 0, 'uid': 0, 'gid': 0, 'size': 123, 'mtime': 0, 'chksum': 3581, 'type': b'\x00', 'linkname': '', 'uname': '', 'gname': '', 'devmajor': 0, 'devminor': 0, 'offset': 0, 'offset_data': 512, 'pax_headers': {}}
2d06ff6e35bcd30b16ae0dbadd96b3494cd293cf6fd2c923c8417c34a49736ce foo-1.0.0/Cargo.toml
-crates-zip2/mainfest_boolean_readme/foo-1.0.0.crate
-418c24c55cbcde274a5b1815d2c844203c7116e7f712008f4727d38bc7c82d8d crates-zip2/mainfest_boolean_readme/foo-1.0.0.crate
+crates-zip3/manifest_boolean_readme/foo-1.0.0.crate
+50da036cb5dfa54c39ab25c02c31ca001fa103b4de41e3f79ca1d3b6877c775f crates-zip3/manifest_boolean_readme/foo-1.0.0.crate
{'name': 'foo-1.0.0/Cargo.toml', 'mode': 0, 'uid': 0, 'gid': 0, 'size': 193, 'mtime': 0, 'chksum': 3574, 'type': b'\x00', 'linkname': '', 'uname': '', 'gname': '', 'devmajor': 0, 'devminor': 0, 'offset': 0, 'offset_data': 512, 'pax_headers': {}}
9d94bd9b78527d7e303a982b83e254df2e05fb3a72626e2184bfc9b5f98f1f21 foo-1.0.0/Cargo.toml
-crates-zip2/manifest_lib_and_bin_crate/foo-1.0.0.crate
-ed125a8d83193391762787872f6363ef11d472fe9e963b984a761f970d63a7a8 crates-zip2/manifest_lib_and_bin_crate/foo-1.0.0.crate
+crates-zip3/manifest_lib_and_bin_crate/foo-1.0.0.crate
+2af566e52c8fb0376558a00b0bc426c699e8fe2b12807b75cbce7ccf54e37a98 crates-zip3/manifest_lib_and_bin_crate/foo-1.0.0.crate
{'name': 'foo-1.0.0/Cargo.toml', 'mode': 0, 'uid': 0, 'gid': 0, 'size': 85, 'mtime': 0, 'chksum': 3578, 'type': b'\x00', 'linkname': '', 'uname': '', 'gname': '', 'devmajor': 0, 'devminor': 0, 'offset': 0, 'offset_data': 512, 'pax_headers': {}}
e21a3c4018170df1986944b14cbfd76bf35ffa79ae17f30208932ee8197d38fd foo-1.0.0/Cargo.toml
{'name': 'foo-1.0.0/src/lib.rs', 'mode': 0, 'uid': 0, 'gid': 0, 'size': 15, 'mtime': 0, 'chksum': 3557, 'type': b'\x00', 'linkname': '', 'uname': '', 'gname': '', 'devmajor': 0, 'devminor': 0, 'offset': 1024, 'offset_data': 1536, 'pax_headers': {}}
@@ -89,7 +89,7 @@
{'name': 'foo-1.0.0/src/bin/bar.rs', 'mode': 0, 'uid': 0, 'gid': 0, 'size': 12, 'mtime': 0, 'chksum': 3912, 'type': b'\x00', 'linkname': '', 'uname': '', 'gname': '', 'devmajor': 0, 'devminor': 0, 'offset': 3072, 'offset_data': 3584, 'pax_headers': {}}
ef32637cb9c3ec2e3968c9cbdf26a5e9c172be94f88af533e14bd43f892d5297 foo-1.0.0/src/bin/bar.rs
-crates-zip2/yanking_patch_version_yank_unyank/patchable-1.0.0.crate
-ddfc395ab340f413ee1d1ed0afce51a7c9df1c99c551fed5aef76edd4abe4048 crates-zip2/yanking_patch_version_yank_unyank/patchable-1.0.0.crate
+crates-zip3/yanking_patch_version_yank_unyank/patchable-1.0.0.crate
+d4d2d515985c394dc9fa95c56b935ab0805f6dfbd91a6dc99af9d316dff96dc0 crates-zip3/yanking_patch_version_yank_unyank/patchable-1.0.0.crate
{'name': 'patchable-1.0.0/Cargo.toml', 'mode': 0, 'uid': 0, 'gid': 0, 'size': 91, 'mtime': 0, 'chksum': 4185, 'type': b'\x00', 'linkname': '', 'uname': '', 'gname': '', 'devmajor': 0, 'devminor': 0, 'offset': 0, 'offset_data': 512, 'pax_headers': {}}
85f1860701ea7fb1edba34c6ea73b38377fadb59d3a05e618aad8282d67111bf patchable-1.0.0/Cargo.toml
So, this upgrade also seems fine to me, I guess :D
This PR contains the following updates:
=2.6.1
->=3.0.0
=2.6.1
->=3.0.0
Release Notes
zip-rs/zip2 (zip)
v3.0.0
Compare Source
🐛 Bug Fixes
flate2
dependency of thedeflate-flate2
feature. (#345)⚙️ Miscellaneous Tasks
deflate-flate2
dependency on specific backenddeflate-miniz
feature flag (#351)Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.