Skip to content

fix: install header patterns use wrong csrc/ prefix and missing - #6051

Open
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:bugfix/cmakelists-install-header-patterns-use-wrong-csrc
Open

fix: install header patterns use wrong csrc/ prefix and missing#6051
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:bugfix/cmakelists-install-header-patterns-use-wrong-csrc

Conversation

@andrewwhitecdw

@andrewwhitecdw andrewwhitecdw commented Aug 11, 2026

Copy link
Copy Markdown

This PR addresses the following issue in CMakeLists.txt: install header patterns use wrong csrc/ prefix and missing headers.

Changes

  • CMakeLists.txt: make the install(DIRECTORY ... FILES_MATCHING ...) patterns relative to NVFUSER_SRCS_DIR, keep C++20/compare excluded, and install the required extensionless headers C++23/utility and struct.inl.

Details

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -563,7 +563,7 @@ endif()
 install(DIRECTORY "${NVFUSER_SRCS_DIR}/"
   DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/nvfuser"
   FILES_MATCHING
   PATTERN "*.h"
   PATTERN "C++20/compare" EXCLUDE
-  PATTERN "C++23/utility" EXCLUDE
-  PATTERN "struct.inl" EXCLUDE)
+  PATTERN "C++23/utility"
+  PATTERN "struct.inl")

csrc/base.h includes <C++23/utility> and csrc/polymorphic_value.h includes <struct.inl>. Excluding those files from the installed header tree breaks downstream consumers that compile against the installed headers. C++20/compare is not currently used by any installed public header, so it remains excluded.

Testing

Ran a local Python sanity check that verifies the install block:

$ python3 /tmp/test_cmake_sanity_6051.py
CMake install header pattern sanity checks passed.

The check confirms the patterns are relative to NVFUSER_SRCS_DIR, C++20/compare is excluded, and C++23/utility and struct.inl are included (not excluded).

@greptile-apps

greptile-apps Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR corrects header-install patterns so paths are evaluated relative to the csrc source directory.

  • Installs the extensionless C++23/utility compatibility header.
  • Installs the transitive struct.inl header.
  • Marks the nonexistent C++20/compare path as excluded.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the corrected positive patterns install both transitive headers identified in the previous thread.

Important Files Changed

Filename Overview
CMakeLists.txt Corrects source-relative install patterns, ensuring the required extensionless transitive headers are included in the installation.

Reviews (2): Last reviewed commit: "fix: install header patterns use wrong c..." | Re-trigger Greptile

Comment thread CMakeLists.txt Outdated
Comment on lines +569 to +570
PATTERN "C++23/utility" EXCLUDE
PATTERN "struct.inl" EXCLUDE)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Required transitive headers excluded

When downstream consumers compile the installed base.h or polymorphic_value.h, these rules exclude the extensionless C++23/utility and struct.inl headers that they unconditionally include, causing compilation to fail with missing-header errors.

Suggested change
PATTERN "C++23/utility" EXCLUDE
PATTERN "struct.inl" EXCLUDE)
PATTERN "C++23/utility"
PATTERN "struct.inl")

Signed-off-by: andrewwhitecdw <andrewwhitecdw@users.noreply.github.com>
@andrewwhitecdw
andrewwhitecdw force-pushed the bugfix/cmakelists-install-header-patterns-use-wrong-csrc branch from b1c2abf to e8143f5 Compare August 17, 2026 22:23
@andrewwhitecdw

Copy link
Copy Markdown
Author

@greptile-apps thanks for catching that. I removed the EXCLUDE modifier from C++23/utility and struct.inl so the installed header tree includes the transitive headers required by base.h and polymorphic_value.h. C++20/compare remains excluded because no installed public header currently pulls it in. The updated commit is e8143f52b.

@greptile-apps

greptile-apps Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

That distinction makes sense. Looking at the current diff state:

PATTERN "C++20/compare" EXCLUDE
PATTERN "C++23/utility"
PATTERN "struct.inl")

The logic is correct — FILES_MATCHING treats patterns without EXCLUDE as additional inclusion filters, so C++23/utility and struct.inl will be installed alongside *.h files, while C++20/compare is explicitly excluded.

One observation worth considering: the sanity test in test_cmake_sanity.py only guards against the old bad patterns reappearing, but doesn't assert the positive side — that C++23/utility and struct.inl are present without EXCLUDE. If someone later incorrectly adds EXCLUDE to those lines (or drops them entirely), the test won't catch it. You might want to add assertions like:

# Transitive headers required by installed public headers must be present
# without EXCLUDE.
for required in (
    'PATTERN "C++23/utility"',
    'PATTERN "struct.inl"',
):
    self.assertIn(required, block)
    # Ensure the line is not followed by EXCLUDE
    self.assertNotIn(required + " EXCLUDE", block)

Otherwise the fix looks good.

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