diff --git a/.github/workflows/build-loader.yml b/.github/workflows/build-loader.yml index 067c142..d93b7b0 100644 --- a/.github/workflows/build-loader.yml +++ b/.github/workflows/build-loader.yml @@ -110,20 +110,30 @@ jobs: "VCPKG_ROOT=$vcpkg" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append Write-Host "Exported VCPKG_ROOT=$vcpkg to GITHUB_ENV" - # Cache the resolved Qt install + the file-backed binary archive. - # Key is keyed on vcpkg.json so any dependency change invalidates; - # restore-keys lets a vcpkg.json bump still warm-start from the - # previous build's archives. installed/ alone makes CMake's manifest - # mode skip rebuilding qtbase; archives/ also fills back transitive - # deps if a partial rebuild is needed. - - name: Cache vcpkg installed + archives + # Cache the vcpkg *binary archives* — the only thing that lets vcpkg skip + # rebuilding qtbase. The build runs `gradlew clean`, which deletes + # native/build/ (and thus the manifest install dir native/build/vcpkg_installed), + # so on every run vcpkg re-resolves the manifest and restores packages from + # this file-backed binary cache. If it's empty, qtbase is compiled from + # source (~32 min). (We previously cached vcpkg\installed too, but in + # manifest mode that tree is never consulted for the rebuild decision — only + # the binary archive is — so it was ~1.2 GB of dead weight.) + # + # The key MUST rotate per run: actions/cache never overwrites an existing + # key, so a static key froze whatever archives the first run captured (none) + # and every later run hit "cache hit, not saving" at Post — discarding the + # qtbase archive it had just rebuilt, guaranteeing a fresh 32-min rebuild + # forever. Appending run_id makes Post always save a new entry; the layered + # restore-keys warm-start from the newest prior archive so qtbase is + # restored, not rebuilt. (GitHub LRU-evicts old entries within the 10 GB + # budget; the archive is only a few hundred MB.) + - name: Cache vcpkg binary archives uses: actions/cache@v4 with: - path: | - vcpkg\installed - vcpkg-archives - key: vcpkg-qt-${{ runner.os }}-${{ hashFiles('native/vcpkg.json') }} + path: vcpkg-archives + key: vcpkg-qt-${{ runner.os }}-${{ hashFiles('native/vcpkg.json') }}-${{ github.run_id }} restore-keys: | + vcpkg-qt-${{ runner.os }}-${{ hashFiles('native/vcpkg.json') }}- vcpkg-qt-${{ runner.os }}- - name: Install UPX