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

Copy link
Copy Markdown

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

Changes

  • CMakeLists.txt: install header patterns use wrong csrc/ prefix and missing.

Details

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
-install(DIRECTORY "${NVFUSER_SRCS_DIR}/"
-  DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/nvfuser"
-  FILES_MATCHING
-  PATTERN "*.h"
-  PATTERN "csrc/C++20/compare"
-  PATTERN "csrc/C++23/utility"
-  PATTERN "csrc/struct.inl")
+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)

Tests

  • tests/python/test_cmake_sanity.py
--- /dev/null
+++ b/tests/python/test_cmake_sanity.py
@@ -0,0 +1,52 @@
+# SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
+# All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Sanity checks for CMakeLists.txt to catch common mistakes."""
+
+import pathlib
+import re
+import unittest
+
+
+ROOT = pathlib.Path(__file__).resolve().parents[2]
+CMAKE = ROOT / "CMakeLists.txt"
+
+
+class TestCMakeSanity(unittest.TestCase):
+    def test_install_header_patterns_are_relative(self):
+        content = CMAKE.read_text()
+        install_match = re.search(
+            r'install\(DIRECTORY "\$\{NVFUSER_SRCS_DIR\}/"\s+.*?PATTERN "\*\.h".*?\)',
+            content,
+            re.DOTALL,
+        )
+        self.assertIsNotNone(install_match)
+        block = install_match.group(0)
+        # NVFUSER_SRCS_DIR is already the csrc/ directory, so install patterns
+        # must not repeat the csrc/ prefix. These patterns also lack EXCLUDE,
+        # which is required if they are meant to skip the listed paths.
+        for bad in (
+            'PATTERN "csrc/C++20/compare"',
+            'PATTERN "csrc/C++23/utility"',
+            'PATTERN "csrc/struct.inl"',
+        ):
+            self.assertNotIn(
+                bad,
+                block,
+                f"Install pattern repeats the source directory prefix: {bad}",
+            )
+
+
+if __name__ == "__main__":
+    unittest.main()

Signed-off-by: andrewwhitecdw <andrewwhitecdw@users.noreply.github.com>
@greptile-apps

greptile-apps Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR corrects path prefixes in the CMake header-install patterns and adds exclusion modifiers. However, excluding two extensionless files leaves installed public headers without required transitive dependencies.

  • Makes install patterns relative to NVFUSER_SRCS_DIR.
  • Adds EXCLUDE to the C++20/compare, C++23/utility, and struct.inl patterns.

Confidence Score: 4/5

This PR should not merge until the required extensionless headers are included in the installed header tree.

Installed public headers unconditionally include C++23/utility and struct.inl, but the changed FILES_MATCHING rules explicitly exclude both files, causing downstream compilation failures.

Files Needing Attention: CMakeLists.txt

Important Files Changed

Filename Overview
CMakeLists.txt The relative paths are corrected, but excluding C++23/utility and struct.inl preserves the missing-header failure this change intends to fix.

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

Comment thread CMakeLists.txt
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")

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