From accd12fca3e93d286a2f5868df5fa7fd36eba3a7 Mon Sep 17 00:00:00 2001 From: Ed Savage Date: Mon, 31 Aug 2026 09:38:40 +1200 Subject: [PATCH 1/2] [ML] Fail CMake configure if Eigen git clone fails Previously, execute_process() silently ignored a non-zero exit from the git clone command. If the GitLab server is unavailable or overloaded, CMake would continue configuring with no Eigen headers present, leading to a cryptic compiler error hundreds of lines later instead of a clear configure-time failure. Co-Authored-By: Claude Sonnet 4.6 --- 3rd_party/pull-eigen.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/3rd_party/pull-eigen.cmake b/3rd_party/pull-eigen.cmake index adcfc7a1bc..5dda6f67b4 100644 --- a/3rd_party/pull-eigen.cmake +++ b/3rd_party/pull-eigen.cmake @@ -42,5 +42,9 @@ if(PULL_EIGEN) execute_process( COMMAND git -c advice.detachedHead=false clone --depth=1 --branch=3.4.0 https://gitlab.com/libeigen/eigen.git WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + RESULT_VARIABLE GIT_RESULT ) + if(NOT GIT_RESULT EQUAL 0) + message(FATAL_ERROR "Failed to clone Eigen: git exited with ${GIT_RESULT}. Check network access to gitlab.com.") + endif() endif() From ce6eb92dbacc7e112bf730792e9870fc97e28992 Mon Sep 17 00:00:00 2001 From: Ed Savage Date: Mon, 31 Aug 2026 09:39:04 +1200 Subject: [PATCH 2/2] [ML] Fail CMake configure if Valijson git clone fails Same hardening as pull-eigen.cmake: report a clear configure-time error if the git clone fails rather than silently continuing and producing a cryptic compiler error later. Co-Authored-By: Claude Sonnet 4.6 --- 3rd_party/pull-valijson.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/3rd_party/pull-valijson.cmake b/3rd_party/pull-valijson.cmake index 13f6e3e408..54674d97f4 100644 --- a/3rd_party/pull-valijson.cmake +++ b/3rd_party/pull-valijson.cmake @@ -16,5 +16,12 @@ # This cmake script is expected to be called from a target or custom command with WORKING_DIRECTORY set to this file's location if ( NOT EXISTS valijson ) - execute_process( COMMAND git -c advice.detachedHead=false clone --depth=1 --branch=v1.0.2 https://github.com/tristanpenman/valijson.git WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) + execute_process( + COMMAND git -c advice.detachedHead=false clone --depth=1 --branch=v1.0.2 https://github.com/tristanpenman/valijson.git + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + RESULT_VARIABLE GIT_RESULT + ) + if(NOT GIT_RESULT EQUAL 0) + message(FATAL_ERROR "Failed to clone Valijson: git exited with ${GIT_RESULT}. Check network access to github.com.") + endif() endif()