Skip to content

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

Closed
zfergus wants to merge 1 commit into
mainfrom
eigen-github-fallback
Closed

zfergus wants to merge 1 commit into
mainfrom
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.

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>
@zfergus zfergus closed this Oct 21, 2026
@zfergus
zfergus deleted the eigen-github-fallback branch October 21, 2026 15:26
@zfergus

zfergus commented Oct 21, 2026

Copy link
Copy Markdown
Member Author

Superseded by #277, which carries the same commit on fix/eigen-github-fallback to follow the branch naming convention.

@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.97%. Comparing base (7017fa9) to head (e6cf2a6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #276   +/-   ##
=======================================
  Coverage   96.97%   96.97%           
=======================================
  Files         221      221           
  Lines       22426    22426           
  Branches     1540     1540           
=======================================
+ Hits        21747    21748    +1     
+ Misses        679      678    -1     
Flag Coverage Δ
unittests 96.97% <ø> (+<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.

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