From b776e14ae5bba2de5864f122c24685efd39e7161 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Tue, 5 Nov 2024 13:17:38 -0500 Subject: [PATCH 1/3] v4: Add output of mepo status --- CHANGELOG.md | 6 ++++ esma.cmake | 3 ++ esma_support/esma_mepo_status.cmake | 43 +++++++++++++++++++++++++++++ esma_support/esma_support.cmake | 1 + 4 files changed, 53 insertions(+) create mode 100644 esma_support/esma_mepo_status.cmake diff --git a/CHANGELOG.md b/CHANGELOG.md index ca315757..c779a6ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Deprecated +## [4.7.0] - 2024-11-05 + +### Added + +- Added new `esma_capture_mepo_status` function (in `esma_support/esma_mepo_status.cmake`) to capture the output of `mepo status --hashes` when `mepo` was used to clone the fixture. It will output this into a file `MEPO_STATUS.rc` which is installed to `${CMAKE_INSTALL_PREFIX}/etc` and can be used to help determine the exact state of the fixture at build time. + ## [4.6.0] - 2024-09-05 ### Added diff --git a/esma.cmake b/esma.cmake index 088e4371..96de049e 100644 --- a/esma.cmake +++ b/esma.cmake @@ -79,6 +79,9 @@ include(DetermineMPIStack) #list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/esma_support") include (esma_support) +#### Capture mepo status #### +esma_capture_mepo_status() + ### Python ### list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/python") diff --git a/esma_support/esma_mepo_status.cmake b/esma_support/esma_mepo_status.cmake new file mode 100644 index 00000000..2c8f2d24 --- /dev/null +++ b/esma_support/esma_mepo_status.cmake @@ -0,0 +1,43 @@ +function(esma_capture_mepo_status) + + # Step 1: Set the path to the .mepo directory + set(MEPO_DIR "${CMAKE_SOURCE_DIR}/.mepo") + set(OUTPUT_FILE_NAME "MEPO_STATUS.rc") + set(OUTPUT_FILE "${CMAKE_BINARY_DIR}/${OUTPUT_FILE_NAME}") + + if(EXISTS "${MEPO_DIR}") + message(DEBUG ".mepo directory found") + + # Step 2: Check for the `mepo` command + find_program(MEPO_COMMAND mepo) + + if(MEPO_COMMAND) + message(DEBUG "Found mepo command at ${MEPO_COMMAND}") + + # Step 3: Run `mepo status --hashes` and capture the output + execute_process( + COMMAND ${MEPO_COMMAND} status --hashes + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_FILE "${OUTPUT_FILE}" + RESULT_VARIABLE MEPO_STATUS_RESULT + ) + + if(NOT MEPO_STATUS_RESULT EQUAL 0) + message(WARNING "mepo state and command were found but failed to run mepo status --hashes. This is odd.") + else() + message(STATUS "mepo status output captured in ${OUTPUT_FILE_NAME}") + + # Step 4: Install the output file in the etc directory + install( + FILES "${OUTPUT_FILE}" + DESTINATION etc + ) + endif() + else() + message(DEBUG "mepo command not found, skipping mepo status") + endif() + else() + message(DEBUG ".mepo directory not found, skipping mepo status check") + endif() + +endfunction() diff --git a/esma_support/esma_support.cmake b/esma_support/esma_support.cmake index c874a55a..fb442fb3 100644 --- a/esma_support/esma_support.cmake +++ b/esma_support/esma_support.cmake @@ -9,6 +9,7 @@ include (esma_generate_automatic_code) include (esma_create_stub_component) include (esma_fortran_generator_list) include (esma_add_fortran_submodules) +include (esma_mepo_status) # Testing include (esma_enable_tests) From 71605654c6451b99c865a4d1f29e806e04aa1629 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Tue, 5 Nov 2024 13:42:44 -0500 Subject: [PATCH 2/3] Update CI --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6871981c..5ea62220 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,11 +1,11 @@ version: 2.1 # Anchors in case we need to override the defaults from the orb -#baselibs_version: &baselibs_version v8.0.2 -#bcs_version: &bcs_version v11.3.0 +#baselibs_version: &baselibs_version v8.7.0 +#bcs_version: &bcs_version v12.0.0 orbs: - ci: geos-esm/circleci-tools@3 + ci: geos-esm/circleci-tools@5 workflows: build-test: From c9ea03a4e083838498d2dac372db4aef3b74e734 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Tue, 5 Nov 2024 14:07:09 -0500 Subject: [PATCH 3/3] Fix CI for v12 --- .circleci/config.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5ea62220..821d5410 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,7 +21,10 @@ workflows: #baselibs_version: *baselibs_version repo: GEOSgcm checkout_fixture: true - mepodevelop: true + # V12 code uses a special branch for now. + fixture_branch: feature/sdrabenh/gcm_v12 + # We comment out this as it will "undo" the fixture_branch + #mepodevelop: true persist_workspace: true # Needs to be true to run fv3/gcm experiment, costs extra # Run AMIP GCM (1 hour, no ExtData)