Bump googletest to v1.18.0 - #4615
Conversation
|
This comment was written by Claude (Claude Code), at @d-torrance's request, after investigating the Two CMake-only commits have been added. Neither is a googletest change — the first one fixes a pre-existing bug that the temporary Why
|
…selves A cached <Package>_DIR outranks CMAKE_PREFIX_PATH for as long as it still satisfies the requested version, so once one is set, find_package keeps returning the copy on the system even after we have installed our own into M2_HOST_PREFIX, which comes first in the prefix path. This broke BUILD_LIBRARIES=gtest. memtailor, mathic and mathicgb each guard their own find_package(GTest) with "if(NOT GTEST_FOUND)", which fires exactly when check-libraries has unset GTEST_FOUND to request a self-build, and that re-caches GTest_DIR pointing at the system copy after the loop below has cleared it. check-libraries then reads that stale value at the top of the next configure and unsets GTEST_FOUND again, so the reconfigure driven by the build-libraries target never converged: Macaulay2/e/CMakeLists.txt skipped target_link_libraries(M2-unit-tests GTest::GTest GTest::Main) every time and M2-unit-tests failed to link with undefined testing:: symbols. Only builds against a system googletest of 1.16 or newer were affected, which is why this showed up on macOS (Homebrew has 1.18.0) but not on Ubuntu, where libgtest-dev is 1.14.0: there the cached GTest_DIR fails the version check in find_package(GTest 1.16) and cmake carries on searching, finding our own copy under M2_HOST_PREFIX by itself. GTest is the only entry of LIBRARY_OPTIONS that anything else calls find_package on, so it is the only one that could not converge, but clear the stale entry for every library we intend to build rather than special-casing. BUILD_LIBRARIES is now folded to upper case once here rather than once per iteration of the loop below, which is left in place so that it does not depend on this one having run. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The copy was guarded only on the destination not already existing, so it happened once, on the first configure -- at which point GFTABLESDIR still points at the factory that was already on the system. With BUILD_LIBRARIES=factory, GFTABLESDIR moves to M2_HOST_PREFIX on the reconfigure that the build-libraries target performs, but the destination exists by then and the tables we just built were never picked up, so we distributed the system's tables alongside our own factory. Copy again when GFTABLESDIR differs from wherever we last copied from, and remove the previous copy first: file(COPY) optimizes out files whose timestamps match, and it compares them at a coarser resolution than it writes them, so it will not reliably replace the earlier tables in place. Removing first also drops any tables that are no longer present upstream. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Builds passed! |
Googletest 1.18.0 was just released.
Draft for now to test the builds.
No AI usedI asked Claude to diagnose why the macOS cmake build was failing, and it added a couple commits. See below.