Skip to content

perf(webkitgtk): compile through the pinned sccache client - #247

Closed
hanthor wants to merge 1 commit into
mainfrom
perf/webkitgtk-sccache
Closed

hanthor wants to merge 1 commit into
mainfrom
perf/webkitgtk-sccache

Conversation

@hanthor

@hanthor hanthor commented Sep 25, 2026

Copy link
Copy Markdown
Member

Fallback, held as a draft. I'll merge it only if webkitgtk hits the 6h job limit in run 36073571248. Merging it while that run can still publish would force yet another cold webkitgtk rebuild next run, because touching a recipe schedules its rebuild.

webkitgtk takes between 3h05 and 5h00 of the 6h GitHub-hosted job limit (runs 35815959556, 35824179148, 35829110579, 35966980787). It builds two full flavors, gtk4 and gtk3. There is no %check, and %limit_build -m 3072 already caps parallelism, so the time is compile time, not tests or swap. A job killed at the limit fails the whole atomic run.

This reuses the pinned sccache client that mozjs140 already uses:

  • setup-sccache now also runs for webkitgtk.
  • Both cmake configurations get CMAKE_{C,CXX}_COMPILER_LAUNCHER=/work/tools/sccache when the client is mounted. Outside CI the recipe builds unchanged.
  • The Actions-cache backend stores each object as soon as it compiles. So even an attempt cut off at the limit leaves the next attempt mostly cache hits.

Stats are printed after the build.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QMTLsnqW2jtz5QsNC3W3qv

webkitgtk takes 3h05 to 5h00 of the 6h GitHub-hosted job limit (runs
35815959556..35966980787), and a job killed at the limit fails the whole
atomic run. Run 36073571248 had it at 4h20 and still compiling.

Reuse the sccache setup mozjs140 already has: set it up for webkitgtk too and
pass it to both cmake configurations as the C/C++ compiler launcher. The
Actions-cache backend stores each object as it compiles, so an attempt cut
off at the limit still leaves the next attempt mostly cache hits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QMTLsnqW2jtz5QsNC3W3qv
@hanthor

hanthor commented Sep 25, 2026

Copy link
Copy Markdown
Member Author

Holding as planned. If this is needed: it widens the ACTIONS_RUNTIME_TOKEN exposure that #227 narrowed, since webkitgtk's build could read /work/tools/sccache.env. That's acceptable for a trusted upstream and matches mozjs140, but please record it in repeated-mistakes §18. Also check the Actions cache size after the first run. Two flavors of webkitgtk objects built with -g could evict the per-package RPM cache.

@castrojo castrojo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standards: Conformant. Appropriately adds webkitgtk to sccache setup step in .github/workflows/build-stage.yml and configures optional CMAKE_C_COMPILER_LAUNCHER/CMAKE_CXX_COMPILER_LAUNCHER in packages/webkitgtk/webkitgtk.spec with clean xtrace preservation and fallback when sccache is absent.

Spec: Meets objective of enabling sccache for webkitgtk builds to prevent timeouts on long multi-hour builds. Factory configuration and unit tests pass.

Reviewer status: Needs a second independent review (+2 requirement) before merging.

@castrojo

Copy link
Copy Markdown
Contributor

Verification:

  • Standards / Architecture: Commit cbfa446 made the hermetic mock lane the default backend (backend: hermetic) across build-stage.yml and rebuild-rpms.yml. As documented in docs/architecture.md (Compiler cache entry: "Hermetic mock is network-isolated. sccache would degrade to a total miss and look like 'builds got slower' rather than failing") and .github/actions/setup-sccache/action.yml, sccache relies on network access to the GitHub Actions runtime token and cache service. In the default hermetic mock lane, the build runs inside a network namespace with only loopback up (unshare --net), so sccache cannot access GitHub Actions cache APIs unless webkitgtk is declared with "build_lane": "container" and "build_lane_reason" in config/upstream-sources.json.
  • Current diff: Extends sccache invocation to webkitgtk in build-stage.yml and wraps cmake invocations in packages/webkitgtk/webkitgtk.spec.
  • Recommendation: Either declare webkitgtk as a container-lane exception in config/upstream-sources.json to utilize sccache, or implement Mock ccache integration as outlined in the architecture documentation.

Outstanding approvals: 0 approvals currently recorded. Requires +2 independent approving reviews before merging.

@castrojo castrojo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at cd47064. Following PR #264, the hermetic mock lane is now default for all package builds. Hermetic mock builds are network-isolated via unshare --net (tools/hermetic_build.sh:153), making GHA sccache unreachable and causing sccache to miss on every compile (docs/architecture.md:346). Furthermore, mounting sccache.env into /work exposes ACTIONS_RUNTIME_TOKEN to untrusted build scripts (per docs/skills/repeated-mistakes.md rule on sccache token scoping). Re-enabling sccache effectively would require moving webkitgtk to the container lane (build_lane: container in config/upstream-sources.json), which requires maintainer architectural consensus.

@castrojo

Copy link
Copy Markdown
Contributor

Closing this held fallback. Its condition for merging was webkitgtk hitting the 6h job limit in run 36073571248; that run built webkitgtk successfully in 4h55m (rebuild5 / build (webkitgtk), 01:42 -> 06:37 UTC on 09-25), under the limit. Since then #264 made the hermetic mock lane the default, and that lane is network-isolated (tools/hermetic_build.sh, unshare --net), so the Actions-cache sccache backend would miss on every compile (docs/architecture.md, Compiler cache row). The change would add the ACTIONS_RUNTIME_TOKEN exposure without the speedup. If webkitgtk approaches the limit again, the fix belongs in the hermetic lane (mock's ccache plugin + actions/cache, per the agreed direction).

@castrojo castrojo closed this Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants