Skip to content

[ML]Fail CMake configure if 3rd-party git clone fails - #3164

Merged
edsavage merged 3 commits into
elastic:mainfrom
edsavage:fix/harden-3rd-party-cmake-clones
Aug 31, 2026
Merged

[ML]Fail CMake configure if 3rd-party git clone fails#3164
edsavage merged 3 commits into
elastic:mainfrom
edsavage:fix/harden-3rd-party-cmake-clones

Conversation

@edsavage

@edsavage edsavage commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds RESULT_VARIABLE checking to the execute_process() git clone call in pull-eigen.cmake.
  • Previously, a transient failure (e.g. GitLab overloaded) would be silently ignored, CMake would finish configuring, and the build would fail hundreds of lines later with a cryptic fatal error: Eigen/Core: No such file or directory.
  • With this change, CMake configure fails immediately with a clear message pointing at the network issue.

Root cause

The 9.4 and 9.5 snapshot builds on 2026-08-30 failed with Eigen/Core: No such file or directory. The build log showed:

Cloning into 'eigen'...
fatal: remote error: GitLab is currently unable to handle this request due to load (ID a3316bd44fafacac-ORD).

CMake continued silently and the compiler later failed when trying to include Eigen headers.

Test plan

  • Confirmed the fix correctly uses RESULT_VARIABLE per the CMake execute_process() docs
  • CI on this PR will exercise a successful clone (non-zero result path can be tested by temporarily pointing at a bad URL)

🤖 Generated with Claude Code

edsavage and others added 2 commits August 31, 2026 09:46
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
@elasticsearchmachine

Copy link
Copy Markdown

Pinging @elastic/ml-core (Team:ML)

@edsavage edsavage added v9.5.3 auto-backport Automatically merge backport PRs when CI passes and removed v9.5.4 labels Aug 30, 2026
@edsavage
edsavage requested a lite review from Copilot August 31, 2026 02:14

Copilot AI left a comment

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.

🟢 Approval recommended

The change is small and low-risk, and the new failure mode correctly surfaces clone errors during configure rather than later during compilation.

Pull request overview

This PR hardens third-party dependency fetching during CMake configure by failing fast when git clone fails, avoiding later compile errors due to missing headers.

Changes:

  • Add RESULT_VARIABLE checking for the Eigen clone and terminate configure with FATAL_ERROR on failure.
  • Apply the same failure-fast behavior to the Valijson clone.
File summaries
File Description
3rd_party/pull-eigen.cmake Fail CMake configure immediately if cloning Eigen fails.
3rd_party/pull-valijson.cmake Fail CMake configure immediately if cloning Valijson fails.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread 3rd_party/pull-eigen.cmake
Comment thread 3rd_party/pull-valijson.cmake
…causes

Address Copilot review: include the clone URL in the error message and
replace "Check network access to X" with "Check network connectivity,
proxy settings, and git availability" since git clone can fail for
reasons beyond simple network access.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@edsavage
edsavage requested a review from valeriy42 August 31, 2026 03:33
@edsavage
edsavage merged commit f95b8ef into elastic:main Aug 31, 2026
24 checks passed
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
8.19
9.4
9.5

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

@edsavage edsavage changed the title Fail CMake configure if 3rd-party git clone fails [ML]Fail CMake configure if 3rd-party git clone fails Aug 31, 2026
elastic-vault-github-plugin-prod Bot added a commit that referenced this pull request Aug 31, 2026
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.

Same hardening for valijson as for 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.

(cherry picked from commit f95b8ef)

Co-authored-by: Ed Savage <ed.savage@elastic.co>
elastic-vault-github-plugin-prod Bot added a commit that referenced this pull request Aug 31, 2026
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.

Same hardening for valijson as for 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.

(cherry picked from commit f95b8ef)

Co-authored-by: Ed Savage <ed.savage@elastic.co>
elastic-vault-github-plugin-prod Bot added a commit that referenced this pull request Aug 31, 2026
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.

Same hardening for valijson as for 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.

(cherry picked from commit f95b8ef)

Co-authored-by: Ed Savage <ed.savage@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically merge backport PRs when CI passes >build :ml v8.19.22 v9.4.7 v9.5.3 v9.6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants