Skip to content

Fall back to the GitHub mirror when cloning Eigen fails - #277

Merged
zfergus merged 2 commits into
mainfrom
fix/eigen-github-fallback
Oct 21, 2026
Merged

zfergus merged 2 commits into
mainfrom
fix/eigen-github-fallback

Conversation

@zfergus

@zfergus zfergus commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Description

Lets the Eigen CPM recipe (cmake/recipes/eigen.cmake) fall back to the GitHub mirror when GitLab can't be reached. Cloning from GitLab fails often enough in CI to break the wheel builds.

  • Before CPMAddPackage runs, a git ls-remote call (30 s timeout) checks that GitLab has the tag. If it doesn't answer, the recipe warns and clones from eigen-mirror/eigen instead.
    • A failed clone inside CPMAddPackage is a fatal error and can't be retried, so the source has to be picked before CPM runs.
  • The check is skipped when nothing needs downloading: Eigen is already in the CPM cache or _deps, CPM_eigen_SOURCE is set, or FETCHCONTENT_FULLY_DISCONNECTED is on.
  • CUSTOM_CACHE_KEY 5.0.1 makes both sources share ${CPM_SOURCE_CACHE}/eigen/5.0.1. Both have tag 5.0.1 at the same commit, bc3b398.

Impacts:

  • Existing CPM caches clone Eigen once more into the new tag-keyed directory.
  • When GitLab can't be reached, configure prints a CMake warning instead of failing.
  • Not covered: if GitLab answers the check but the clone itself fails partway, the build still fails.

Also documents the branch naming convention (^(feature|bugfix|fix|refactor|docs|chore|test|release)/.+, except main, v[0-9.]*, and gh-pages) in CLAUDE.md.

Type of change

  • Enhancement (non-breaking change which improves existing functionality)

How Has This Been Tested?

I configured a minimal project that includes the recipe, using an empty CPM_SOURCE_CACHE. To simulate an outage, I redirected gitlab.com to a dead address through git's url.<base>.insteadOf setting.

  • GitLab reachable: clones from GitLab at bc3b398, no warning.
  • GitLab blocked: warns and clones bc3b398 from the GitHub mirror.
  • GitLab blocked, Eigen already cached: no check, no clone, configure succeeds.
  • Full project configure (-DIPC_TOOLKIT_BUILD_TESTS=ON) succeeds with the new cache layout.

Test Configuration:

  • OS and Version: macOS 26.6.2
  • CMake: 4.1.1

Checklist

  • I have followed the project style guide
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings

- Probe GitLab with git ls-remote before CPM clones Eigen
- Key the CPM cache on the tag so both sources share one copy

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.98%. Comparing base (7017fa9) to head (7599c40).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #277   +/-   ##
=======================================
  Coverage   96.97%   96.98%           
=======================================
  Files         221      221           
  Lines       22426    22426           
  Branches     1540     1539    -1     
=======================================
+ Hits        21747    21749    +2     
+ Misses        679      677    -2     
Flag Coverage Δ
unittests 96.98% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zfergus
zfergus merged commit 7f0e0c8 into main Oct 21, 2026
15 checks passed
@zfergus
zfergus deleted the fix/eigen-github-fallback branch October 21, 2026 16:35
@zfergus zfergus added this to the v1.6.1 milestone Oct 21, 2026
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