Repository navigation
ci: link the Windows OpenVMM test builds with /Brepro for sccache - #714
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The narrow change preserves existing options and Linux behavior, includes regression coverage, and has no identified blocking issues.
No open issues 🎉
What changed in this PR
Improves Windows OpenVMM test-build cache reuse by making MSVC linking reproducible, supporting the CI turnaround goals in #693 and #430.
Changes:
- Adds
/Breproto Windows test environments while preserving existing linker options and Linux behavior. - Adds regression coverage for option handling and environment propagation.
- Documents compilation caching and Windows command behavior.
| File | Description |
|---|---|
| scripts/test_nvx_tools.py | Tests reproducible-link options and command environments. |
| scripts/nvx_tools/ci.py | Enables reproducible linking for Windows OpenVMM test builds. |
| doc/usage.md | Documents Windows test-command behavior. |
| doc/ci.md | Explains runner-local caches and reproducible linking. |
Review effort: Balanced
5 tasks
Pedro Henrique Penna (ppenna)
force-pushed
the
agents/windows-sccache-misses
branch
from
October 21, 2026 17:10
f556c6a to
9bc1068
Compare
The Windows OpenVMM jobs hit sccache for 82.6% of their Rust compilations (VMM tests) and 77.8% (unit tests), against 99.3-99.7% on Linux, and every job missed the same 247 and 293 compilations, whatever its runner and cache size. sccache cannot cache proc macros, so every build relinks them, and it keys each compilation on the contents of the libraries that it names with --extern. MSVC's link.exe stamps each DLL with the time of the link and a random PDB signature, so every proc macro came out different in every build, and each crate that uses one directly missed. flowey builds openvmm and pipette in target directories of their own, so the same crates missed again within the job. A diagnostic run with SCCACHE_LOG=debug (#693) built the WHP VMM tests twice on one runner: both builds missed the same 247 compilations, all 99 proc-macro DLLs differed between them, 244 of the misses named one of them, and none of the 1,174 hits did. The other misses come from smoltcp 0.12, whose build script writes its configuration in hash-map order on every platform. On Windows, test-openvmm and test-openvmm-unit now append /Brepro to _LINK_, which link.exe appends to every command line, so that it derives the timestamp and signature from the image's contents. RUSTFLAGS would not reach the proc macros of the builds that flowey runs with --target. An existing _LINK_ is kept, and the option is not added twice. In the same diagnostic run, the second build with /Brepro on a runner hit 99.72% of the VMM-test compilations and 99.47% of the unit-test ones. The time before the WHP VMM tests start fell from a median of 852 seconds over 13 dev pushes to 641, and the Windows unit-test step from 876 to 643 seconds. Every test still passed. Tests cover the option's insertion, an existing _LINK_, and the environments of both commands on each operating system. doc/ci.md describes the runner compilation cache and the change, and doc/usage.md the commands' new behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pedro Henrique Penna (ppenna)
force-pushed
the
agents/windows-sccache-misses
branch
from
October 21, 2026 17:50
9bc1068 to
490dfd5
Compare
Pedro Henrique Penna (ppenna)
deleted the
agents/windows-sccache-misses
branch
October 21, 2026 18:45
This was referenced Oct 21, 2026
Merged
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.
Closes #693.
Part of #430.
Summary
On Windows, every OpenVMM build relinked each proc macro into a DLL with new bytes, because MSVC's
link.exestamps the time of the link and a random PDB signature into every image. sccache keys a compilation on the contents of the libraries that it names with--extern, so each crate that uses a proc macro directly missed the cache in every build, on every runner, whatever the cache size. This PR makestest-openvmmandtest-openvmm-unitappend/Breproto_LINK_on Windows, which makeslink.exederive both from the image's contents. With it, a warm runner hits 99.7% of the WHP VMM-test compilations and 99.5% of the Windows unit-test ones, like Linux.The investigation, the breakdown of the WHP
test-openvmmstep, the shared-cache evaluation, and theSCCACHE_CACHE_SIZErecommendation are recorded on #693.Why
Constant misses. Over 13 WHP VMM-test jobs of
devpushes from October 19 to 21 (39254314492 through 39603556404), on six runners whose caches held 4 to 10 GiB, every job made 1,779 requests and had 1,174 hits and 247 misses (82.62%). The 8 Windows unit-test jobs of runners with warm caches each had 293 misses (77.77%). Linux KVM and unit-test jobs had 4 and 9 misses (99.7% and 99.3%).Cause. A diagnostic run on a temporary branch (39616159470) built the WHP VMM tests with
SCCACHE_LOG=debug:/Brepro(azure-windows-3)/Brepro(azure-windows-6)/Brepro(azure-windows-1)/Brepro, 1,431 of the 1,438 cacheable compilations had identical arguments (the other 7 differ only in the order of--cfgflags, which sccache sorts), yet 244 of the 247 misses named a proc-macro DLL with--extern, and none of the 1,174 hits did.bitfield_struct(80 misses) andasync_trait(70). flowey buildsopenvmmandpipettein target directories of their own, and the light, host, and target builds compile some crates separately, sozerocopy,thiserror, andfutures-utileach miss seven times per job.smoltcp0.12, whose build script writesconfig.rsinHashMaporder on every platform, sosmoltcp,consomme,net_consomme(which also usesasync_trait), andopenvmm_resourcesmiss in every build. They're the 4 misses that remain with/Brepro, and probably Linux's 4. smoltcp 0.14 sorts the file, so that's an OpenVMM dependency update, outside NVX._LINK_=/Brepro, the DLLs are identical and every crate hits.Changes
scripts/nvx_tools/ci.py: on Windows,run_openvmm_tests(through_prepare_openvmm_test_environment) andrun_openvmm_unit_testsappend/Breproto_LINK_for every command, including the flowey build and the fuzz-crate query, which buildsxtask.link.exeappends_LINK_to every command line, so it reaches the proc macros and build scripts that flowey builds with--target, whichRUSTFLAGSwould not. An existing_LINK_is kept, and the option isn't added twice.doc/ci.mddescribes the runner-local sccache caches and the change;doc/usage.mdnotes the commands' behavior on Windows.No workflow, action, runner setting, or cache key changes. The sccache keys of crates that don't use a proc macro are unchanged, so only the affected crates miss once more on each runner, as they did in every job until now.
Tests
test_openvmm_windows_builds_link_reproducibly: the option's insertion into an empty, missing, or existing_LINK_, and no duplicate when/Breproor-breprois already present.run_openvmm_unit_tests,run_openvmm_tests, and_prepare_openvmm_test_environmenttests now check the environment of every command:_LINK_gets/Breproon Windows and stays unchanged on Linux.Validation
96332e826:test_nvx_tools(488 tests), and before the rebase the fullvalidate-nvxmodule list: 1,088 tests, all passing except 18 Linux shell-script tests intest_setup_azure, which fail the same way on a pristine copy oforigin/devon this machine;test_adversarial.py,test_hosts.py, and thenvx.py --helpsmoke tests;ruff check,ruff format --check,pyrightfor the Linux and Windows platforms,check_markdown_links.py, andgit diff --check.CiTests._prepare_openvmm_test_environmentto take several backends, so the option is keyed on the operating system rather than the backend; on a trial merge with ci: build the Linux OpenVMM VMM tests once for the KVM and MSHV jobs #708, all 16CiTestspass./Brepro: all 29 WHP VMM tests passed in both builds, and all 4,933 unit tests and the doctests passed in both builds.validate-nvx; the Specula wiring tests, which importfcntland run only on Linux; the OpenVMM unit and VMM tests on every backend; and the microVM and platform jobs. No shell or PowerShell file changes.Expected effect
From the 13
devpushes above to the second build with/Breproin the diagnostic run:test-openvmmstepopenvmmbuildpipette,guest_test_uefi, and the UEFI imagextaskbuild for the fuzz-crate query/Brepro./Breprostill misses about 240 compilations once, because the new DLLs give the affected crates new keys, so this PR's own CI shows little of the effect.testsandopenvmmexecutables take about 190 s each.Post-merge verification
devpushes or full runs that run both OpenVMM suites on runners that have already built them with/Brepro, compare with the 13 jobs above: the Windows Rust hit rates (expected about 99.7% and 99.5%), the WHP time before tests start (expected about 640 s), the Windows unit-test step (expected about 640 s), and the runners' cache sizes. Record them on ci: investigate why the Windows OpenVMM builds miss sccache #693.