From d287a9004811bfd678b25cb2e76296b9b68c78d6 Mon Sep 17 00:00:00 2001 From: Josh Knapp Date: Mon, 7 Sep 2026 06:10:55 -0700 Subject: [PATCH] ci: strip the non-relocatable OBS build tree before caching .deps The obs-studio sub-build's out-of-source CMakeCache.txt (.deps/obs-studio-*/build_*) bakes in the job's absolute checkout path. Caching it as-is (from the previous .deps caching commit) meant every run's first configure attempt hard-failed with: CMake Error: The current CMakeCache.txt directory ... is different than the directory ... where CMakeCache.txt was created. Confirmed live in run 3091 (commit 1f342b1): this was silently self-healing, since windows-build.ps1's existing fallback (-DSTPLUGIN_BOOTSTRAP_OBS=OFF) still found the already-installed, path-independent libobs package and the build succeeded anyway -- but every run paid for one guaranteed-failed configure and printed a misleading "::warning::OBS SDK bootstrap failed" that isn't actually true. Delete only the build tree, after libobs is already built and installed from it, so nothing path-dependent survives into the cache. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01RL8abRmgFXkVASHkkqiJbE --- .gitea/workflows/build.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index c634868..c41ba4c 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -85,6 +85,25 @@ jobs: - name: Configure, build, test, verify run: .gitea/scripts/macos-build.sh + - name: Drop non-relocatable OBS build tree before caching + # cmake/common/buildspec_common.cmake's obs-studio sub-build writes + # an out-of-source CMakeCache.txt (.deps/obs-studio-*/build_*) that + # bakes in this job's absolute checkout path. The next run's + # checkout lands at a *different* absolute path, so restoring that + # directory from the cache above makes CMake refuse to reconfigure + # it ("CMakeCache.txt directory ... is different than the directory + # ... where CMakeCache.txt was created"). Everything that actually + # needs to survive between runs -- the extracted source, and the + # already-installed libobs package under .deps/cmake, .deps/include, + # .deps/lib -- has no such path baked in and is unaffected. Delete + # only the intermediate build tree, after it has already done its + # job (libobs is built and installed by this point), so the cache + # saved at the end of this job contains nothing that requires the + # path it was created under. + if: always() + continue-on-error: true + run: rm -rf .deps/obs-studio-*/build_* + - name: Upload plugin continue-on-error: true uses: actions/upload-artifact@v3 @@ -123,6 +142,22 @@ jobs: shell: powershell run: ./.gitea/scripts/windows-build.ps1 + - name: Drop non-relocatable OBS build tree before caching + # See the matching step in the macOS job above. Confirmed live on + # this runner: caching .deps/obs-studio-30.0.2/build_x86 as-is made + # every run's first configure attempt fail with a path mismatch + # against the job that populated the cache, falling back to + # -DSTPLUGIN_BOOTSTRAP_OBS=OFF and only succeeding because the + # already-installed libobs package (path-independent) was still + # found. That fallback masked the problem behind a misleading + # "::warning::OBS SDK bootstrap failed" every run instead of fixing + # it. Deleting the build tree here, after libobs is already built + # and installed, is the actual fix. + if: always() + continue-on-error: true + shell: powershell + run: Remove-Item -Recurse -Force .deps\obs-studio-*\build_* -ErrorAction SilentlyContinue + - name: Upload plugin continue-on-error: true uses: actions/upload-artifact@v3