Skip to content

feat(build): add --clean-cache option to case.build#4978

Draft
mahf708 wants to merge 1 commit intoESMCI:masterfrom
mahf708:claude/add-cache-clean-option-poTqB
Draft

feat(build): add --clean-cache option to case.build#4978
mahf708 wants to merge 1 commit intoESMCI:masterfrom
mahf708:claude/add-cache-clean-option-poTqB

Conversation

@mahf708
Copy link
Copy Markdown
Contributor

@mahf708 mahf708 commented May 7, 2026

Reset only the CMake cache (CMakeCache.txt and the small bookkeeping files in CMakeFiles/) without touching compiled object files. This is useful when CMake needs to re-configure (e.g. after editing macros or toolchain settings) but a full --clean-all is too expensive.

Adds:

  • --clean-cache flag in CIME/Tools/case.build (mutually exclusive with the existing --clean-* options)
  • build._clean_cache_impl and a clean_cache=True path through build.clean, logged under a distinct "build.clean_cache" phase
  • pytest unit tests covering the happy path, no-op when no cmake-bld dir exists, missing CMakeCache.txt, and dispatch routing in build.clean

Description

  • Closes #<ISSUE_NUMBER_HERE>

Checklist

  • My code follows the style guidelines of this project (black formatting)
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that exercise my feature/fix and existing tests continue to pass
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding additions and changes to the documentation

@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 28.41%. Comparing base (c19d517) to head (743e8f7).
⚠️ Report is 53 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4978      +/-   ##
==========================================
+ Coverage   28.29%   28.41%   +0.11%     
==========================================
  Files         262      262              
  Lines       38390    38446      +56     
  Branches     8126     8138      +12     
==========================================
+ Hits        10863    10924      +61     
+ Misses      26279    26261      -18     
- Partials     1248     1261      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Reset only the CMake cache (CMakeCache.txt and the small bookkeeping
files in CMakeFiles/) without touching compiled object files. This is
useful when CMake needs to re-configure (e.g. after editing macros or
toolchain settings) but a full --clean-all is too expensive.

Adds:
- --clean-cache flag in CIME/Tools/case.build (mutually exclusive with
  the existing --clean-* options)
- build._clean_cache_impl and a clean_cache=True path through
  build.clean, logged under a distinct "build.clean_cache" phase
- pytest unit tests covering the happy path, no-op when no cmake-bld
  dir exists, missing CMakeCache.txt, and dispatch routing in
  build.clean
@mahf708 mahf708 force-pushed the claude/add-cache-clean-option-poTqB branch from 96da360 to 743e8f7 Compare May 7, 2026 03:56
@rljacob rljacob requested a review from jgfouca May 7, 2026 05:07
@rljacob rljacob requested a review from jedwards4b May 7, 2026 05:07
@jgfouca jgfouca requested review from jasonb5 and removed request for jedwards4b May 7, 2026 15:49
@jgfouca jgfouca added the Responsibility: E3SM Responsibility to manage and accomplish this issue is through E3SM label May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Responsibility: E3SM Responsibility to manage and accomplish this issue is through E3SM tp: CIMElib

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants