ci: strip the non-relocatable OBS build tree before caching .deps
Build / macOS (macos-latest) (push) Successful in 33s
Build / Linux (ubuntu-24.04) (push) Successful in 56s
Release / macOS (macos-latest) (push) Successful in 32s
Release / Linux (ubuntu-24.04) (push) Successful in 52s
Build / Windows (windows-latest) (push) Successful in 10m35s
Release / Windows (windows-latest) (push) Successful in 11m7s
Release / Create Gitea Release (draft) (push) Successful in 20s

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RL8abRmgFXkVASHkkqiJbE
This commit is contained in:
2026-09-07 06:10:55 -07:00
co-authored by Claude Sonnet 5
parent 1f342b1971
commit d287a90048
+35
View File
@@ -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