Skip to content

Commit af7e4c8

Browse files
committed
ci(build): fix self-hosted Linux gtest-discovery + Web-static snap-chromium
Two self-hosted-environment gaps on the #439 switch (not code): - Linux x86_64 + ASan twin: reused workspace left a stale build_ci/ build_asan, so ctest re-included empty gtest_discover_tests POST_BUILD files -> Unknown CMake command gtest_discover_tests_impl, exit 8. Add a self-hosted-only clean of each Linux build dir before configure (ccache keeps recompiles fast). Applied to all five Linux C++ lanes. - Web-static verify: VM905 only ships snap chromium, which will not launch under the runner systemd cgroup (not a snap cgroup). Provision a real Chrome-for-Testing via @puppeteer/browsers on self-hosted; keep apt path for github-hosted. Harness already passes --no-sandbox.
1 parent 6dd2537 commit af7e4c8

1 file changed

Lines changed: 66 additions & 12 deletions

File tree

.github/workflows/build.yml

Lines changed: 66 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ jobs:
5454
path: ~/.conan2
5555
key: conan2-ubuntu24-gcc13-${{ hashFiles('conanfile.txt') }}
5656

57+
# Self-hosted runners reuse the workspace across runs; a stale build_ci/
58+
# leaves gtest_discover_tests POST_BUILD artifacts that ctest then
59+
# includes as empty/placeholder files ("Unknown CMake command
60+
# gtest_discover_tests_impl", ctest exit 8). Wipe it for a clean
61+
# configure+discovery. ccache (in ~/.cache/ccache) keeps recompiles fast.
62+
- name: Clean stale build dir (self-hosted workspace is reused)
63+
if: runner.environment != 'github-hosted'
64+
run: rm -rf build_ci
65+
5766
- name: Conan install
5867
run: conan install . --build=missing --output-folder=build_ci --settings=build_type=Release
5968

@@ -172,6 +181,15 @@ jobs:
172181
path: ~/.conan2
173182
key: conan2-ubuntu24-gcc13-${{ hashFiles('conanfile.txt') }}
174183

184+
# Self-hosted runners reuse the workspace across runs; a stale build_asan/
185+
# leaves gtest_discover_tests POST_BUILD artifacts that ctest then
186+
# includes as empty/placeholder files ("Unknown CMake command
187+
# gtest_discover_tests_impl", ctest exit 8). Wipe it for a clean
188+
# configure+discovery. ccache (in ~/.cache/ccache) keeps recompiles fast.
189+
- name: Clean stale build dir (self-hosted workspace is reused)
190+
if: runner.environment != 'github-hosted'
191+
run: rm -rf build_asan
192+
175193
- name: Conan install
176194
run: conan install . --build=missing --output-folder=build_asan --settings=build_type=Release
177195

@@ -280,6 +298,15 @@ jobs:
280298
path: ~/.conan2
281299
key: conan2-ubuntu24-gcc13-bch-${{ hashFiles('conanfile.txt') }}
282300

301+
# Self-hosted runners reuse the workspace across runs; a stale build_bch/
302+
# leaves gtest_discover_tests POST_BUILD artifacts that ctest then
303+
# includes as empty/placeholder files ("Unknown CMake command
304+
# gtest_discover_tests_impl", ctest exit 8). Wipe it for a clean
305+
# configure+discovery. ccache (in ~/.cache/ccache) keeps recompiles fast.
306+
- name: Clean stale build dir (self-hosted workspace is reused)
307+
if: runner.environment != 'github-hosted'
308+
run: rm -rf build_bch
309+
283310
- name: Conan install
284311
run: conan install . --build=missing --output-folder=build_bch --settings=build_type=Release
285312

@@ -351,6 +378,15 @@ jobs:
351378
path: ~/.conan2
352379
key: conan2-ubuntu24-gcc13-bch-${{ hashFiles('conanfile.txt') }}
353380

381+
# Self-hosted runners reuse the workspace across runs; a stale build_bch_asan/
382+
# leaves gtest_discover_tests POST_BUILD artifacts that ctest then
383+
# includes as empty/placeholder files ("Unknown CMake command
384+
# gtest_discover_tests_impl", ctest exit 8). Wipe it for a clean
385+
# configure+discovery. ccache (in ~/.cache/ccache) keeps recompiles fast.
386+
- name: Clean stale build dir (self-hosted workspace is reused)
387+
if: runner.environment != 'github-hosted'
388+
run: rm -rf build_bch_asan
389+
354390
- name: Conan install
355391
run: conan install . --build=missing --output-folder=build_bch_asan --settings=build_type=Release
356392

@@ -429,18 +465,27 @@ jobs:
429465

430466
- name: Install Chrome for pixel-regression harness
431467
run: |
432-
flock /tmp/c2pool-apt.lock bash -e -c '
433-
sudo apt-get update -qq
434-
sudo apt-get install -y --no-install-recommends google-chrome-stable || \
435-
sudo apt-get install -y --no-install-recommends chromium-browser
436-
'
437-
# Export the first one that exists so capture.mjs picks it up.
438-
for bin in /usr/bin/google-chrome-stable /usr/bin/google-chrome /usr/bin/chromium /usr/bin/chromium-browser; do
439-
if [ -x "$bin" ]; then
440-
echo "CHROME_BIN=$bin" >> "$GITHUB_ENV"
441-
break
442-
fi
443-
done
468+
# GitHub-hosted: apt google-chrome/chromium is a real .deb and launches.
469+
# Self-hosted VM905 only offers snap chromium, which refuses to launch
470+
# under the runner systemd cgroup ("not a snap cgroup for tag
471+
# snap.chromium.chromium"). Provision a real Chrome-for-Testing build
472+
# via @puppeteer/browsers (a puppeteer-core dep, present after npm ci);
473+
# it unpacks under ~/.cache/puppeteer with no snap confinement. The
474+
# harness already launches with --no-sandbox (tests/visual/capture.mjs).
475+
if [ "${{ runner.environment }}" = "github-hosted" ]; then
476+
flock /tmp/c2pool-apt.lock bash -e -c '
477+
sudo apt-get update -qq
478+
sudo apt-get install -y --no-install-recommends google-chrome-stable || \
479+
sudo apt-get install -y --no-install-recommends chromium-browser
480+
'
481+
for bin in /usr/bin/google-chrome-stable /usr/bin/google-chrome /usr/bin/chromium /usr/bin/chromium-browser; do
482+
if [ -x "$bin" ]; then echo "CHROME_BIN=$bin" >> "$GITHUB_ENV"; break; fi
483+
done
484+
else
485+
CHROME_BIN="$(npx --yes @puppeteer/browsers install chrome@stable | tail -1 | awk '{print $NF}')"
486+
test -x "$CHROME_BIN" || { echo "puppeteer chrome install failed"; exit 1; }
487+
echo "CHROME_BIN=$CHROME_BIN" >> "$GITHUB_ENV"
488+
fi
444489
445490
- name: Visual pixel-diff harness
446491
run: npm run visual
@@ -760,6 +805,15 @@ jobs:
760805
path: ~/.conan2
761806
key: conan2-ubuntu24-gcc13-dgb-auxdoge-${{ hashFiles('conanfile.txt') }}
762807

808+
# Self-hosted runners reuse the workspace across runs; a stale build_dgb_auxdoge/
809+
# leaves gtest_discover_tests POST_BUILD artifacts that ctest then
810+
# includes as empty/placeholder files ("Unknown CMake command
811+
# gtest_discover_tests_impl", ctest exit 8). Wipe it for a clean
812+
# configure+discovery. ccache (in ~/.cache/ccache) keeps recompiles fast.
813+
- name: Clean stale build dir (self-hosted workspace is reused)
814+
if: runner.environment != 'github-hosted'
815+
run: rm -rf build_dgb_auxdoge
816+
763817
- name: Conan install
764818
run: conan install . --build=missing --output-folder=build_dgb_auxdoge --settings=build_type=Release
765819

0 commit comments

Comments
 (0)