Support OpenCV 5; cover both majors in CI#64
Merged
Conversation
OpenCV's config treats major versions as incompatible, so find_package(OpenCV 4.0 REQUIRED) rejected 5.x outright. That is what broke macOS CI when Homebrew moved the opencv formula to 5.0.0, and #57 papered over it by pinning to the keg-only opencv@4. Verified before changing anything that OpenCV 5 actually works: a throwaway probe job built the library, the examples and the full suite against 5.0.0 on macOS with only the version constraint relaxed, and everything passed. The OpenCV surface here is small -- cv::Mat, cv::Vec3b, CV_8UC3 -- and none of it changed in 5.x. The constraint is now unversioned with an explicit floor, so a genuinely too-old OpenCV still fails loudly with a readable message rather than the config-file rejection. The resolved version is reported at configure time. CI covers both majors rather than trading one silent breakage for another: pinning only to opencv@4 would let a future 5.x incompatibility land unnoticed, and testing only 5 would drop the version most distributions still ship. Fixes #56 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Fixes #56.
OpenCV's config treats major versions as incompatible, so
find_package(OpenCV 4.0 REQUIRED)rejected 5.x outright. That is what broke macOS CI when Homebrew moved theopencvformula to 5.0.0. #57 papered over it by pinning to the keg-onlyopencv@4, which unblocked CI but left the underlying question open.I checked before changing anything
Rather than relax the constraint and hope, I ran a throwaway probe job (run 29665231151) that built against OpenCV 5.0.0 on macOS with only the version pin changed:
Library, examples and the full suite all clean. That pass is real, not the empty-suite result from #55 —
ctestruns with--no-tests=errornow.This matches expectations: the OpenCV surface here is small (
cv::Mat,cv::Vec3b,CV_8UC3) and none of it changed in 5.x.Change
The constraint is unversioned with an explicit floor:
A genuinely too-old OpenCV still fails, now with a readable message instead of the config-file rejection. The resolved version is printed at configure time.
CI covers both majors
Rather than trade one silent breakage for another. Pinning only to
opencv@4would let a future 5.x incompatibility land unnoticed; testing only 5 would drop the version most distributions still ship — Ubuntu'slibopencv-devis still 4.x, so the Linux job continues to cover that path too.Matrix is now Linux (4.x via apt), macOS +
opencv@4, macOS +opencv(5.x).🤖 Generated with Claude Code