You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add support for zstd compression of binary packages
This change adds zstd support to conan in the following ways:
1. The person or build running `conan upload` can set a config value
core.upload:compression_format = zstd
to upload binaries using zstd instead of gzip.
2. The zstd compression is done entirely in Python using a combination
of tarfile and python-zstandard. Then the file is uploaded as normal.
3. When downloading packages, if a .tar.zst file is encountered, the
extraction code uses tarfile and python-zstandard to extract.
I chose python-zstandard as the library because that is what urllib3 uses.
* Switch to include python-zstandard in the package requirements
Because zstd decompression is expected to just work if the server has a
.tar.zst file, I am including zstandard in requirements.txt.
https://python-zstandard.readthedocs.io/en/latest/projectinfo.html#state-of-project
recommends that we "Pin the package version to prevent unwanted breakage when this
change occurs!", although I doubt that much will change before an eventual 1.0.
* Add a test case to cover zstd compress and decompress
* Downgrade to 0.20.0 to fix CI
CI is unable to find 0.21.0
* Two small improvements
1. Change requirements.txt to allow either zstandard 0.20 or 0.21. That
prevents a downgrade for people who already have 0.21 installed, while
also allowing CI to find 0.20.
2. Move compressformat parameter earlier in compress_files() function.
It made a bit more sense to have it earlier; as long as consumers are
correctly using positional kwargs, it shouldn't break anyone.
* Address review feedback
* Add file missed by merge
* Fix typo in parameter which broke tests
* A few more small fixes in hopes of unbreaking the build
1. Fix bad merge causing uploader.py change to still refer to `self._app.cache.new_config`, when now we are supposed to use `self._global_conf`.
2. Change two output calls in uploader.py to only output the package file basename to be consistent with other existing log lines.
3. Use double quotes instead of single quotes to be more consistent with existing code.
* Some more improvements
1. Downgrade bufsize to 32KB because that performs well for compression and
decompression. The values don't need to be the same, but it happened to be
the best value in both compression and decompression tests.
2. Use a context manager for stream_reader as I do for stream_writer.
3. Add some comments about the bufsize value.
* Address some of the review feedback
Still need to do some testing though.
* Flush zstd frames around every 128MB
* Fix DeprecationWarning
Newer Python has this warning:
DeprecationWarning: Python 3.14 will, by default, filter extracted tar archives
and reject files or modify their metadata. Use the filter argument to control
this behavior
* wip
* wip
* review
* compression for cache save/restore too
* fix unit test
* fix tests
* fix tests
* fix save/restore with Path
* last review
* fix tests
---------
Co-authored-by: Adam Gross <grossag@vmware.com>
"core.gzip:compresslevel": "The Gzip compression level for Conan artifacts (default=9)",
67
+
"core:compresslevel": "The compression level for Conan artifacts (default zstd=3, gz=9)",
65
68
# Excluded from revision_mode = "scm" dirty and Git().is_dirty() checks
66
69
"core.scm:excluded": "List of excluded patterns for builtin git dirty checks",
67
70
"core.scm:local_url": "By default allows to store local folders as remote url, but not upload them. Use 'allow' for allowing upload and 'block' to completely forbid it",
0 commit comments