Skip to content

Spoorcc/issue820 (Fix caching during build)#860

Merged
spoorcc merged 1 commit intomainfrom
spoorcc/issue820
Nov 23, 2025
Merged

Spoorcc/issue820 (Fix caching during build)#860
spoorcc merged 1 commit intomainfrom
spoorcc/issue820

Conversation

@spoorcc
Copy link
Copy Markdown
Contributor

@spoorcc spoorcc commented Nov 23, 2025

Investigation of #820

Summary by CodeRabbit

  • Chores
    • Platform-specific build caching: ccache enabled for non-Windows runners and clcache introduced for Windows.
    • Added a dedicated cache step for Windows to persist clcache.
    • Switched cache locations to workspace-based directories and updated related environment variables for cross-platform consistency.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 23, 2025

Walkthrough

The build workflow is updated to implement platform-specific caching strategies. Ccache operations now exclude Windows runners, while a new clcache caching step is added for Windows. Environment variables are adjusted to use workspace-based cache directories instead of home-based paths across both platforms.

Changes

Cohort / File(s) Summary
CI/CD Workflow Caching
\.github/workflows/build\.yml
Platform-specific cache configuration: ccache now runs conditionally on non-Windows platforms (if: runner.os != 'Windows') with create-symlink always enabled; a new clcache caching step (using actions/cache) is added for Windows runners; environment variables updated to point to workspace cache directories (NUITKA_CACHE_DIR_CCACHE -> ${{ github.workspace }}/.ccache, NUITKA_CACHE_DIR_CLCACHE -> ${{ github.workspace }}/.clcache).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Dev as Developer (push)
  participant GH as GitHub Actions
  participant Runner as Runner (linux/mac/windows)
  rect rgba(135,206,235,0.12)
    note over GH,Runner: Build workflow starts
  end
  Dev->>GH: push
  GH->>Runner: select runner (os)
  alt Non-Windows runner
    Runner->>Runner: Setup ccache\n(actions/cache restore)
    Runner->>Runner: Export NUITKA_CACHE_DIR_CCACHE -> workspace/.ccache
    Runner->>Runner: Run build with ccache
  else Windows runner
    Runner->>Runner: Setup clcache\n(actions/cache restore .clcache)
    Runner->>Runner: Export NUITKA_CACHE_DIR_CLCACHE -> workspace/.clcache
    Runner->>Runner: Skip ccache step
    Runner->>Runner: Run build with clcache
  end
  Runner->>GH: upload artifacts/logs
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify the if condition correctly targets Windows vs non-Windows runners.
  • Confirm cache keys/paths and restore/save steps for both ccache and clcache.
  • Ensure environment variables are set and exported consistently for downstream steps.

Poem

🐰 I hopped through workflows, neat and spry,
Ccache for Unix, clcache for sky-high Windows sky,
Workspace burrows hold each cached seed,
Builds bounce quicker — that's my deed! 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'Spoorcc/issue820 (Fix caching during build)' is partially related to the changeset. It mentions the branch name and references fixing caching, which aligns with the main changes (adding platform-specific caching for ccache and clcache), but uses a branch identifier in the title rather than clearly summarizing the primary change in non-technical terms.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch spoorcc/issue820

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@spoorcc spoorcc changed the title Spoorcc/issue820 Spoorcc/issue820 (Fix caching during build) Nov 23, 2025
@spoorcc spoorcc linked an issue Nov 23, 2025 that may be closed by this pull request
@spoorcc spoorcc marked this pull request as ready for review November 23, 2025 20:13
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/build.yml (1)

54-58: Inconsistent path separators across platform-specific cache env vars.

Lines 56 and 57 use different path separators: line 56 uses forward slash (ccache for Unix), while line 57 uses backslash (clcache for Windows). While each may work in their respective contexts, standardizing to forward slashes is more portable and consistent, as forward slashes work across platforms in most modern tools and GitHub Actions contexts.

          CCACHE_BASEDIR: ${{ github.workspace }}
          CCACHE_NOHASHDIR: true
          NUITKA_CACHE_DIR_CCACHE: ${{ github.workspace }}/.ccache
-         NUITKA_CACHE_DIR_CLCACHE: ${{ github.workspace }}\.clcache
+         NUITKA_CACHE_DIR_CLCACHE: ${{ github.workspace }}/.clcache

Also update line 49 for consistency:

        with:
-         path: ${{ github.workspace }}\.clcache
+         path: ${{ github.workspace }}/.clcache
          key: ${{ github.job }}-${{ matrix.platform }}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 94c7df0 and 3922588.

📒 Files selected for processing (1)
  • .github/workflows/build.yml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.8)
.github/workflows/build.yml

47-47: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: test (ubuntu-latest, 3.10)
  • GitHub Check: test (windows-latest, 3.13)
  • GitHub Check: test (windows-latest, 3.11)
  • GitHub Check: test (windows-latest, 3.9)
  • GitHub Check: test (macos-latest, 3.12)
  • GitHub Check: test (macos-latest, 3.9)
  • GitHub Check: test (macos-latest, 3.11)
  • GitHub Check: build (macos-latest)
  • GitHub Check: build (windows-latest)
  • GitHub Check: test-cygwin
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: DevContainer Build & Test
🔇 Additional comments (1)
.github/workflows/build.yml (1)

37-43: LGTM — ccache step correctly gated to non-Windows platforms.

The platform-specific condition makes sense, and create-symlink: true is appropriate here since the step is already Windows-excluded.

Comment thread .github/workflows/build.yml
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/build.yml (1)

56-57: Standardize path separators for consistency.

Line 56 uses forward slashes (/.ccache) while line 57 uses backslashes (\.clcache). Although both will functionally work (modern tools support forward slashes even on Windows), using forward slashes consistently across all paths improves portability and clarity.

          NUITKA_CACHE_DIR_CCACHE: ${{ github.workspace }}/.ccache
-         NUITKA_CACHE_DIR_CLCACHE: ${{ github.workspace }}\.clcache
+         NUITKA_CACHE_DIR_CLCACHE: ${{ github.workspace }}/.clcache
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3922588 and 05f81ed.

📒 Files selected for processing (1)
  • .github/workflows/build.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (18)
  • GitHub Check: Publish Python distribution 📦 to TestPyPI
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: test (windows-latest, 3.14)
  • GitHub Check: test (windows-latest, 3.13)
  • GitHub Check: test (macos-latest, 3.13)
  • GitHub Check: test (windows-latest, 3.11)
  • GitHub Check: test (windows-latest, 3.9)
  • GitHub Check: test (windows-latest, 3.12)
  • GitHub Check: test (macos-latest, 3.9)
  • GitHub Check: test (macos-latest, 3.12)
  • GitHub Check: test (windows-latest, 3.10)
  • GitHub Check: test-cygwin
  • GitHub Check: test (macos-latest, 3.10)
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: build (windows-latest)
  • GitHub Check: build (macos-latest)
  • GitHub Check: test
  • GitHub Check: DevContainer Build & Test
🔇 Additional comments (2)
.github/workflows/build.yml (2)

37-50: Previous review feedback has been addressed: actions/cache updated to v4.3.0.

The outdated actions/cache@v3 has been replaced with actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0, which is the latest stable version. The conditional gating for ccache (non-Windows) and new clcache setup (Windows-only) is logically sound.


53-61: No issues found—configuration is correct.

The environment variables NUITKA_CACHE_DIR_CCACHE and NUITKA_CACHE_DIR_CLCACHE are the correct Nuitka configuration variable names, and this configuration pattern is recommended for CI environments where home directories aren't persistent. The workspace-relative paths are properly expanded by GitHub Actions at runtime, and setting both variables simultaneously is standard practice in CI contexts—each variable is used by Nuitka depending on the compiler toolchain in use (ccache for gcc/Linux or clcache for MSVC/Windows).

@spoorcc spoorcc merged commit e089a4f into main Nov 23, 2025
39 checks passed
@spoorcc spoorcc deleted the spoorcc/issue820 branch November 23, 2025 20:30
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.

Speed up build by fixing ccache integration in build.yml

1 participant