Part of #4950. Slice 3B of 5. Estimated 5 weeks. Depends on #4998.
Goal
Move build logic from build.py (1350 lines) into focused modules under
CIME/core/build/. Keep CIME/build_scripts/ as the stable external wrapper.
Tasks
Extract into CIME/core/build/
Move from utils.py
Consolidation — free functions taking case
Deduplicate copy functions
Sharedlibs (resolves #4837)
Imports & re-exports
Definition of done
Related
Part of #4950. Slice 3B of 5. Estimated 5 weeks. Depends on #4998.
Goal
Move build logic from
build.py(1350 lines) into focused modules underCIME/core/build/. KeepCIME/build_scripts/as the stable external wrapper.Tasks
Extract into
CIME/core/build/build.pybecomes a thin re-export layer.Move from
utils.pyanalyze_build_log,run_bld_cmd_ensure_logging,copy_local_macros_to_dir→core/build/.safe_copy,safe_recursive_copy,symlink_force,copy_globs,copy_over_file,copyifnewer→CIME/core/fileops.py(build is heavyconsumer, pulled here).
Consolidation — free functions taking
casecase_build(),clean(),_clean_impl(),post_build()(build.py)currently access
case._gitinterface(private!), callcase.get_value,case.set_value,case.flush(). Make themCasemethods that delegateto
core/build/.get_standard_cmake_args(),get_standard_makefile_args(),uses_kokkos()(build.py) extract ~15 values from Case.Consolidate as Case methods or a
BuildConfigdata class.generate_makefile_macro()(build.py) callscase.get_value()—same pattern.
Deduplicate copy functions
utils.py(safe_copy,copy_over_file,copyifnewer,copy_globs) → coherentCIME/core/fileops.pyAPI.Sharedlibs (resolves #4837)
Imports & re-exports
core/build/.build.pyandutils.py.CIME/build_scripts/unchanged — stable external interface.Definition of done
CIME/build_scripts/compatibility maintained.case._gitinterfaceetc.) from outside Case.Related
config_files.xml) #4998 (config loading must be stable first)Casegod object #5000 (Case build delegation comes from this slice)