Skip to content

Conversation

mcaubet
Copy link

@mcaubet mcaubet commented Apr 8, 2025

Description

This MR updates the build and runtime handling of the csr_defs.json file used by utils/cxi_dump_csrs.py. It replaces hardcoded paths with a configuration-time option (--with-cassini-csr_defs) and an environment variable (CASSINI_CSR_DEFS) to locate the file at runtime.

The previous fallback (../cassini-headers/install/share/cassini-headers/csr_defs.json) has been removed, as it was non-functional in most environments. This fallback is now replaced with a clear runtime error and guidance to set the appropriate path via --with-cassini-csr_defs or CASSINI_CSR_DEFS when needed.

This makes the build process more portable, removes the need for manual patching, and improves integration with systems like Spack or site-specific builds.

This PR fixes an existing defect related to hardcoded, non-relocatable file paths.

Design Documents

Related JIRAs

  • No JIRA related.

Risk

LOW
This change only affects how utils/cxi_dump_csrs.py locates the csr_defs.json file. The script now uses the --with-cassini-csr_defs option (set at configure time) to determine the file path. If neither is provided, the script defaults to /usr/share/cassini-headers/csr_defs.json.

Tests

Locally tested with:

  • Default build (no --with-cassini-csr_defs) to verify fallback still works.
  • Custom path passed via --with-cassini-csr_defs to verify value is used.
  • Verified correct generation of utils/cxi_dump_csrs.h.

@mcaubet mcaubet changed the title Add --with-cassini_csr_defs option Add --with-cassini-csr_defs option Apr 8, 2025
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