From 039a7b936dc40bec2076d84d294a2c3b0e0080d8 Mon Sep 17 00:00:00 2001 From: Matthew Woehlke Date: Tue, 9 Dec 2025 15:13:48 -0500 Subject: [PATCH] CPS: Be less optimistic about what we can read Previously, `cmPackageInfoReader` made the wildly optimistic assumption that it will know how to read any CPS version that is less than 1.0 (note, the current version as of writing is 0.13). This is likely not a safe assumption. Assume instead that we only know how to read the current minor version, i.e. 0.13.x. This still allows room for the specification to make non-breaking changes, while also providing a better path for making breaking changes without CMake wrongly thinking it still understands what it's reading. --- Source/cmPackageInfoReader.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmPackageInfoReader.cxx b/Source/cmPackageInfoReader.cxx index 97a4d0c56b..66ab273ba6 100644 --- a/Source/cmPackageInfoReader.cxx +++ b/Source/cmPackageInfoReader.cxx @@ -129,7 +129,7 @@ bool CheckSchemaVersion(Json::Value const& data) // Check that we understand this version. return cmSystemTools::VersionCompare(cmSystemTools::OP_GREATER_EQUAL, version, "0.13") && - cmSystemTools::VersionCompare(cmSystemTools::OP_LESS, version, "1"); + cmSystemTools::VersionCompare(cmSystemTools::OP_LESS, version, "0.14"); // TODO Eventually this probably needs to return the version tuple, and // should share code with cmPackageInfoReader::ParseVersion.