Ray's Knowledge Base
Unlock

Put internal headers under each module's src directory

DecisionVerified 5 Oct 2026Holds anywhere
Decision. The context, the choice, why, and the options that were turned down.

Context#

Choosing header tiers and paths for dftracer-utils.

Decision#

Keep public headers in include/dftracer/utils/<module>/. Put internal headers in src/dftracer/utils/<module>/internal/. Keep private headers anywhere else under that module's src/. Preserve include spelling as <dftracer/utils/...>. Internal symbols get the module export macro because another shared library calls them; private symbols stay hidden. Another module may include only public headers and lower modules' src/.../internal/ headers.

Why#

src/ is not installed, so the install rule stays install("include/"). A subdirectory shows the internal tier without adding a separate top-level directory. The current mixed src/.../internal/ directories, such as dataframe/internal/ and index/store/internal/, must be sorted first so only cross-module headers remain internal.

Rejected options#

A separate top-level internal/ root.

Evidence#

This layout was selected for dftracer-utils. The earlier three-root proposal was replaced by putting internal headers under each module's src/ tree.

Also found by searching

  • where should internal shared headers live in a C++ module tree
  • how do I separate public internal and private headers without changing includes
  • should internal headers go in a separate root directory
  • how should shared symbols be exported but not installed