Skip to content

Document binary cache ZIP compression settings - #613

Merged
Billy O'Neal (BillyONeal) merged 1 commit into
MicrosoftDocs:mainfrom
xiaozhuai:codex/binary-cache-compression-level
Oct 1, 2026
Merged

Billy O'Neal (BillyONeal) merged 1 commit into
MicrosoftDocs:mainfrom
xiaozhuai:codex/binary-cache-compression-level

Conversation

@xiaozhuai

Copy link
Copy Markdown
Contributor

Documents --binary-cache-compression-level=<0-9> and VCPKG_BINARY_CACHE_COMPRESSION_LEVEL in the common command options and environment variable references, including precedence, defaults, validation, provider scope, and cache compatibility.

Companion to microsoft/vcpkg-tool#2125 for microsoft/vcpkg#53923. Moved out of the tool repository following BillyONeal's review. This is a draft pending the implementation's acceptance.

Validation: relative links and section anchors checked; preserved each file's existing line endings; whitespace checked with core.whitespace=cr-at-eol for the existing CRLF file.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit e4afd61:

✅ Validation status: passed

File Status Preview URL Details
vcpkg/commands/common-options.md ✅Succeeded View
vcpkg/users/config-environment.md ✅Succeeded View

For more details, please refer to the build report.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

PoliCheck Scan Report

The following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans.

✅ No issues found

More information about PoliCheck

Information: PoliCheck | Severity Guidance | Term
For any questions: Try searching the learn.microsoft.com contributor guides or post your question in the Learn support channel.

@xiaozhuai
xiaozhuai (xiaozhuai) marked this pull request as ready for review September 18, 2026 01:26
Billy O'Neal (BillyONeal) pushed a commit to microsoft/vcpkg-tool that referenced this pull request Sep 23, 2026
Adds `--binary-cache-compression-level=<0-9>` and
`VCPKG_BINARY_CACHE_COMPRESSION_LEVEL` so users can trade archive size
for binary-cache submission time. The command-line option takes
precedence; leaving both unset preserves the archive tool's default
compression level. Invalid values are rejected with a localized
diagnostic.

The common ZIP creation path passes the configured level to 7-Zip
(`-mx=<level>`) on Windows and `zip` (`-<level>`) elsewhere, covering
every binary-cache provider that requests a ZIP archive. 7-Zip
explicitly uses `-tzip` regardless of whether a level is configured.
NuGet packaging is unaffected, and changing the setting does not change
package ABIs or prevent restoration of existing archives.

Tests cover defaults, every configured level, argument validation and
precedence, and one cache-only restoration using `--only-binarycaching`
with a different compression setting and an exact payload comparison.
The test harness isolates the new environment variable.

Reuses the existing `vcpkg-header-only` test port. The temporary
`ci.ps1` output-capture workaround has been removed after merging
upstream's fix from #2127; `ci.ps1` now matches upstream main.

Documentation: MicrosoftDocs/vcpkg-docs#613

Fixes microsoft/vcpkg#53923

Validation after merging current upstream main:
- macOS Debug build; all 534 unit tests passed (8,005 assertions).
- Actual PowerShell execution of the binary-cache-compression and ci
suites passed, using the repository prelude and a local runner with
`/opt/vcpkg`.
- PowerShell message-usage validation passed; regenerated message map
matches.
- `git diff --check` passed.
- Prior macOS integration checks covered archive integrity, restored
payloads, and eight invalid CLI/environment values.

Windows and Linux execution for the latest revision is left to CI.

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@BillyONeal Billy O'Neal (BillyONeal) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@BillyONeal
Billy O'Neal (BillyONeal) merged commit c2628b2 into MicrosoftDocs:main Oct 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants