ci: Mitigate network issues in native Windows job #35024

pull hebasto wants to merge 2 commits into bitcoin:master from hebasto:260407-vcpkg-dl-cache changing 1 files +15 −12
  1. hebasto commented at 3:30 pm on April 7, 2026: member

    This PR mitigates network issues when vcpkg downloads source tarballs by caching the entire vcpkg/downloads directory.

    Closes #34996.

    Note for Maintainers: To properly populate the new CI cache, all current vcpkg binary caches must be cleared to trigger a rebuild.

  2. hebasto added the label Windows on Apr 7, 2026
  3. hebasto added the label Tests on Apr 7, 2026
  4. DrahtBot commented at 3:30 pm on April 7, 2026: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

  5. hebasto commented at 4:43 pm on April 7, 2026: member

    The size of windows-native-dll-vcpkg-downloads is about 1.2 GB, compared to 470 MB for windows-native-dll-vcpkg-tools.

    Perhaps we could exclude vcpkg/downloads/tools from the cache.

  6. hebasto marked this as a draft on Apr 7, 2026
  7. hebasto force-pushed on Apr 7, 2026
  8. hebasto commented at 9:23 pm on April 7, 2026: member

    Perhaps we could exclude vcpkg/downloads/tools from the cache.

    Done.

    The size of windows-native-dll-vcpkg-downloads is about 1.2 GB…

    It’s 800 MB now.

  9. maflcko commented at 6:11 am on April 8, 2026: member
    Can you explain why the tools were previously cached, what they are, and why it is fine to no longer cache them?
  10. hebasto commented at 7:53 am on April 8, 2026: member

    Can you explain why the tools were previously cached…

    To skip downloading and unpacking them whenever possible.

    … what they are…

    They are Windows binaries used for building packages for the target triplet. Here are the contents of the vcpkg/downloads/tools directory from the CI:

     0$ ls -l ~/AppData/Local/vcpkg/downloads/tools
     1total 164
     2drwxr-xr-x 1 runneradmin 197121 0 Apr  7 14:37 jom
     3drwxr-xr-x 1 runneradmin 197121 0 Apr  7 14:46 meson-1.8.2-3d2461
     4drwxr-xr-x 1 runneradmin 197121 0 Apr  7 14:49 msys2
     5drwxr-xr-x 1 runneradmin 197121 0 Apr  7 14:37 nasm
     6drwxr-xr-x 1 runneradmin 197121 0 Apr  7 14:29 ninja
     7drwxr-xr-x 1 runneradmin 197121 0 Apr  7 14:37 perl
     8drwxr-xr-x 1 runneradmin 197121 0 Apr  7 14:29 powershell-core-7.5.4-windows
     9drwxr-xr-x 1 runneradmin 197121 0 Apr  7 14:46 python
    10drwxr-xr-x 1 runneradmin 197121 0 Apr  7 14:46 win_bison
    

    … and why it is fine to no longer cache them?

    It is a tradeoff. The downloaded tool archives are now cached along with the package source tarballs. However, vcpkg has to unpack them on every run.

  11. in .github/workflows/ci.yml:262 in cd8092df88 outdated
    262-          path: ~/AppData/Local/vcpkg/downloads/tools
    263-          key: ${{ github.job }}-vcpkg-tools-${{ github.run_id }}
    264-          restore-keys: ${{ github.job }}-vcpkg-tools-
    265+          path: |
    266+            ~/AppData/Local/vcpkg/downloads/*
    267+            !~/AppData/Local/vcpkg/downloads/tools
    


    maflcko commented at 8:43 am on April 8, 2026:
    Is there a need to set a path on a download? Wouldn’t it be easier to just set the correct path on upload only?

    hebasto commented at 2:35 pm on April 9, 2026:
    Yes, there is a need. The path input participates in cache entity identification. Therefore, a pair of actions/cache/restore and actions/cache/save must have the exact same path configured, or it will result in a cache miss.
  12. in .github/workflows/ci.yml:290 in cd8092df88
    291         with:
    292-          path: ~/AppData/Local/vcpkg/downloads/tools
    293-          key: ${{ github.job }}-vcpkg-tools-${{ github.run_id }}
    294+          path: |
    295+            ~/AppData/Local/vcpkg/downloads/*
    296+            !~/AppData/Local/vcpkg/downloads/tools
    


    maflcko commented at 8:45 am on April 8, 2026:
    0            !~/AppData/Local/vcpkg/downloads/tools  # Cache the tools once as archives, but not redundantly in extracted form.
    

    nit: Maybe add a comment here, as per my question and your answer?


    hebasto commented at 2:28 pm on April 9, 2026:
    Thanks! The comment has been added.
  13. ci, refactor: Reuse primary key in `actions/cache/save`
    This avoids code duplication and improves readability.
    88bbf2ad33
  14. ci: Cache `vcpkg/downloads` folder in native Windows CI job
    The new cache is keyed with the hash of 'vcpkg.json', which reduces
    cache storage consumption compared to keying by run ID.
    
    The `vcpkg/downloads/tools` subdirectory is excluded to further save
    space.
    dc93091083
  15. hebasto force-pushed on Apr 9, 2026
  16. hebasto marked this as ready for review on Apr 9, 2026
  17. hebasto commented at 2:36 pm on April 9, 2026: member
    The feedback from @maflcko has been addressed.

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-12 00:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me