Skip to content

[v6.0.x] docs: warn agents about misuse of OMPI_HIDDEN - #14320

Merged
hppritcha merged 1 commit into
v6.0.xfrom
backport/pr-14318-to-v6.0.x
Aug 17, 2026
Merged

[v6.0.x] docs: warn agents about misuse of OMPI_HIDDEN#14320
hppritcha merged 1 commit into
v6.0.xfrom
backport/pr-14318-to-v6.0.x

Conversation

@ompi-backport-bot

Copy link
Copy Markdown

Backport of #14318 to v6.0.x.


Add guidance explaining when it is (and is not) safe to annotate a symbol with OMPI_HIDDEN, so that contributors -- and AI coding agents in particular -- do not reintroduce the class of build breakage that need to be fixed in the initial version of code present in PR #14317.

As of Open MPI v6.0 the MPI interface is split across libmpi (Open MPI ABI) and libmpi_abi (standard MPI ABI), both of which link against the internal libopen_mpi. Many ompi_* symbols are defined in libopen_mpi but used from the bindings compiled into libmpi and libmpi_abi (for example, predefined handle objects like ompi_mpi_comm_parent and helpers like ompi_comm_split_type_hw_guided_support). Marking such a symbol OMPI_HIDDEN prevents it from being exported from libopen_mpi, so the links of both libmpi and libmpi_abi fail with unresolved symbols.

Two files are updated:

  • AGENTS.md: add a "Golden rules" bullet describing the hazard and the rule of thumb -- if a symbol crosses a library boundary, use OMPI_DECLSPEC (or leave it un-annotated), never OMPI_HIDDEN. Only hide symbols that are certainly private to a single DSO.

  • docs/developers/source-code.rst: add a "Hiding symbols with OMPI_HIDDEN" subsection under Symbol Visibility that documents the v6.0 library structure and includes a warning admonition covering the unresolved-symbol failure mode and the same rule of thumb.

These are documentation-only changes. CLAUDE.md is a symlink to AGENTS.md and is covered automatically.

Add guidance explaining when it is (and is not) safe to annotate a
symbol with OMPI_HIDDEN, so that contributors -- and AI coding agents in
particular -- do not reintroduce the class of build breakage that need to be
fixed in the initial version of code present in PR #14317.

As of Open MPI v6.0 the MPI interface is split across libmpi (Open MPI
ABI) and libmpi_abi (standard MPI ABI), both of which link against the
internal libopen_mpi.  Many ompi_* symbols are defined in libopen_mpi but
used from the bindings compiled into libmpi and libmpi_abi (for example,
predefined handle objects like ompi_mpi_comm_parent and helpers like
ompi_comm_split_type_hw_guided_support).  Marking such a symbol
OMPI_HIDDEN prevents it from being exported from libopen_mpi, so the
links of both libmpi and libmpi_abi fail with unresolved symbols.

Two files are updated:

- AGENTS.md: add a "Golden rules" bullet describing the hazard and the
  rule of thumb -- if a symbol crosses a library boundary, use
  OMPI_DECLSPEC (or leave it un-annotated), never OMPI_HIDDEN.  Only hide
  symbols that are certainly private to a single DSO.

- docs/developers/source-code.rst: add a "Hiding symbols with
  OMPI_HIDDEN" subsection under Symbol Visibility that documents the
  v6.0 library structure and includes a warning admonition covering the
  unresolved-symbol failure mode and the same rule of thumb.

These are documentation-only changes.  CLAUDE.md is a symlink to
AGENTS.md and is covered automatically.

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
(cherry picked from commit d330d8e)
@ompi-backport-bot ompi-backport-bot Bot added the target:v6.0.x Backport targeting the v6.0.x branch label Aug 13, 2026
@github-actions github-actions Bot added this to the v6.0.0 milestone Aug 13, 2026
@hppritcha
hppritcha requested a review from jsquyres August 17, 2026 17:50
@hppritcha
hppritcha merged commit f3ba530 into v6.0.x Aug 17, 2026
19 checks passed
@hppritcha
hppritcha deleted the backport/pr-14318-to-v6.0.x branch August 17, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Target: v6.0.x target:v6.0.x Backport targeting the v6.0.x branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant