Skip to content

feat(core): add Go and C/C++ compiler cache presets - #248

Merged
coldhighsun merged 2 commits into
mainfrom
feat/go-and-cpp-cache-presets
Oct 9, 2026
Merged

coldhighsun merged 2 commits into
mainfrom
feat/go-and-cpp-cache-presets

Conversation

@coldhighsun

Copy link
Copy Markdown
Owner

Summary

  • Add two built-in Temp & Caches presets:
    • Go: GOCACHE -> go-build, GOMODCACHE -> go-mod (2 GiB suggested)
    • C/C++ compiler caches: CCACHE_DIR -> ccache, SCCACHE_DIR -> sccache (2 GiB suggested)
  • Add English and Simplified Chinese names and descriptions, and update the preset lists in the README.
  • Both presets redirect environment variables, so like the existing ones they can live on one disk only, and the previous values are restored on unmount, exit, crash recovery or when the preset is unticked.

Presets are pure data: every consumer (create/edit dialog, context menu, CLI, restore groups, badge tracker, profile ids) iterates BuiltInPresets.All, so no logic changes were needed. Existing presets are unchanged, so existing disks are still detected as before.

Deliberately not included

  • Rust (CARGO_TARGET_DIR): it is a build output directory shared by every workspace, not a cache, and the default size would be too small.
  • Gradle (GRADLE_USER_HOME): it also holds gradle.properties and init scripts, which would silently disappear while redirected.
  • Maven: there is no environment variable for the local repository.

Test plan

  • dotnet build (no warnings or errors)
  • dotnet test tests/ManagedDrive.Tests (1816 passed)
  • New tests: preset contents, composition (capacity, label, folders, variables), detection, active detection, release, and restore grouping
  • Manual check in the app: tick the new presets in Create Disk and in the disk context menu, in both languages

Go redirects GOCACHE and GOMODCACHE; the C/C++ preset redirects CCACHE_DIR and SCCACHE_DIR. Both are variable-redirecting presets, so they live on one disk only and are restored like the existing ones. README and both language files are updated.
Cover preset contents, composition, detection, active detection, release and restore grouping.
@codecov

codecov Bot commented Oct 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@coldhighsun
coldhighsun merged commit b0d4662 into main Oct 9, 2026
6 checks passed
@coldhighsun
coldhighsun deleted the feat/go-and-cpp-cache-presets branch October 9, 2026 13:26
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.

1 participant