Fix manylinux wheel build: expose fetched Eigen3 package to autodiff#170
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/astomodynamics/cddp-cpp/sessions/d5123e79-a2a1-4266-96df-598f5362b4fc Co-authored-by: astomodynamics <49183997+astomodynamics@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions wheel build for autodiff dependency
Fix manylinux wheel build: expose fetched Eigen3 package to autodiff
Apr 4, 2026
astomodynamics
approved these changes
Apr 4, 2026
Owner
astomodynamics
left a comment
There was a problem hiding this comment.
Approve #170 . The change is minimal and targeted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
autodiffruns its ownfind_package(Eigen3)in config mode during CMake configuration, looking forEigen3Config.cmake. When Eigen is fetched viaFetchContent, the file is generated in the build tree but never added to CMake's search path — soautodifffails even thoughEigen3::Eigentarget already exists.Changes
Eigen3_DIRafter fetching Eigen — points to${eigen_BINARY_DIR}whereEigen3Config.cmakeis generated, making subsequentfind_package(Eigen3)calls (including fromautodiff) succeedEigen3::Eigenas an INTERFACE IMPORTED target if Eigen's CMake didn't create ittarget_link_librariesnow unconditionally linksEigen3::Eigeninstead of a conditional generator expressiontarget_include_directories(... EIGEN3_INCLUDE_DIRS)block is superseded by the proper targetWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
gitlab.com/usr/lib/git-core/git-remote-https /usr/lib/git-core/git-remote-https origin REDACTED(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Fix the failing GitHub Actions wheel build in repository
astomodynamics/cddp-cpp.Context:
23988531721, job69964331629..github/workflows/publish.yml.Build wheelsstep usingcibuildwheelon Linux manylinux.autodiffdependency because Eigen3 cannot be found:CMake Error at /tmp/tmp6h41tzny/build/_deps/autodiff-src/CMakeLists.txt:29 (find_package):By not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Eigen3"...CMakeLists.txt.github/workflows/publish.ymlpyproject.tomlpython/CMakeLists.txtObserved current behavior in
CMakeLists.txt:find_package(Eigen3 QUIET).FetchContentand setsEIGEN3_INCLUDE_DIRS.autodiffwithFetchContent_MakeAvailable(autodiff).autodiffperforms its ownfind_package(Eigen3)and expects a proper CMake package/target, which is not available in the isolated cibuildwheel manylinux environment.Goal:
Suggested direction:
autodiffas a proper CMake target/package beforeFetchContent_MakeAvailable(autodiff)is invoked.Eigen3::Eigenexists and is usable by downstream CMake logic.Eigen3::Eigendirectly instead of relying on ad hoc include directory fallbacks.Please implement the fix, verify the relevant files changed appropriately, and open a pull request with a concise title and summary.
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.
Assistant: The job is failing during the Linux wheel build (cibuildwheel/manylinux) at CMake configure time because a dependency brought in via
FetchContent(autodiff) runs:and Eigen3 is not discoverable inside the wheel build environment, so configuration aborts:
Your top-level
CMakeLists.txttries to handle Eigen by downloading it when not found (lines 65–77), but that does not helpautodiffbecause:autodiffis configured as its own CMake project, and it performs its ownfind_package(Eigen3)(and fails) before it can use your include directories.EIGEN3_INCLUDE_DIRSin your project won’t satisfyautodiff’sfind_package(Eigen3).Fix (recommended): Fetch Eigen and expose a proper
Eigen3::Eigentarget beforeautodiffPatch
CMakeLists.txt(ref:0d7ab73ccf85c03cf238f0477af9d8a3b21e75ad) so that if Eigen isn’t found, you fetch it and create/import theEigen3::Eigentarget that downstream projects (likeautodiff) expect.Replace your Eigen block (currently around lines 65–77) with something like:
Then simplify your library linking to always link against
Eigen3::Eigen:and remove the conditional include hack:
Why this works:
autodiff’sfind_package(Eigen3)will succeed if CMake can “see” Eigen as a proper package/target. By ensuring the canonicalEigen3::Eigentarget exists early, you make the dependency graph consistent even in isolated build environments li...This pull request was created from Copilot chat.