Skip to content

Windows reproducible build & ccache hit rate improvement#4419

Open
amd-nicknick wants to merge 4 commits intomainfrom
users/nicknick/win-ccache-repro
Open

Windows reproducible build & ccache hit rate improvement#4419
amd-nicknick wants to merge 4 commits intomainfrom
users/nicknick/win-ccache-repro

Conversation

@amd-nicknick
Copy link
Copy Markdown
Contributor

@amd-nicknick amd-nicknick commented Apr 9, 2026

Motivation

Fixes #4519, parent issue #4195

Technical Details

  • Reproducible builds on Windows via /Brepro for MSVC toolchain
    Ensure amd-llvm is reproducible & COFF header contains a reproducible hash instead of current timestamp.
  • compiler_check=content for Windows
    Switch compiler_check from mtime to content. Since the LLVM toolchain on Windows is statically linked, hashing the compiler binary content is sufficient and more reliable for detecting actual compiler changes across CI runs.
  • Support PCH
    Add pch_defines and time_micros to ccache sloppiness. amd-llvm on Windows builds uses precompiled headers by default.
  • Misc changes to ccache config
    Max size bump to 10G, rename secondary_storage to remote_storage

Test Plan

Validate cache hitrate on Windows following subsequent buil.ds

Test Result

(therock-build-venv) D:\Nick\TheRock\TheRock>ccache -s -v
Cache directory:                D:\Nick\TheRock\TheRock\.ccache\local
Config file:                    D:\Nick\TheRock\TheRock\.ccache\ccache.conf
System config file:
Stats updated:                  04/17/26 05:11:03
Cacheable calls:                28464 /  30423 (93.56%)
  Hits:                         28128 /  28464 (98.82%)
    Direct:                     28128 /  28128 (100.0%)
    Preprocessed:                   0 /  28128 ( 0.00%)
  Misses:                         336 /  28464 ( 1.18%)
Uncacheable calls:               1959 /  30423 ( 6.44%)
  Compilation failed:              13 /   1959 ( 0.66%)
  Compiler output file missing:  1149 /   1959 (58.65%)
  No input file:                  371 /   1959 (18.94%)
  Preprocessing failed:            69 /   1959 ( 3.52%)
  Unsupported code directive:       3 /   1959 ( 0.15%)
  Unsupported compiler option:    354 /   1959 (18.07%)
Successful lookups:
  Direct:                       28128 /  29698 (94.71%)
  Preprocessed:                     0 /   1498 ( 0.00%)
Local storage:
  Cache size (GB):                7.2 / 1024.0 ( 0.70%)
  Files:                        68376
  Hits:                         28128 /  28464 (98.82%)
  Misses:                         336 /  28464 ( 1.18%)
  Reads:                        59324
  Writes:                         672

Submission Checklist

@amd-nicknick amd-nicknick force-pushed the users/nicknick/win-ccache-repro branch 2 times, most recently from f2d6892 to 1b5b39e Compare April 13, 2026 05:52
@amd-nicknick amd-nicknick force-pushed the users/nicknick/win-ccache-repro branch from 1b5b39e to 6bb28ad Compare April 14, 2026 12:19
@amd-nicknick amd-nicknick changed the title Add /Brepro flag to MSVC when building LLVM Windows reproducible build & ccache hit rate improvement Apr 14, 2026
@amd-nicknick amd-nicknick force-pushed the users/nicknick/win-ccache-repro branch from 6bb28ad to f5c4f87 Compare April 14, 2026 12:25
Comment thread build_tools/setup_ccache.py
@amd-nicknick amd-nicknick force-pushed the users/nicknick/win-ccache-repro branch from b111e5b to 3e7e2b0 Compare April 20, 2026 08:35
@amd-nicknick amd-nicknick force-pushed the users/nicknick/win-ccache-repro branch from 3e7e2b0 to f57b671 Compare April 20, 2026 08:51
@amd-nicknick amd-nicknick marked this pull request as ready for review April 20, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: TODO

Development

Successfully merging this pull request may close these issues.

[CI] Windows ccache hit rate improvement

2 participants