Skip to content

v5: Record build OS in etc/OS.rc - #612

Merged
mathomp4 merged 1 commit into
developfrom
feature/v5-os-detection
Nov 10, 2026
Merged

mathomp4 merged 1 commit into
developfrom
feature/v5-os-detection

Conversation

@mathomp4

Copy link
Copy Markdown
Member

Summary

  • Add external_libraries/DetermineOS.cmake and OS.rc.in. At configure time they record the OS ID, version and pretty name and install them as etc/OS.rc, next to SITE.rc. The existing SITE.rc format is unchanged.
  • DetermineOS is included from esma.cmake after DetermineSite.
  • Prepare the v5.26.0 changelog section for 2026-11-10. No release tag is created by this PR.

Motivation

At NAS there are two environments, TOSS4 (RHEL 8) and TOSS5 (RHEL 9). A TOSS5 build must be submitted from TOSS5, and a TOSS4 build must not run on Turin. The OS running experiment setup is not necessarily the OS the model was built on, so GEOSgcm_App needs a record of the build OS. See GEOS-ESM/GEOSgcm_App#946. The consumer is GEOS-ESM/GEOSgcm_App#945.

Example OS.rc:

OS_ID: rhel
OS_VERSION: 9.8
OS_NAME: Red Hat Enterprise Linux 9.8 (Plow)

Validation

  • A CMake probe using the same DISTRIB_ID, DISTRIB_VERSION_ID and DISTRIB_PRETTY_NAME queries gave rhel / 8.10 on TOSS4 and rhel / 9.8 on TOSS5. These queries need CMake 3.22 or newer.
  • A TOSS5 GEOSgcm install produced the OS.rc shown above. A TOSS4 build produced the same format with 8.10 and Red Hat Enterprise Linux 8.10 (Ootpa).
  • On macOS (not tested here), OS_NAME and OS_RELEASE are used instead, since the DISTRIB_* queries return empty values there.
  • Zero diff: only the new OS.rc file is added to the install; no compiled code or flags change.

Caveat

This records the configure host, not necessarily the host that runs the build. Check your build workflow before relying on that assumption.

A matching PR targets release/v4 (#611).

@mathomp4 mathomp4 added the 0 diff The changes in this pull request have verified to be zero-diff with the target branch. label Nov 10, 2026
@mathomp4
mathomp4 requested a review from a team as a code owner November 10, 2026 15:43
@mathomp4 mathomp4 added the 0 diff The changes in this pull request have verified to be zero-diff with the target branch. label Nov 10, 2026
@mathomp4
mathomp4 merged commit 4a32088 into develop Nov 10, 2026
25 checks passed
@mathomp4
mathomp4 deleted the feature/v5-os-detection branch November 10, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0 diff The changes in this pull request have verified to be zero-diff with the target branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant